Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | # run-ptest - 'ptest' test infrastructure shell script that |
| 4 | # wraps the valgrind regression script vg_regtest. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 5 | # |
| 6 | # Dave Lerner <dave.lerner@windriver.com> |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 7 | # Randy MacLeod <Randy.MacLeod@windriver.com> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 8 | ############################################################### |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 9 | VALGRIND_LIB=@libdir@/valgrind |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 10 | VALGRIND_LIBEXECDIR=@libexecdir@/valgrind |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 11 | VALGRIND_BIN=@bindir@/valgrind |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 12 | |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 13 | LOG="${VALGRIND_LIB}/ptest/valgrind_ptest_$(date +%Y%m%d-%H%M%S).log" |
| 14 | |
| 15 | TOOLS="memcheck cachegrind callgrind helgrind drd massif dhat lackey none" |
Andrew Geissler | 9b4d8b0 | 2021-02-19 12:26:16 -0600 | [diff] [blame] | 16 | EXP_TOOLS="exp-bbv" |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 17 | |
| 18 | GDB_BIN=@bindir@/gdb |
| 19 | cd ${VALGRIND_LIB}/ptest && ./gdbserver_tests/make_local_links ${GDB_BIN} |
| 20 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 21 | echo "Hide valgrind tests that are non-deterministic" |
| 22 | echo "Reported at https://bugs.kde.org/show_bug.cgi?id=430321" |
| 23 | for i in `cat remove-for-all`; do |
| 24 | mv $i.vgtest $i.IGNORE; |
| 25 | done |
| 26 | |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 27 | arch=`arch` |
| 28 | if [ "$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 |
| 33 | fi |
| 34 | |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame^] | 35 | echo "Run flaky tests using taskset to limit them to a single core." |
| 36 | for 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 |
| 39 | done |
| 40 | |
| 41 | |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 42 | cd ${VALGRIND_LIB}/ptest && ./tests/vg_regtest \ |
| 43 | --valgrind=${VALGRIND_BIN} \ |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 44 | --valgrind-lib=${VALGRIND_LIBEXECDIR} \ |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 45 | --yocto-ptest \ |
| 46 | gdbserver_tests ${TOOLS} ${EXP_TOOLS} \ |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame^] | 47 | 2>&1|tee -a ${LOG} |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 48 | |
| 49 | cd ${VALGRIND_LIB}/ptest && \ |
| 50 | ./tests/post_regtest_checks $(pwd) \ |
| 51 | gdbserver_tests ${TOOLS} ${EXP_TOOLS} \ |
| 52 | 2>&1|tee -a ${LOG} |
| 53 | |
| 54 | if [ "$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 |
| 59 | fi |
| 60 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 61 | echo "Restore valgrind tests that are non-deterministc" |
| 62 | for i in `cat remove-for-all`; do |
| 63 | mv $i.IGNORE $i.vgtest; |
| 64 | done |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 65 | |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame^] | 66 | echo "Restore flaky and other non-deterministic tests" |
| 67 | for i in `cat taskset_nondeterministic_tests`; do |
| 68 | mv $i.IGNORE $i.vgtest; |
| 69 | done |
| 70 | |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 71 | echo "Failed test details..." |
| 72 | failed_tests=`grep FAIL: ${LOG} | awk '{print $2}'` |
| 73 | for 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 |
| 79 | done |
| 80 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 81 | passed=`grep PASS: ${LOG}|wc -l` |
| 82 | failed=`grep FAIL: ${LOG}|wc -l` |
| 83 | skipped=`grep SKIP: ${LOG}|wc -l` |
| 84 | all=$((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} |