2 :: Copyright (c) 2011 The Chromium Authors. All rights reserved.
\r
3 :: Use of this source code is governed by a BSD-style license that can be
\r
4 :: found in the LICENSE file.
\r
6 :: TODO(timurrrr): batch files 'export' all the variables to the parent shell
\r
8 set TOOL_NAME="unknown"
\r
10 :: Get the tool name and put it into TOOL_NAME {{{1
\r
11 :: NB: SHIFT command doesn't modify %*
\r
13 if %1 == () GOTO:TOOLNAME_NOT_FOUND
\r
14 if %1 == --tool GOTO:TOOLNAME_FOUND
\r
16 goto :PARSE_ARGS_LOOP
\r
19 echo "Please specify a tool (tsan or drmemory) by using --tool flag"
\r
26 if "%TOOL_NAME%" == "drmemory" GOTO :SETUP_DRMEMORY
\r
27 if "%TOOL_NAME%" == "drmemory_light" GOTO :SETUP_DRMEMORY
\r
28 if "%TOOL_NAME%" == "drmemory_full" GOTO :SETUP_DRMEMORY
\r
29 if "%TOOL_NAME%" == "drmemory_pattern" GOTO :SETUP_DRMEMORY
\r
30 if "%TOOL_NAME%" == "tsan" GOTO :SETUP_TSAN
\r
31 echo "Unknown tool: `%TOOL_NAME%`! Only tsan and drmemory are supported right now"
\r
35 if NOT "%DRMEMORY_COMMAND%"=="" GOTO :RUN_TESTS
\r
36 :: Set up DRMEMORY_COMMAND to invoke Dr. Memory {{{1
\r
37 set DRMEMORY_PATH=%THISDIR%..\..\third_party\drmemory
\r
38 set DRMEMORY_SFX=%DRMEMORY_PATH%\drmemory-windows-sfx.exe
\r
39 if EXIST %DRMEMORY_SFX% GOTO DRMEMORY_BINARY_OK
\r
40 echo "Can't find Dr. Memory executables."
\r
41 echo "See http://www.chromium.org/developers/how-tos/using-valgrind/dr-memory"
\r
42 echo "for the instructions on how to get them."
\r
46 %DRMEMORY_SFX% -o%DRMEMORY_PATH%\unpacked -y
\r
47 set DRMEMORY_COMMAND=%DRMEMORY_PATH%\unpacked\bin\drmemory.exe
\r
52 :: Set up PIN_COMMAND to invoke TSan {{{1
\r
53 set TSAN_PATH=%THISDIR%..\..\third_party\tsan
\r
54 set TSAN_SFX=%TSAN_PATH%\tsan-x86-windows-sfx.exe
\r
55 if EXIST %TSAN_SFX% GOTO TSAN_BINARY_OK
\r
56 echo "Can't find ThreadSanitizer executables."
\r
57 echo "See http://www.chromium.org/developers/how-tos/using-valgrind/threadsanitizer/threadsanitizer-on-windows"
\r
58 echo "for the instructions on how to get them."
\r
62 %TSAN_SFX% -o%TSAN_PATH%\unpacked -y
\r
63 set PIN_COMMAND=%TSAN_PATH%\unpacked\tsan-x86-windows\tsan.bat
\r
68 set PYTHONPATH=%THISDIR%../python/google
\r
69 set RUNNING_ON_VALGRIND=yes
\r
70 python %THISDIR%/chrome_tests.py %*
\r