runtest: use numeric compare instead of string where appropriate

This commit is contained in:
Denis Vlasenko
2008-04-26 10:14:25 +00:00
parent 16afa38a7b
commit 64d5bfda1a

View File

@ -37,7 +37,7 @@ run_applet_testcase()
# echo "Running testcase $testcase" # echo "Running testcase $testcase"
d="$tsdir" sh -x -e "$testcase" >"$testname.stdout.txt" 2>&1 d="$tsdir" sh -x -e "$testcase" >"$testname.stdout.txt" 2>&1
status=$? status=$?
if [ $status != 0 ]; then if [ $status -ne 0 ]; then
echo "FAIL: $testname" echo "FAIL: $testname"
if [ x"$VERBOSE" != x ]; then if [ x"$VERBOSE" != x ]; then
cat "$testname.stdout.txt" cat "$testname.stdout.txt"
@ -71,7 +71,7 @@ run_applet_tests()
continue continue
fi fi
run_applet_testcase "$applet" "$testcase" run_applet_testcase "$applet" "$testcase"
test $? = 0 || status=1 test $? -eq 0 || status=1
done done
return $status return $status
} }
@ -125,7 +125,7 @@ for applet in $applets; do
# Any old-style tests for this applet? # Any old-style tests for this applet?
if [ "$applet" != "CVS" -a -d "$tsdir/$applet" ]; then if [ "$applet" != "CVS" -a -d "$tsdir/$applet" ]; then
run_applet_tests "$applet" run_applet_tests "$applet"
test $? = 0 || status=1 test $? -eq 0 || status=1
fi fi
# Is this a new-style test? # Is this a new-style test?
@ -139,14 +139,14 @@ for applet in $applets; do
fi fi
# echo "Running test ${tsdir:-.}/${applet}.tests" # echo "Running test ${tsdir:-.}/${applet}.tests"
PATH="$LINKSDIR:$tsdir:$bindir:$PATH" "${tsdir:-.}/${applet}.tests" PATH="$LINKSDIR:$tsdir:$bindir:$PATH" "${tsdir:-.}/${applet}.tests"
test $? = 0 || status=1 test $? -eq 0 || status=1
fi fi
done done
# Leaving the dir makes it somewhat easier to run failed test by hand # Leaving the dir makes it somewhat easier to run failed test by hand
#rm -rf "$LINKSDIR" #rm -rf "$LINKSDIR"
if [ $status != 0 -a x"$VERBOSE" = x ]; then if [ $status -ne 0 -a x"$VERBOSE" = x ]; then
echo "Failures detected, running with -v (verbose) will give more info" echo "Failures detected, running with -v (verbose) will give more info"
fi fi
exit $status exit $status