summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2022-10-27 01:12:40 +0300
committerLasse Collin <lasse.collin@tukaani.org>2022-10-27 01:12:40 +0300
commitc1dd8524e1af07f16b790463899de06a6a5fcc08 (patch)
tree1471d6d3a99d367fc0f397dc0d2c71f1920f23cb /tests
parentce30ada91951d0746879ae438da11f1ee8a90aa0 (diff)
downloadxz-c1dd8524e1af07f16b790463899de06a6a5fcc08.tar.gz
Tests: Keep test_compress_* working when some filters are unavailable.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_compress.sh34
1 files changed, 20 insertions, 14 deletions
diff --git a/tests/test_compress.sh b/tests/test_compress.sh
index 128ef85..0692a8b 100755
--- a/tests/test_compress.sh
+++ b/tests/test_compress.sh
@@ -77,7 +77,9 @@ test_xz() {
}
XZ="../src/xz/xz --memlimit-compress=48MiB --memlimit-decompress=5MiB \
- --no-adjust --threads=1 --check=crc64"
+ --no-adjust --threads=1 --check=crc32"
+grep "define HAVE_CHECK_CRC64" ../config.h > /dev/null \
+ && XZ="$XZ --check=crc64"
XZDEC="../src/xzdec/xzdec" # No memory usage limiter available
test -x ../src/xzdec/xzdec || XZDEC=
@@ -118,18 +120,22 @@ test_xz -2
test_xz -3
test_xz -4
-for ARGS in \
- --delta=dist=1 \
- --delta=dist=4 \
- --delta=dist=256 \
- --x86 \
- --powerpc \
- --ia64 \
- --arm \
- --armthumb \
- --sparc
-do
- test_xz $ARGS --lzma2=dict=64KiB,nice=32,mode=fast
-done
+test_filter()
+{
+ grep "define HAVE_ENCODER_$1" ../config.h > /dev/null || return
+ grep "define HAVE_DECODER_$1" ../config.h > /dev/null || return
+ shift
+ test_xz "$@" --lzma2=dict=64KiB,nice=32,mode=fast
+}
+
+test_filter DELTA --delta=dist=1
+test_filter DELTA --delta=dist=4
+test_filter DELTA --delta=dist=256
+test_filter X86 --x86
+test_filter POWERPC --power
+test_filter IA64 --ia64
+test_filter ARM --arm
+test_filter ARMTHUMB --armthumb
+test_filter SPARC --sparc
exit 0