Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame^] | 3 | JQ_LIB=@libdir@/jq |
| 4 | LOG="${JQ_LIB}/ptest/jq_ptest_$(date +%Y%m%d-%H%M%S).log" |
| 5 | |
| 6 | # clean up the log file to avoid a file has the same name and has existing content |
| 7 | echo "" > ${LOG} |
| 8 | |
| 9 | # The purpose of ptest is doing intergration test, so disable valgrind by default |
| 10 | # change PACKAGECOFIG to enable valgrind. |
| 11 | #export NO_VALGRIND=1 |
| 12 | # The --enable-valgrind configure option for jq only can be used within Makefiles, |
| 13 | # and it cannot be utilized here since it also checks compile, which cannot be avoid |
| 14 | # Requested enhancement to jq: https://github.com/stedolan/jq/issues/2493 |
| 15 | |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 16 | for test in optionaltest mantest jqtest onigtest shtest utf8test base64test; do |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame^] | 17 | ./tests/${test} >> ${LOG} 2>> ${LOG} |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 18 | if [ $? -eq 0 ]; then |
| 19 | echo "PASS: ${test}" |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame^] | 20 | echo "PASS: ${test}" >> ${LOG} |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 21 | else |
| 22 | echo "FAIL: ${test}" |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame^] | 23 | echo "FAIL: ${test}" >> ${LOG} |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 24 | fi |
| 25 | done |
| 26 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame^] | 27 | passed=`grep PASS: ${LOG}|wc -l` |
| 28 | failed=`grep FAIL: ${LOG}|wc -l` |
| 29 | skipped=`grep SKIP: ${LOG}|wc -l` |
| 30 | all=$((passed + failed + skipped)) |
| 31 | |
| 32 | ( echo "=== Test Summary ===" |
| 33 | echo "TOTAL: ${all}" |
| 34 | echo "PASSED: ${passed}" |
| 35 | echo "FAILED: ${failed}" |
| 36 | echo "SKIPPED: ${skipped}" |
| 37 | ) | tee -a /${LOG} |