summaryrefslogtreecommitdiffstats
path: root/tests/test-lz4-testmode.sh
diff options
context:
space:
mode:
authorTristan Partin <tristan@partin.io>2022-08-16 07:36:48 (GMT)
committerTristan Partin <tristan@partin.io>2022-10-20 04:27:05 (GMT)
commit198e532300f253ada3acac3ab5428ed991adb085 (patch)
treeb5c04cd31e42772751dac47bc6a0780b581b871d /tests/test-lz4-testmode.sh
parente312412c60140b3d061526499cef22e5e99d7751 (diff)
downloadlz4-198e532300f253ada3acac3ab5428ed991adb085.zip
lz4-198e532300f253ada3acac3ab5428ed991adb085.tar.gz
lz4-198e532300f253ada3acac3ab5428ed991adb085.tar.bz2
Update Meson build to 1.9.4
Specifically this adds support for the following options: - LZ4_ALIGN_TEST - LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION - LZ4_DISTANCE_MAX - LZ4_FAST_DEC_LOOP - LZ4_FORCE_SW_BITCOUNT - LZ4_FREESTANDING - LZ4_USER_MEMORY_FUNCTIONS - compiling ossfuzz targets - compiling more test targets - registering some tests
Diffstat (limited to 'tests/test-lz4-testmode.sh')
-rwxr-xr-xtests/test-lz4-testmode.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/test-lz4-testmode.sh b/tests/test-lz4-testmode.sh
new file mode 100755
index 0000000..d37eaad
--- /dev/null
+++ b/tests/test-lz4-testmode.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+FPREFIX="tmp-ltm"
+
+set -e
+
+remove () {
+ rm $FPREFIX*
+}
+
+trap remove EXIT
+
+set -x
+
+lz4 -bi0
+datagen > $FPREFIX
+lz4 -f $FPREFIX -c > $FPREFIX.lz4
+lz4 -bdi0 $FPREFIX.lz4 # test benchmark decode-only mode
+lz4 -bdi0 --no-crc $FPREFIX.lz4 # test benchmark decode-only mode
+echo "---- test mode ----"
+datagen | lz4 -t && exit 1
+datagen | lz4 -tf && exit 1
+echo "---- pass-through mode ----"
+echo "Why hello there " > ${FPREFIX}2.lz4
+lz4 -f ${FPREFIX}2.lz4 > $FPREFIX-trash && exit 1
+datagen | lz4 -dc > $FPREFIX-trash && exit 1
+datagen | lz4 -df > $FPREFIX-trash && exit 1
+datagen | lz4 -dcf > $FPREFIX-trash
+echo "Hello World !" > ${FPREFIX}1
+lz4 -dcf ${FPREFIX}1
+echo "from underground..." > ${FPREFIX}2
+lz4 -dcfm ${FPREFIX}1 ${FPREFIX}2
+echo "---- non-existing source (must fail cleanly) ----"
+lz4 file-does-not-exist && exit 1
+lz4 -f file-does-not-exist && exit 1
+lz4 -t file-does-not-exist && exit 1
+lz4 -fm file1-dne file2-dne && exit 1
+true