blob: f37780ef6ae5b0f7ecb49fe7b2ae448b9fb23f19 [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
10VALGRIND_BIN=@bindir@/valgrind
Brad Bishopd7bf8c12018-02-25 22:55:05 -050011
Brad Bishopa34c0302019-09-23 22:34:48 -040012LOG="${VALGRIND_LIB}/ptest/valgrind_ptest_$(date +%Y%m%d-%H%M%S).log"
13
14TOOLS="memcheck cachegrind callgrind helgrind drd massif dhat lackey none"
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060015EXP_TOOLS="exp-bbv"
Brad Bishopa34c0302019-09-23 22:34:48 -040016
17GDB_BIN=@bindir@/gdb
18cd ${VALGRIND_LIB}/ptest && ./gdbserver_tests/make_local_links ${GDB_BIN}
19
Andrew Geisslerd1e89492021-02-12 15:35:20 -060020echo "Hide valgrind tests that are non-deterministic"
21echo "Reported at https://bugs.kde.org/show_bug.cgi?id=430321"
22for i in `cat remove-for-all`; do
23 mv $i.vgtest $i.IGNORE;
24done
25
Brad Bishopa34c0302019-09-23 22:34:48 -040026arch=`arch`
27if [ "$arch" = "aarch64" ]; then
28 echo "Aarch64: Hide valgrind tests that result in defunct process and then out of memory"
29 for i in `cat remove-for-aarch64`; do
30 mv $i.vgtest $i.IGNORE;
31 done
32fi
33
34cd ${VALGRIND_LIB}/ptest && ./tests/vg_regtest \
35 --valgrind=${VALGRIND_BIN} \
36 --valgrind-lib=${VALGRIND_LIB} \
37 --yocto-ptest \
38 gdbserver_tests ${TOOLS} ${EXP_TOOLS} \
39 2>&1|tee ${LOG}
40
41cd ${VALGRIND_LIB}/ptest && \
42 ./tests/post_regtest_checks $(pwd) \
43 gdbserver_tests ${TOOLS} ${EXP_TOOLS} \
44 2>&1|tee -a ${LOG}
45
46if [ "$arch" = "aarch64" ]; then
47 echo "Aarch64: Restore valgrind tests that result in defunct process and then out of memory"
48 for i in `cat remove-for-aarch64`; do
49 mv $i.IGNORE $i.vgtest;
50 done
51fi
52
Andrew Geisslerd1e89492021-02-12 15:35:20 -060053echo "Restore valgrind tests that are non-deterministc"
54for i in `cat remove-for-all`; do
55 mv $i.IGNORE $i.vgtest;
56done
Brad Bishopd7bf8c12018-02-25 22:55:05 -050057
Andrew Geissler3b8a17c2021-04-15 15:55:55 -050058echo "Failed test details..."
59failed_tests=`grep FAIL: ${LOG} | awk '{print $2}'`
60for test in $failed_tests; do
61 for diff_results in `ls $test*.diff`; do
62 echo $diff_results
63 echo '************'
64 cat $diff_results
65 done
66done
67
Brad Bishopd7bf8c12018-02-25 22:55:05 -050068passed=`grep PASS: ${LOG}|wc -l`
69failed=`grep FAIL: ${LOG}|wc -l`
70skipped=`grep SKIP: ${LOG}|wc -l`
71all=$((passed + failed + skipped))
72
73( echo "=== Test Summary ==="
74 echo "TOTAL: ${all}"
75 echo "PASSED: ${passed}"
76 echo "FAILED: ${failed}"
77 echo "SKIPPED: ${skipped}"
78) | tee -a /${LOG}