blob: ef4260d1c413211792b4126c095895ee036f6e8c [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001#!/bin/sh
2
Brad Bishop79641f22019-09-10 07:20:22 -04003# run-ptest - 'ptest' test infrastructure shell script that
Patrick Williams93c203f2021-10-06 16:15:23 -05004# wraps the libevent test scripts
Brad Bishop79641f22019-09-10 07:20:22 -04005#
6# Trevor Gamblin <trevor.gamblin@windriver.com>
7###############################################################
8LIBEVENTLIB=@libdir@/libevent
9LOG="${LIBEVENTLIB}/ptest/libevent_ptest_$(date +%Y%m%d-%H%M%S).log"
10
Patrick Williams93c203f2021-10-06 16:15:23 -050011cd ${LIBEVENTLIB}/ptest
Brad Bishop79641f22019-09-10 07:20:22 -040012
Brad Bishopacc069e2019-09-13 06:48:36 -040013# Run only the libevent "regress" test. All other test scripts in the
14# libevent "test" folder are related to performance, e.g. read/write
15# rates, and/or do not provide a pass/fail output that can be recorded
16# in the ptest log.
17./test/regress 2>&1| sed -e '/TESTS/d' -e '/tests/d' -e '/OK/ s/^/PASS: / ; /FAILED/ s/^/FAIL: / ; /SKIPPED/ s/^/SKIP: / ; /DISABLED/ s/^/SKIP: /' | cut -f1,2 -d ':' | tee -a ${LOG}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050018
Patrick Williams93c203f2021-10-06 16:15:23 -050019passed=`grep PASS: ${LOG}|wc -l`
20failed=`grep FAIL: ${LOG}|wc -l`
21skipped=`grep -E SKIP: ${LOG}|wc -l`
Brad Bishop79641f22019-09-10 07:20:22 -040022all=$((passed + failed + skipped))
23
24( echo "=== Test Summary ==="
25 echo "TOTAL: ${all}"
26 echo "PASSED: ${passed}"
27 echo "FAILED: ${failed}"
28 echo "SKIPPED: ${skipped}"
29) | tee -a ${LOG}