summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/valgrind/valgrind/run-ptest
blob: e8a1a668fc5b99e89a8baee9cfd0b5f528346932 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/sh

# run-ptest - 'ptest' test infrastructure shell script that
#   wraps the valgrind regression script vg_regtest. 
#
# Dave Lerner <dave.lerner@windriver.com>
# Randy MacLeod <Randy.MacLeod@windriver.com>
###############################################################
VALGRIND_LIB=@libdir@/valgrind
VALGRIND_BIN=@bindir@/valgrind

LOG="${VALGRIND_LIB}/ptest/valgrind_ptest_$(date +%Y%m%d-%H%M%S).log"

TOOLS="memcheck cachegrind callgrind helgrind drd massif dhat lackey none"
EXP_TOOLS="exp-bbv"

GDB_BIN=@bindir@/gdb
cd ${VALGRIND_LIB}/ptest && ./gdbserver_tests/make_local_links ${GDB_BIN}

echo "Hide valgrind tests that are non-deterministic"
echo "Reported at https://bugs.kde.org/show_bug.cgi?id=430321"
for i in `cat remove-for-all`; do
   mv $i.vgtest $i.IGNORE;
done

arch=`arch`
if [ "$arch" = "aarch64" ]; then
   echo "Aarch64: Hide valgrind tests that result in defunct process and then out of memory"
   for i in `cat remove-for-aarch64`; do
      mv $i.vgtest $i.IGNORE;
   done
fi

cd ${VALGRIND_LIB}/ptest && ./tests/vg_regtest \
    --valgrind=${VALGRIND_BIN} \
    --valgrind-lib=${VALGRIND_LIB} \
    --yocto-ptest \
    gdbserver_tests ${TOOLS} ${EXP_TOOLS} \
    2>&1|tee ${LOG}  

cd ${VALGRIND_LIB}/ptest && \
    ./tests/post_regtest_checks $(pwd) \
    gdbserver_tests ${TOOLS} ${EXP_TOOLS} \
    2>&1|tee -a ${LOG}

if [ "$arch" = "aarch64" ]; then
   echo "Aarch64: Restore valgrind tests that result in defunct process and then out of memory"
   for i in `cat remove-for-aarch64`; do
      mv $i.IGNORE $i.vgtest;
   done
fi

echo "Restore valgrind tests that are non-deterministc"
for i in `cat remove-for-all`; do
   mv $i.IGNORE $i.vgtest;
done

passed=`grep PASS: ${LOG}|wc -l`
failed=`grep FAIL: ${LOG}|wc -l`
skipped=`grep SKIP: ${LOG}|wc -l`
all=$((passed + failed + skipped))

( echo "=== Test Summary ==="
  echo "TOTAL: ${all}"
  echo "PASSED: ${passed}"
  echo "FAILED: ${failed}"
  echo "SKIPPED: ${skipped}"
) | tee -a /${LOG}