test.sh: Log exit code, print yes/no instead of 1/0

Šī revīzija ir iekļauta:
Albert S. 2021-08-16 23:08:16 +02:00
vecāks f6af1bb78f
revīzija e389140436

12
test.sh
Parādīt failu

@ -38,14 +38,14 @@ function runtest()
echo "Running: $testname. Date: $(date)" > "${test_log_file}"
echo -n "Running $1... "
#exit 1 to suppress shell message like "./test.sh: line 18: pid Bad system call"
(./test $1 || exit 1) &>> "${test_log_file}"
#exit $? to suppress shell message like "./test.sh: line 18: pid Bad system call"
(./test $1 || exit $?) &>> "${test_log_file}"
ret=$?
SUCCESS=0
SUCCESS="no"
if [ $must_exit_zero -eq 1 ] ; then
if [ $ret -eq 0 ] ; then
runtest_success
SUCCESS=1
SUCCESS="yes"
else
runtest_fail
fi
@ -54,11 +54,11 @@ function runtest()
runtest_fail
else
runtest_success
SUCCESS=1
SUCCESS="yes"
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}"
}