blob: caeae84d4fc7e956cae88d0d308a1ca6f607e588 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001#!/bin/sh
2
3# run-ptest - 'ptest' test infrastructure shell script that
4# wraps the valgrind regression script vg_regtest.
Patrick Williamsc124f4f2015-09-15 14:41:29 -05005#
6# Dave Lerner <dave.lerner@windriver.com>
Brad Bishopa34c0302019-09-23 22:34:48 -04007# Randy MacLeod <Randy.MacLeod@windriver.com>
Patrick Williamsc124f4f2015-09-15 14:41:29 -05008###############################################################
Brad Bishopa34c0302019-09-23 22:34:48 -04009VALGRIND_LIB=@libdir@/valgrind
Andrew Geisslerc926e172021-05-07 16:11:35 -050010VALGRIND_LIBEXECDIR=@libexecdir@/valgrind
Brad Bishopa34c0302019-09-23 22:34:48 -040011VALGRIND_BIN=@bindir@/valgrind
Brad Bishopd7bf8c12018-02-25 22:55:05 -050012
Brad Bishopa34c0302019-09-23 22:34:48 -040013LOG="${VALGRIND_LIB}/ptest/valgrind_ptest_$(date +%Y%m%d-%H%M%S).log"
14
15TOOLS="memcheck cachegrind callgrind helgrind drd massif dhat lackey none"
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060016EXP_TOOLS="exp-bbv"
Brad Bishopa34c0302019-09-23 22:34:48 -040017
18GDB_BIN=@bindir@/gdb
19cd ${VALGRIND_LIB}/ptest && ./gdbserver_tests/make_local_links ${GDB_BIN}
20
Andrew Geisslerd1e89492021-02-12 15:35:20 -060021echo "Hide valgrind tests that are non-deterministic"
22echo "Reported at https://bugs.kde.org/show_bug.cgi?id=430321"
23for i in `cat remove-for-all`; do
24 mv $i.vgtest $i.IGNORE;
25done
26
Brad Bishopa34c0302019-09-23 22:34:48 -040027arch=`arch`
28if [ "$arch" = "aarch64" ]; then
29 echo "Aarch64: Hide valgrind tests that result in defunct process and then out of memory"
30 for i in `cat remove-for-aarch64`; do
31 mv $i.vgtest $i.IGNORE;
32 done
33fi
34
Andrew Geissler09036742021-06-25 14:25:14 -050035echo "Run flaky tests using taskset to limit them to a single core."
36for i in `cat taskset_nondeterministic_tests`; do
37 taskset 0x00000001 perl tests/vg_regtest --valgrind=${VALGRIND_BIN} --valgrind-lib=${VALGRIND_LIBEXECDIR} --yocto-ptest $i 2>&1|tee -a ${LOG}
38 mv $i.vgtest $i.IGNORE
39done
40
41
Brad Bishopa34c0302019-09-23 22:34:48 -040042cd ${VALGRIND_LIB}/ptest && ./tests/vg_regtest \
43 --valgrind=${VALGRIND_BIN} \
Andrew Geisslerc926e172021-05-07 16:11:35 -050044 --valgrind-lib=${VALGRIND_LIBEXECDIR} \
Brad Bishopa34c0302019-09-23 22:34:48 -040045 --yocto-ptest \
46 gdbserver_tests ${TOOLS} ${EXP_TOOLS} \
Andrew Geissler09036742021-06-25 14:25:14 -050047 2>&1|tee -a ${LOG}
Brad Bishopa34c0302019-09-23 22:34:48 -040048
49cd ${VALGRIND_LIB}/ptest && \
50 ./tests/post_regtest_checks $(pwd) \
51 gdbserver_tests ${TOOLS} ${EXP_TOOLS} \
52 2>&1|tee -a ${LOG}
53
54if [ "$arch" = "aarch64" ]; then
55 echo "Aarch64: Restore valgrind tests that result in defunct process and then out of memory"
56 for i in `cat remove-for-aarch64`; do
57 mv $i.IGNORE $i.vgtest;
58 done
59fi
60
Andrew Geisslerd1e89492021-02-12 15:35:20 -060061echo "Restore valgrind tests that are non-deterministc"
62for i in `cat remove-for-all`; do
63 mv $i.IGNORE $i.vgtest;
64done
Brad Bishopd7bf8c12018-02-25 22:55:05 -050065
Andrew Geissler09036742021-06-25 14:25:14 -050066echo "Restore flaky and other non-deterministic tests"
67for i in `cat taskset_nondeterministic_tests`; do
68 mv $i.IGNORE $i.vgtest;
69done
70
Andrew Geissler3b8a17c2021-04-15 15:55:55 -050071echo "Failed test details..."
72failed_tests=`grep FAIL: ${LOG} | awk '{print $2}'`
73for test in $failed_tests; do
74 for diff_results in `ls $test*.diff`; do
75 echo $diff_results
76 echo '************'
77 cat $diff_results
78 done
79done
80
Brad Bishopd7bf8c12018-02-25 22:55:05 -050081passed=`grep PASS: ${LOG}|wc -l`
82failed=`grep FAIL: ${LOG}|wc -l`
83skipped=`grep SKIP: ${LOG}|wc -l`
84all=$((passed + failed + skipped))
85
86( echo "=== Test Summary ==="
87 echo "TOTAL: ${all}"
88 echo "PASSED: ${passed}"
89 echo "FAILED: ${failed}"
90 echo "SKIPPED: ${skipped}"
91) | tee -a /${LOG}