OLD | NEW |
(Empty) | |
| 1 #!/bin/sh |
| 2 |
| 3 ############################################################################### |
| 4 # |
| 5 # Author: Jonathan Nieder |
| 6 # |
| 7 # This file has been put into the public domain. |
| 8 # You can do whatever you want with this file. |
| 9 # |
| 10 ############################################################################### |
| 11 |
| 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 |
| 20 fi |
| 21 |
| 22 PATH=`pwd`/../src/xz:$PATH |
| 23 export PATH |
| 24 |
| 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 |
| 28 |
| 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 |
| 35 fi |
| 36 |
| 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 |
| 43 fi |
| 44 |
| 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 |
| 51 fi |
| 52 |
| 53 (exit 0) |
| 54 exit 0 |
OLD | NEW |