If a '-1' test program returns a non-zero status, don't go further and
compare it's (numeric) output values. This allows a '-1' test to
indicate a "skip" status or an otherwise error. (Currently no such '-1'
test would skip like this, though.)
Shell syntax note: `set -e` will not exit with the syntax like this
`test $(false) = $(false);`. The exit statuses of `false` in the
example will be ignored instead. But putting the output in a variable,
such as `VAR=$(false)`, DOES exit.
INPUT_NAME=${INPUT_NAME:-$INPUT_DIRECTORY/`basename ${TESTNAME%.exe}`.txt}
if [ "$DO_COMPARISON" -eq "1" ] ; then
- test `$TESTNAME 1 < $INPUT_NAME` -eq `$TESTNAME < $INPUT_NAME`
+ TEST_OUTPUT=`$TESTNAME < $INPUT_NAME`
+ REF_OUTPUT=`$TESTNAME 1 < $INPUT_NAME`
+ test "$TEST_OUTPUT" -eq "$REF_OUTPUT"
exit $?
- fi
+fi
if [ $INPUT_COUNT -gt 1 ] ; then
$TESTNAME ${USE_TABLES:+${INPUT_DIRECTORY}/${TESTNAME%.exe}.tables} ${INPUT_NAME}
exit $?
- fi
+fi
if [ -f ${INPUT_NAME} ] ; then
if [ $USE_REDIRECT == 1 ] ; then