blob: 60d243276b1f76349e04a3c829275813a500deb9 [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
35cd ${VALGRIND_LIB}/ptest && ./tests/vg_regtest \
36 --valgrind=${VALGRIND_BIN} \
Andrew Geisslerc926e172021-05-07 16:11:35 -050037 --valgrind-lib=${VALGRIND_LIBEXECDIR} \
Brad Bishopa34c0302019-09-23 22:34:48 -040038 --yocto-ptest \
39 gdbserver_tests ${TOOLS} ${EXP_TOOLS} \
40 2>&1|tee ${LOG}
41
42cd ${VALGRIND_LIB}/ptest && \
43 ./tests/post_regtest_checks $(pwd) \
44 gdbserver_tests ${TOOLS} ${EXP_TOOLS} \
45 2>&1|tee -a ${LOG}
46
47if [ "$arch" = "aarch64" ]; then
48 echo "Aarch64: Restore valgrind tests that result in defunct process and then out of memory"
49 for i in `cat remove-for-aarch64`; do
50 mv $i.IGNORE $i.vgtest;
51 done
52fi
53
Andrew Geisslerd1e89492021-02-12 15:35:20 -060054echo "Restore valgrind tests that are non-deterministc"
55for i in `cat remove-for-all`; do
56 mv $i.IGNORE $i.vgtest;
57done
Brad Bishopd7bf8c12018-02-25 22:55:05 -050058
Andrew Geissler3b8a17c2021-04-15 15:55:55 -050059echo "Failed test details..."
60failed_tests=`grep FAIL: ${LOG} | awk '{print $2}'`
61for test in $failed_tests; do
62 for diff_results in `ls $test*.diff`; do
63 echo $diff_results
64 echo '************'
65 cat $diff_results
66 done
67done
68
Brad Bishopd7bf8c12018-02-25 22:55:05 -050069passed=`grep PASS: ${LOG}|wc -l`
70failed=`grep FAIL: ${LOG}|wc -l`
71skipped=`grep SKIP: ${LOG}|wc -l`
72all=$((passed + failed + skipped))
73
74( echo "=== Test Summary ==="
75 echo "TOTAL: ${all}"
76 echo "PASSED: ${passed}"
77 echo "FAILED: ${failed}"
78 echo "SKIPPED: ${skipped}"
79) | tee -a /${LOG}