OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 | 2 |
3 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # Script to run layout tests under valgrind | 7 # Script to run layout tests under valgrind |
8 # Example: | 8 # Example: |
9 # sh $0 LayoutTests/fast | 9 # sh $0 LayoutTests/fast |
10 # Caveats: | 10 # Caveats: |
11 # More of an example than a universal script. | 11 # More of an example than a universal script. |
12 # Must be run from src directory. | 12 # Must be run from src directory. |
13 # Uses our standard suppressions; edit | 13 # Uses our standard suppressions; edit |
14 # tools/valgrind/memcheck/suppressions.txt | 14 # tools/valgrind/memcheck/suppressions.txt |
15 # to disable any for bugs you're trying to reproduce. | 15 # to disable any for bugs you're trying to reproduce. |
16 | 16 |
| 17 # Copied from valgrind.sh |
| 18 if test x"$CHROME_VALGRIND_BIN" = x |
| 19 then |
| 20 # Figure out which valgrind is installed. Use most recent one. |
| 21 # See build-valgrind-for-chromium.sh and its history for these constants. |
| 22 for SVNREV in 10880-redzone 10880 10771 20090715 |
| 23 do |
| 24 CHROME_VALGRIND_BIN=/usr/local/valgrind-$SVNREV/bin |
| 25 test -x $CHROME_VALGRIND_BIN/valgrind && break |
| 26 done |
| 27 fi |
| 28 |
| 29 if ! test -x $CHROME_VALGRIND_BIN/valgrind |
| 30 then |
| 31 echo "Could not find chromium's version of valgrind." |
| 32 echo "Please run build-valgrind-for-chromium.sh or set CHROME_VALGRIND_BIN." |
| 33 echo "Defaulting to system valgrind." |
| 34 else |
| 35 echo "Using ${CHROME_VALGRIND_BIN}/valgrind." |
| 36 PATH="${CHROME_VALGRIND_BIN}:$PATH" |
| 37 fi |
| 38 |
17 cat > vlayout-wrapper.sh <<"_EOF_" | 39 cat > vlayout-wrapper.sh <<"_EOF_" |
18 #!/bin/sh | 40 #!/bin/sh |
19 valgrind --suppressions=tools/valgrind/memcheck/suppressions.txt --tool=memcheck
--smc-check=all --num-callers=30 --trace-children=yes --leak-check=full --log-f
ile=vlayout-%p.log --gen-suppressions=all --track-origins=yes "$@" | 41 valgrind --suppressions=tools/valgrind/memcheck/suppressions.txt --tool=memcheck
--smc-check=all --num-callers=30 --trace-children=yes --leak-check=full --show-
possible=no --log-file=vlayout-%p.log --gen-suppressions=all --track-origins=yes
"$@" |
20 _EOF_ | 42 _EOF_ |
21 chmod +x vlayout-wrapper.sh | 43 chmod +x vlayout-wrapper.sh |
22 | 44 |
23 rm -f vlayout-*.log | 45 rm -f vlayout-*.log |
24 export BROWSER_WRAPPER=`pwd`/vlayout-wrapper.sh | 46 export BROWSER_WRAPPER=`pwd`/vlayout-wrapper.sh |
25 export G_SLICE=always-malloc | 47 export G_SLICE=always-malloc |
26 export NSS_DISABLE_ARENA_FREE_LIST=1 | 48 export NSS_DISABLE_ARENA_FREE_LIST=1 |
27 sh webkit/tools/layout_tests/run_webkit_tests.sh --run-singly -v --noshow-result
s --time-out-ms=200000 --nocheck-sys-deps --debug "$@" | 49 sh webkit/tools/layout_tests/run_webkit_tests.sh --run-singly -v --noshow-result
s --time-out-ms=200000 --nocheck-sys-deps --debug "$@" |
28 | 50 |
29 # Have to wait a bit for the output files to finish | 51 # Have to wait a bit for the output files to finish |
30 nfiles=`ls vlayout-*.log | wc -l` | 52 nfiles=`ls vlayout-*.log | wc -l` |
31 while true | 53 while true |
32 do | 54 do |
33 ndone=`grep -l "LEAK SUMMARY" vlayout-*.log | wc -l` | 55 ndone=`egrep -l "LEAK SUMMARY|no leaks are possible" vlayout-*.log | wc -l` |
34 if test $nfiles = $ndone | 56 if test $nfiles = $ndone |
35 then | 57 then |
36 break | 58 break |
37 fi | 59 fi |
38 echo "Waiting for valgrind to finish..." | 60 echo "Waiting for valgrind to finish..." |
39 sleep 1 | 61 sleep 1 |
40 done | 62 done |
41 cat vlayout-*.log | 63 cat vlayout-*.log |
OLD | NEW |