kjellander@webrtc.org | d1e7a9a | 2012-09-28 15:34:18 +0000 | [diff] [blame] | 1 | @echo off
|
| 2 | :: Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
| 3 | ::
|
| 4 | :: Use of this source code is governed by a BSD-style license
|
| 5 | :: that can be found in the LICENSE file in the root of the source
|
| 6 | :: tree. An additional intellectual property rights grant can be found
|
| 7 | :: in the file PATENTS. All contributing project authors may
|
| 8 | :: be found in the AUTHORS file in the root of the source tree.
|
| 9 |
|
| 10 | :: This script is a copy of chrome_tests.bat with the following changes:
|
| 11 | :: - Invokes webrtc_tests.py instead of chrome_tests.py
|
| 12 | :: - Chromium's Valgrind scripts directory is added to the PYTHONPATH to make
|
| 13 | :: it possible to execute the Python scripts properly.
|
| 14 |
|
| 15 | :: TODO(timurrrr): batch files 'export' all the variables to the parent shell
|
| 16 | set THISDIR=%~dp0
|
| 17 | set TOOL_NAME="unknown"
|
| 18 |
|
| 19 | :: Get the tool name and put it into TOOL_NAME {{{1
|
| 20 | :: NB: SHIFT command doesn't modify %*
|
| 21 | :PARSE_ARGS_LOOP
|
| 22 | if %1 == () GOTO:TOOLNAME_NOT_FOUND
|
| 23 | if %1 == --tool GOTO:TOOLNAME_FOUND
|
| 24 | SHIFT
|
| 25 | goto :PARSE_ARGS_LOOP
|
| 26 |
|
| 27 | :TOOLNAME_NOT_FOUND
|
kjellander@webrtc.org | afede83 | 2014-10-10 09:18:34 +0000 | [diff] [blame] | 28 | echo "Please specify a tool (drmemory, drmemory_light or drmemory_full)"
|
| 29 | echo "by using --tool flag"
|
kjellander@webrtc.org | d1e7a9a | 2012-09-28 15:34:18 +0000 | [diff] [blame] | 30 | exit /B 1
|
| 31 |
|
| 32 | :TOOLNAME_FOUND
|
| 33 | SHIFT
|
| 34 | set TOOL_NAME=%1
|
| 35 | :: }}}
|
| 36 | if "%TOOL_NAME%" == "drmemory" GOTO :SETUP_DRMEMORY
|
| 37 | if "%TOOL_NAME%" == "drmemory_light" GOTO :SETUP_DRMEMORY
|
| 38 | if "%TOOL_NAME%" == "drmemory_full" GOTO :SETUP_DRMEMORY
|
| 39 | if "%TOOL_NAME%" == "drmemory_pattern" GOTO :SETUP_DRMEMORY
|
kjellander@webrtc.org | afede83 | 2014-10-10 09:18:34 +0000 | [diff] [blame] | 40 | echo "Unknown tool: `%TOOL_NAME%`! Only drmemory* tools are supported."
|
kjellander@webrtc.org | d1e7a9a | 2012-09-28 15:34:18 +0000 | [diff] [blame] | 41 | exit /B 1
|
| 42 |
|
| 43 | :SETUP_DRMEMORY
|
| 44 | if NOT "%DRMEMORY_COMMAND%"=="" GOTO :RUN_TESTS
|
| 45 | :: Set up DRMEMORY_COMMAND to invoke Dr. Memory {{{1
|
| 46 | set DRMEMORY_PATH=%THISDIR%..\..\third_party\drmemory
|
| 47 | set DRMEMORY_SFX=%DRMEMORY_PATH%\drmemory-windows-sfx.exe
|
| 48 | if EXIST %DRMEMORY_SFX% GOTO DRMEMORY_BINARY_OK
|
| 49 | echo "Can't find Dr. Memory executables."
|
| 50 | echo "See http://www.chromium.org/developers/how-tos/using-valgrind/dr-memory"
|
| 51 | echo "for the instructions on how to get them."
|
| 52 | exit /B 1
|
| 53 |
|
| 54 | :DRMEMORY_BINARY_OK
|
| 55 | %DRMEMORY_SFX% -o%DRMEMORY_PATH%\unpacked -y
|
| 56 | set DRMEMORY_COMMAND=%DRMEMORY_PATH%\unpacked\bin\drmemory.exe
|
| 57 | :: }}}
|
| 58 | goto :RUN_TESTS
|
| 59 |
|
kjellander@webrtc.org | d1e7a9a | 2012-09-28 15:34:18 +0000 | [diff] [blame] | 60 | :RUN_TESTS
|
| 61 | set PYTHONPATH=%THISDIR%..\python\google;%THISDIR%..\valgrind
|
| 62 | set RUNNING_ON_VALGRIND=yes
|
| 63 | python %THISDIR%webrtc_tests.py %*
|