blob: a813958b5a46d0baff52f3ed36d9c13971dae427 [file] [log] [blame]
Andrew Geissler87f5cff2022-09-30 13:13:31 -05001#!/bin/sh
2
Patrick Williams2390b1b2022-11-03 13:47:49 -05003JQ_LIB=@libdir@/jq
4LOG="${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
7echo "" > ${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 Geissler87f5cff2022-09-30 13:13:31 -050016for test in optionaltest mantest jqtest onigtest shtest utf8test base64test; do
Patrick Williams2390b1b2022-11-03 13:47:49 -050017 ./tests/${test} >> ${LOG} 2>> ${LOG}
Andrew Geissler87f5cff2022-09-30 13:13:31 -050018 if [ $? -eq 0 ]; then
19 echo "PASS: ${test}"
Patrick Williams2390b1b2022-11-03 13:47:49 -050020 echo "PASS: ${test}" >> ${LOG}
Andrew Geissler87f5cff2022-09-30 13:13:31 -050021 else
22 echo "FAIL: ${test}"
Patrick Williams2390b1b2022-11-03 13:47:49 -050023 echo "FAIL: ${test}" >> ${LOG}
Andrew Geissler87f5cff2022-09-30 13:13:31 -050024 fi
25done
26
Patrick Williams2390b1b2022-11-03 13:47:49 -050027passed=`grep PASS: ${LOG}|wc -l`
28failed=`grep FAIL: ${LOG}|wc -l`
29skipped=`grep SKIP: ${LOG}|wc -l`
30all=$((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}