don't clobber cmp's exit code with diff's exit code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
diff --git a/regress/cmdline/checkout.sh b/regress/cmdline/checkout.sh
index 165d22e..15e1d04 100755
--- a/regress/cmdline/checkout.sh
+++ b/regress/cmdline/checkout.sh
@@ -46,10 +46,11 @@ function test_checkout_basic {
$testroot/wt/gamma/delta > $testroot/content
cmp $testroot/content.expected $testroot/content
- if [ "$?" != "0" ]; then
+ ret="$?"
+ if [ "$ret" != "0" ]; then
diff -u $testroot/content.expected $testroot/content
fi
- test_done "$testroot" "$?"
+ test_done "$testroot" "$ret"
}
run_test test_checkout_basic
diff --git a/regress/cmdline/update.sh b/regress/cmdline/update.sh
index 644f3de..67fd426 100755
--- a/regress/cmdline/update.sh
+++ b/regress/cmdline/update.sh
@@ -50,10 +50,11 @@ function test_update_basic {
$testroot/wt/gamma/delta > $testroot/content
cmp $testroot/content.expected $testroot/content
- if [ "$?" != "0" ]; then
+ ret="$?"
+ if [ "$ret" != "0" ]; then
diff -u $testroot/content.expected $testroot/content
fi
- test_done "$testroot" "$?"
+ test_done "$testroot" "$ret"
}
function test_update_adds_file {
@@ -92,10 +93,11 @@ function test_update_adds_file {
$testroot/wt/gamma/delta $testroot/wt/gamma/new > $testroot/content
cmp $testroot/content.expected $testroot/content
- if [ "$?" != "0" ]; then
+ ret="$?"
+ if [ "$ret" != "0" ]; then
diff -u $testroot/content.expected $testroot/content
fi
- test_done "$testroot" "$?"
+ test_done "$testroot" "$ret"
}
function test_update_deletes_file {
@@ -136,10 +138,11 @@ function test_update_deletes_file {
$testroot/wt/gamma/delta > $testroot/content
cmp $testroot/content.expected $testroot/content
- if [ "$?" != "0" ]; then
+ ret="$?"
+ if [ "$ret" != "0" ]; then
diff -u $testroot/content.expected $testroot/content
fi
- test_done "$testroot" "$?"
+ test_done "$testroot" "$ret"
}
run_test test_update_basic