| test_scripts.sh | test_scripts.sh | |||
|---|---|---|---|---|
| skipping to change at line 15 | skipping to change at line 15 | |||
| # Author: Jonathan Nieder | # Author: Jonathan Nieder | |||
| # | # | |||
| # This file has been put into the public domain. | # This file has been put into the public domain. | |||
| # You can do whatever you want with this file. | # You can do whatever you want with this file. | |||
| # | # | |||
| ########################################################################### #### | ########################################################################### #### | |||
| # If scripts weren't built, this test is skipped. | # If scripts weren't built, this test is skipped. | |||
| XZ=../src/xz/xz | XZ=../src/xz/xz | |||
| XZDIFF=../src/scripts/xzdiff | XZDIFF=../src/scripts/xzdiff | |||
| test -x "$XZ" || XZ= | XZGREP=../src/scripts/xzgrep | |||
| test -x "$XZDIFF" || XZDIFF= | ||||
| if test -z "$XZ" || test -z "$XZDIFF"; then | for i in XZ XZDIFF XZGREP; do | |||
| eval test -x "\$$i" && continue | ||||
| (exit 77) | (exit 77) | |||
| exit 77 | exit 77 | |||
| fi | done | |||
| PATH=`pwd`/../src/xz:$PATH | PATH=`pwd`/../src/xz:$PATH | |||
| export PATH | export PATH | |||
| test -z "$srcdir" && srcdir=. | ||||
| preimage=$srcdir/files/good-1-check-crc32.xz | preimage=$srcdir/files/good-1-check-crc32.xz | |||
| samepostimage=$srcdir/files/good-1-check-crc64.xz | samepostimage=$srcdir/files/good-1-check-crc64.xz | |||
| otherpostimage=$srcdir/files/good-1-lzma2-1.xz | otherpostimage=$srcdir/files/good-1-lzma2-1.xz | |||
| "$XZDIFF" "$preimage" "$samepostimage" >/dev/null | "$XZDIFF" "$preimage" "$samepostimage" >/dev/null | |||
| status=$? | status=$? | |||
| if test "$status" != 0 ; then | if test "$status" != 0 ; then | |||
| echo "xzdiff with no changes exited with status $status != 0" | echo "xzdiff with no changes exited with status $status != 0" | |||
| (exit 1) | (exit 1) | |||
| exit 1 | exit 1 | |||
| skipping to change at line 53 | skipping to change at line 55 | |||
| fi | fi | |||
| "$XZDIFF" "$preimage" "$srcdir/files/missing.xz" >/dev/null 2>&1 | "$XZDIFF" "$preimage" "$srcdir/files/missing.xz" >/dev/null 2>&1 | |||
| status=$? | status=$? | |||
| if test "$status" != 2 ; then | if test "$status" != 2 ; then | |||
| echo "xzdiff with missing operand exited with status $status != 2" | echo "xzdiff with missing operand exited with status $status != 2" | |||
| (exit 1) | (exit 1) | |||
| exit 1 | 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 | ||||
| cp "$srcdir/files/good-2-lzma2.xz" xzgrep_test_2.xz | ||||
| for pattern in el Hello NOMATCH; do | ||||
| for opts in "" "-l" "-h" "-H"; do | ||||
| echo "=> xzgrep $opts $pattern <=" | ||||
| "$XZGREP" $opts $pattern xzgrep_test_1.xz xzgrep_test_2.xz | ||||
| echo retval $? | ||||
| done | ||||
| done > xzgrep_test_output 2>&1 | ||||
| if cmp -s "$srcdir/xzgrep_expected_output" xzgrep_test_output ; then | ||||
| : | ||||
| else | ||||
| echo "unexpected output from xzgrep" | ||||
| (exit 1) | ||||
| exit 1 | ||||
| fi | ||||
| (exit 0) | (exit 0) | |||
| exit 0 | exit 0 | |||
| End of changes. 4 change blocks. | ||||
| 4 lines changed or deleted | 26 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ | ||||