xz: Fix use of wrong variable in a fcntl() call.
[xz/debian.git] / tests / test_scripts.sh
blob293929e61950f4ce2130bc2ab56dd32ff25afa34
1 #!/bin/sh
3 ###############################################################################
5 # Author: Jonathan Nieder
7 # This file has been put into the public domain.
8 # You can do whatever you want with this file.
10 ###############################################################################
12 # If scripts weren't built, this test is skipped.
13 XZ=../src/xz/xz
14 XZDIFF=../src/scripts/xzdiff
15 test -x "$XZ" || XZ=
16 test -x "$XZDIFF" || XZDIFF=
17 if test -z "$XZ" || test -z "$XZDIFF"; then
18 (exit 77)
19 exit 77
22 PATH=`pwd`/../src/xz:$PATH
23 export PATH
25 preimage=$srcdir/files/good-1-check-crc32.xz
26 samepostimage=$srcdir/files/good-1-check-crc64.xz
27 otherpostimage=$srcdir/files/good-1-lzma2-1.xz
29 "$XZDIFF" "$preimage" "$samepostimage" >/dev/null
30 status=$?
31 if test "$status" != 0 ; then
32 echo "xzdiff with no changes exited with status $status != 0"
33 (exit 1)
34 exit 1
37 "$XZDIFF" "$preimage" "$otherpostimage" >/dev/null
38 status=$?
39 if test "$status" != 1 ; then
40 echo "xzdiff with changes exited with status $status != 1"
41 (exit 1)
42 exit 1
45 "$XZDIFF" "$preimage" "$srcdir/files/missing.xz" >/dev/null 2>&1
46 status=$?
47 if test "$status" != 2 ; then
48 echo "xzdiff with missing operand exited with status $status != 2"
49 (exit 1)
50 exit 1
53 (exit 0)
54 exit 0