Andrew Geissler | b7d2861 | 2020-07-24 16:15:54 -0500 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | output=${1:-"expat_tests.log"} # default log file |
| 4 | |
| 5 | # logging function |
| 6 | function testCheck() { |
| 7 | testExec="$1" |
| 8 | shift |
| 9 | echo && echo ${testExec} && ./${testExec} "$@" |
| 10 | error=$? |
| 11 | result=$([[ ${error} -eq 0 ]] && echo "PASS" || echo "FAIL") |
| 12 | echo "${result}: ${testExec}" && echo "============================" |
| 13 | } |
| 14 | |
| 15 | export output |
| 16 | export -f testCheck |
| 17 | TIME=$(which time) |
| 18 | |
| 19 | echo "Architecture: $(uname -m)" > ${output} |
| 20 | echo "Image: $(uname -sr)" >> ${output} |
| 21 | ${TIME} -f 'Execution time: %e s' bash -c "testCheck runtests -vv" |& tee -a ${output} |
| 22 | ${TIME} -f 'Execution time: %e s' bash -c "testCheck runtestspp -vv" |& tee -a ${output} |
| 23 | echo |