Commit 941bde61 for xz

commit 941bde613e214522fcba68b1a2baf4068e5d25d7
Author: Lasse Collin <lasse.collin@tukaani.org>
Date:   Thu Nov 5 19:52:21 2026 +0200

    Tests/CMake: Put decode_byte_by_byte to the same dir as shared liblzma

    For the reasoning, see the commit 18769dd6927f ("CMake: Don't put test
    binaries in a subdirectory").

    Fixes: 13fc756371c5 ("Tests: Add decode_byte_by_byte and use it from test_files.sh")

diff --git a/tests/test_files.sh b/tests/test_files.sh
index aead9085..50ee04d8 100755
--- a/tests/test_files.sh
+++ b/tests/test_files.sh
@@ -13,6 +13,7 @@
 # If both xz and xzdec were not built, skip this test.
 XZ=${1:-../src/xz}/xz
 XZDEC=${1:-../src/xzdec}/xzdec
+DECODE_BYTE_BY_BYTE=${1:-.}/decode_byte_by_byte
 test -x "$XZ" || XZ=
 test -x "$XZDEC" || XZDEC=
 if test -z "$XZ$XZDEC"; then
@@ -106,7 +107,7 @@ do
 		exit 1
 	fi

-	./decode_byte_by_byte "$I" > /dev/null || exit 1
+	"${DECODE_BYTE_BY_BYTE}" "$I" > /dev/null || exit 1
 done

 for I in "$srcdir"/files/bad-*.xz
@@ -188,7 +189,7 @@ do
 		exit 1
 	fi

-	./decode_byte_by_byte "$I" > /dev/null || exit 1
+	"${DECODE_BYTE_BY_BYTE}" "$I" > /dev/null || exit 1
 done

 for I in "$srcdir"/files/bad-*.lzma
@@ -216,7 +217,8 @@ if have_feature LZIP_DECODER ".lz files" ; then

 		case $I in
 			*trailing*) ;;
-			*) ./decode_byte_by_byte "$I" > /dev/null || exit 1 ;;
+			*) "${DECODE_BYTE_BY_BYTE}" "$I" > /dev/null \
+					|| exit 1 ;;
 		esac
 	done

diff --git a/tests/tests.cmake b/tests/tests.cmake
index f2abc089..c746bedc 100644
--- a/tests/tests.cmake
+++ b/tests/tests.cmake
@@ -217,16 +217,12 @@ if(BUILD_TESTING)
         file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test_files")

         # test_files.sh needs the decode_byte_by_byte program.
-        # Put the executable in the above-created directory so that
-        # test_files.sh can run it with ./decode_byte_by_byte.
         add_executable(decode_byte_by_byte tests/decode_byte_by_byte.c)
         target_include_directories(decode_byte_by_byte PRIVATE
             src/common
             src/liblzma/api
         )
         target_link_libraries(decode_byte_by_byte PRIVATE liblzma tests_w32res)
-        set_target_properties(decode_byte_by_byte PROPERTIES
-                              RUNTIME_OUTPUT_DIRECTORY test_files)

         add_test(NAME test_files.sh
             COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tests/test_files.sh" ".."