root/test/stress-valgrind.sh

Revision 03be3fd1811b0b0f9348760cae484adacfc69998, 0.8 kB (checked in by Hans Petter Jansson <hpj@gong.(none)>, 2 years ago)

Allow commenting out tests from tests.list using '#'.

  • Property mode set to 100755
Line 
1 #!/bin/bash
2
3 # Runs battery of tests forever, with debug output. If
4 # a test fails, the log is enumerated and saved, and a
5 # diagnostic is printed to stdout.
6 #
7 # This variant runs tests under valgrind.
8
9 export MALLOC_CHECK_=2
10 export MALLOC_PERTURB_=a
11
12 let n=0
13 let m=0
14
15 # Make sure binaries are created in .libs
16
17 echo -n "Preparing... "
18
19 for i in $(grep "^[ \t]*[^#]" tests.list); do
20   ./$i >/dev/null 2>&1;
21 done
22
23 echo "done"
24
25 while true; do
26   echo -n -e "\rIterations: $m"
27
28   for i in $(grep "^[ \t]*[^#]" tests.list); do
29     nice -10 valgrind -q --trace-children=yes --track-fds=yes --time-stamp=yes --num-callers=32 .libs/lt-$i -n >out 2>&1
30
31     if grep -L 'Thread' out >/dev/null 2>&1; then
32       echo -e '\nFailure: ' $i
33       mv out stress-valgrind-failure-$n.log
34       let n=$n+1
35     fi
36   done
37
38   let m=$m+1
39
40   sleep 1
41 done 2>&1
Note: See TracBrowser for help on using the browser.