summaryrefslogtreecommitdiffstats
path: root/tests/test_scripts.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-15 09:41:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-15 09:41:34 +0000
commitcf178685aca107aa37c748de11da01562e78c46c (patch)
tree84d60b39c1744edcbdd4dbfc5026583914432dba /tests/test_scripts.sh
parentAdding upstream version 5.6.1+really5.4.5. (diff)
downloadxz-utils-cf178685aca107aa37c748de11da01562e78c46c.tar.xz
xz-utils-cf178685aca107aa37c748de11da01562e78c46c.zip
Adding upstream version 5.6.2.upstream/5.6.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_scripts.sh')
-rwxr-xr-xtests/test_scripts.sh17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/test_scripts.sh b/tests/test_scripts.sh
index ee82361..ca9600e 100755
--- a/tests/test_scripts.sh
+++ b/tests/test_scripts.sh
@@ -1,18 +1,18 @@
#!/bin/sh
+# SPDX-License-Identifier: 0BSD
###############################################################################
#
# Author: Jonathan Nieder
#
-# This file has been put into the public domain.
-# You can do whatever you want with this file.
-#
###############################################################################
# If scripts weren't built, this test is skipped.
-XZ=../src/xz/xz
-XZDIFF=../src/scripts/xzdiff
-XZGREP=../src/scripts/xzgrep
+# When this is run from CMake, $1 is a relative path
+# to the directory with the executables and the scripts.
+XZ=${1:-../src/xz}/xz
+XZDIFF=${1:-../src/scripts}/xzdiff
+XZGREP=${1:-../src/scripts}/xzgrep
for i in XZ XZDIFF XZGREP; do
eval test -x "\$$i" && continue
@@ -23,14 +23,15 @@ done
# Installing the scripts in this case is a bit silly but they
# could still be used with other decompression tools so configure
# doesn't automatically disable scripts if decoders are disabled.
-if grep 'define HAVE_DECODERS' ../config.h > /dev/null ; then
+if test ! -f ../config.h \
+ || grep 'define HAVE_DECODERS' ../config.h > /dev/null ; then
:
else
echo "Decompression support is disabled, skipping this test."
exit 77
fi
-PATH=`pwd`/../src/xz:$PATH
+PATH=`pwd`/${1:-../src/xz}:$PATH
export PATH
test -z "$srcdir" && srcdir=.