test.sh: Log exit code, print yes/no instead of 1/0
This commit is contained in:
parent
f6af1bb78f
commit
e389140436
12
test.sh
12
test.sh
@ -38,14 +38,14 @@ function runtest()
|
|||||||
echo "Running: $testname. Date: $(date)" > "${test_log_file}"
|
echo "Running: $testname. Date: $(date)" > "${test_log_file}"
|
||||||
|
|
||||||
echo -n "Running $1... "
|
echo -n "Running $1... "
|
||||||
#exit 1 to suppress shell message like "./test.sh: line 18: pid Bad system call"
|
#exit $? to suppress shell message like "./test.sh: line 18: pid Bad system call"
|
||||||
(./test $1 || exit 1) &>> "${test_log_file}"
|
(./test $1 || exit $?) &>> "${test_log_file}"
|
||||||
ret=$?
|
ret=$?
|
||||||
SUCCESS=0
|
SUCCESS="no"
|
||||||
if [ $must_exit_zero -eq 1 ] ; then
|
if [ $must_exit_zero -eq 1 ] ; then
|
||||||
if [ $ret -eq 0 ] ; then
|
if [ $ret -eq 0 ] ; then
|
||||||
runtest_success
|
runtest_success
|
||||||
SUCCESS=1
|
SUCCESS="yes"
|
||||||
else
|
else
|
||||||
runtest_fail
|
runtest_fail
|
||||||
fi
|
fi
|
||||||
@ -54,11 +54,11 @@ function runtest()
|
|||||||
runtest_fail
|
runtest_fail
|
||||||
else
|
else
|
||||||
runtest_success
|
runtest_success
|
||||||
SUCCESS=1
|
SUCCESS="yes"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Finished: ${testname}. Date: $(date). Success: $SUCCESS" >> "${test_log_file}"
|
echo "Finished: ${testname}. Date: $(date). Return code: $ret. Success: $SUCCESS" >> "${test_log_file}"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user