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%" == "tsan" GOTO :SETUP_TSAN
\r
30 echo "Unknown tool: `%TOOL_NAME%`! Only tsan and drmemory are supported right now"
\r
34 if NOT "%DRMEMORY_COMMAND%"=="" GOTO :RUN_TESTS
\r
35 :: Set up DRMEMORY_COMMAND to invoke Dr. Memory {{{1
\r
36 set DRMEMORY_PATH=%THISDIR%..\..\third_party\drmemory
\r
37 set DRMEMORY_SFX=%DRMEMORY_PATH%\drmemory-windows-sfx.exe
\r
38 if EXIST %DRMEMORY_SFX% GOTO DRMEMORY_BINARY_OK
\r
39 echo "Can't find Dr. Memory executables."
\r
40 echo "See http://www.chromium.org/developers/how-tos/using-valgrind/dr-memory"
\r
41 echo "for the instructions on how to get them."
\r
45 %DRMEMORY_SFX% -o%DRMEMORY_PATH%\unpacked -y
\r
46 set DRMEMORY_COMMAND=%DRMEMORY_PATH%\unpacked\bin\drmemory.exe
\r
51 :: Set up PIN_COMMAND to invoke TSan {{{1
\r
52 set TSAN_PATH=%THISDIR%..\..\third_party\tsan
\r
53 set TSAN_SFX=%TSAN_PATH%\tsan-x86-windows-sfx.exe
\r
54 if EXIST %TSAN_SFX% GOTO TSAN_BINARY_OK
\r
55 echo "Can't find ThreadSanitizer executables."
\r
56 echo "See http://www.chromium.org/developers/how-tos/using-valgrind/threadsanitizer/threadsanitizer-on-windows"
\r
57 echo "for the instructions on how to get them."
\r
61 %TSAN_SFX% -o%TSAN_PATH%\unpacked -y
\r
62 set PIN_COMMAND=%TSAN_PATH%\unpacked\tsan-x86-windows\tsan.bat
\r
67 set PYTHONPATH=%THISDIR%../python/google
\r
68 set RUNNING_ON_VALGRIND=yes
\r
69 python %THISDIR%/chrome_tests.py %*
\r