mirror of
https://git.tukaani.org/xz.git
synced 2026-10-31 03:14:56 +00:00
Tests: test_scripts.sh: Test xzdiff with one operand
The _z test is skipped if gzip isn't available. Closes: https://github.com/tukaani-project/xz/pull/258
This commit is contained in:
parent
1b1a508859
commit
9e3a31f2fe
3
.gitignore
vendored
3
.gitignore
vendored
@ -74,6 +74,9 @@ coverage
|
||||
/tests/test_memlimit
|
||||
/tests/test_stream_flags
|
||||
/tests/test_vli
|
||||
/tests/xzdiff_test
|
||||
/tests/xzdiff_test.xz
|
||||
/tests/xzdiff_test_z
|
||||
/tests/xzgrep_test_1.xz
|
||||
/tests/xzgrep_test_2.xz
|
||||
/tests/xzgrep_test_output
|
||||
|
||||
@ -86,4 +86,5 @@ endif
|
||||
|
||||
clean-local:
|
||||
-rm -f compress_generated_* \
|
||||
xzgrep_test_output xzgrep_test_1.xz xzgrep_test_2.xz
|
||||
xzgrep_test_output xzgrep_test_1.xz xzgrep_test_2.xz \
|
||||
xzdiff_test xzdiff_test.xz xzdiff_test_z
|
||||
|
||||
@ -60,6 +60,25 @@ if test "$status" != 2 ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# With one operand, the file is compared to the same name without the suffix.
|
||||
"$XZ" -dc "$preimage" > xzdiff_test
|
||||
cp "$preimage" xzdiff_test.xz
|
||||
"$XZDIFF" xzdiff_test.xz >/dev/null
|
||||
status=$?
|
||||
if test "$status" != 0 ; then
|
||||
echo "xzdiff with one .xz operand exited with status $status != 0"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if gzip -c xzdiff_test > xzdiff_test_z 2>/dev/null ; then
|
||||
"$XZDIFF" xzdiff_test_z >/dev/null
|
||||
status=$?
|
||||
if test "$status" != 0 ; then
|
||||
echo "xzdiff with one _z operand exited with status $status != 0"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# The exit status must be 0 when a match was found at least from one file,
|
||||
# and 1 when no match was found in any file.
|
||||
cp "$srcdir/files/good-1-lzma2-1.xz" xzgrep_test_1.xz
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user