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`
12 # We need to set CHROME_VALGRIND iff using Memcheck or TSan-Valgrind:
13 # tools/valgrind/chrome_tests.sh --tool memcheck
15 # tools/valgrind/chrome_tests.sh --tool=memcheck
16 # (same for "--tool=tsan")
17 tool
="memcheck" # Default to memcheck.
20 if [[ "$1" == "--tool" ]]
24 elif [[ "$1" =~
--tool=(.
*) ]]
26 tool
="${BASH_REMATCH[1]}"
41 "drmemory" |
"drmemory_light" |
"drmemory_full")
46 if [ "$NEEDS_VALGRIND" == "1" ]
48 CHROME_VALGRIND
=`sh $THISDIR/locate_valgrind.sh`
49 if [ "$CHROME_VALGRIND" = "" ]
51 # locate_valgrind.sh failed
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
59 export VALGRIND_LIB
="$CHROME_VALGRIND/lib/valgrind"
60 export VALGRIND_LIB_INNER
="$CHROME_VALGRIND/lib/valgrind"
63 if [ "$NEEDS_DRMEMORY" == "1" ]
65 if [ -z "$DRMEMORY_COMMAND" ]
67 DRMEMORY_PATH
="$THISDIR/../../third_party/drmemory"
68 DRMEMORY_SFX
="$DRMEMORY_PATH/drmemory-windows-sfx.exe"
69 if [ ! -f "$DRMEMORY_SFX" ]
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."
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