Bug 797526 - some assertions in nsDOMClassInfo should be fatal in debug builds -...
[gecko.git] / media / webrtc / trunk / tools / valgrind / chrome_tests.sh
blobeaa70e0d82086e3753760c185bfa07069964b814
1 #!/bin/bash
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
7 # Set up some paths and re-direct the arguments to chrome_tests.py
9 export THISDIR=`dirname $0`
10 ARGV_COPY="$@"
12 # We need to set CHROME_VALGRIND iff using Memcheck or TSan-Valgrind:
13 # tools/valgrind/chrome_tests.sh --tool memcheck
14 # or
15 # tools/valgrind/chrome_tests.sh --tool=memcheck
16 # (same for "--tool=tsan")
17 tool="memcheck" # Default to memcheck.
18 while (( "$#" ))
20 if [[ "$1" == "--tool" ]]
21 then
22 tool="$2"
23 shift
24 elif [[ "$1" =~ --tool=(.*) ]]
25 then
26 tool="${BASH_REMATCH[1]}"
28 shift
29 done
31 NEEDS_VALGRIND=0
32 NEEDS_DRMEMORY=0
34 case "$tool" in
35 "memcheck")
36 NEEDS_VALGRIND=1
38 "tsan" | "tsan_rv")
39 NEEDS_VALGRIND=1
41 "drmemory" | "drmemory_light" | "drmemory_full")
42 NEEDS_DRMEMORY=1
44 esac
46 if [ "$NEEDS_VALGRIND" == "1" ]
47 then
48 CHROME_VALGRIND=`sh $THISDIR/locate_valgrind.sh`
49 if [ "$CHROME_VALGRIND" = "" ]
50 then
51 # locate_valgrind.sh failed
52 exit 1
54 echo "Using valgrind binaries from ${CHROME_VALGRIND}"
56 PATH="${CHROME_VALGRIND}/bin:$PATH"
57 # We need to set these variables to override default lib paths hard-coded into
58 # Valgrind binary.
59 export VALGRIND_LIB="$CHROME_VALGRIND/lib/valgrind"
60 export VALGRIND_LIB_INNER="$CHROME_VALGRIND/lib/valgrind"
63 if [ "$NEEDS_DRMEMORY" == "1" ]
64 then
65 if [ -z "$DRMEMORY_COMMAND" ]
66 then
67 DRMEMORY_PATH="$THISDIR/../../third_party/drmemory"
68 DRMEMORY_SFX="$DRMEMORY_PATH/drmemory-windows-sfx.exe"
69 if [ ! -f "$DRMEMORY_SFX" ]
70 then
71 echo "Can't find Dr. Memory executables."
72 echo "See http://www.chromium.org/developers/how-tos/using-valgrind/dr-memory"
73 echo "for the instructions on how to get them."
74 exit 1
77 chmod +x "$DRMEMORY_SFX" # Cygwin won't run it without +x.
78 "$DRMEMORY_SFX" -o"$DRMEMORY_PATH/unpacked" -y
79 export DRMEMORY_COMMAND="$DRMEMORY_PATH/unpacked/bin/drmemory.exe"
83 PYTHONPATH=$THISDIR/../python/google python \
84 "$THISDIR/chrome_tests.py" $ARGV_COPY