2
0

libyuv_tests.bat 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. @echo off
  2. :: Copyright (c) 2012 The LibYuv 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. :: This script is a copy of chrome_tests.bat with the following changes:
  10. :: - Invokes libyuv_tests.py instead of chrome_tests.py
  11. :: - Chromium's Valgrind scripts directory is added to the PYTHONPATH to make
  12. :: it possible to execute the Python scripts properly.
  13. :: TODO(timurrrr): batch files 'export' all the variables to the parent shell
  14. set THISDIR=%~dp0
  15. set TOOL_NAME="unknown"
  16. :: Get the tool name and put it into TOOL_NAME {{{1
  17. :: NB: SHIFT command doesn't modify %*
  18. :PARSE_ARGS_LOOP
  19. if %1 == () GOTO:TOOLNAME_NOT_FOUND
  20. if %1 == --tool GOTO:TOOLNAME_FOUND
  21. SHIFT
  22. goto :PARSE_ARGS_LOOP
  23. :TOOLNAME_NOT_FOUND
  24. echo "Please specify a tool (tsan or drmemory) by using --tool flag"
  25. exit /B 1
  26. :TOOLNAME_FOUND
  27. SHIFT
  28. set TOOL_NAME=%1
  29. :: }}}
  30. if "%TOOL_NAME%" == "drmemory" GOTO :SETUP_DRMEMORY
  31. if "%TOOL_NAME%" == "drmemory_light" GOTO :SETUP_DRMEMORY
  32. if "%TOOL_NAME%" == "drmemory_full" GOTO :SETUP_DRMEMORY
  33. if "%TOOL_NAME%" == "drmemory_pattern" GOTO :SETUP_DRMEMORY
  34. if "%TOOL_NAME%" == "tsan" GOTO :SETUP_TSAN
  35. echo "Unknown tool: `%TOOL_NAME%`! Only tsan and drmemory are supported."
  36. exit /B 1
  37. :SETUP_DRMEMORY
  38. if NOT "%DRMEMORY_COMMAND%"=="" GOTO :RUN_TESTS
  39. :: Set up DRMEMORY_COMMAND to invoke Dr. Memory {{{1
  40. set DRMEMORY_PATH=%THISDIR%..\..\third_party\drmemory
  41. set DRMEMORY_SFX=%DRMEMORY_PATH%\drmemory-windows-sfx.exe
  42. if EXIST %DRMEMORY_SFX% GOTO DRMEMORY_BINARY_OK
  43. echo "Can't find Dr. Memory executables."
  44. echo "See http://www.chromium.org/developers/how-tos/using-valgrind/dr-memory"
  45. echo "for the instructions on how to get them."
  46. exit /B 1
  47. :DRMEMORY_BINARY_OK
  48. %DRMEMORY_SFX% -o%DRMEMORY_PATH%\unpacked -y
  49. set DRMEMORY_COMMAND=%DRMEMORY_PATH%\unpacked\bin\drmemory.exe
  50. :: }}}
  51. goto :RUN_TESTS
  52. :SETUP_TSAN
  53. :: Set up PIN_COMMAND to invoke TSan {{{1
  54. set TSAN_PATH=%THISDIR%..\..\third_party\tsan
  55. set TSAN_SFX=%TSAN_PATH%\tsan-x86-windows-sfx.exe
  56. if EXIST %TSAN_SFX% GOTO TSAN_BINARY_OK
  57. echo "Can't find ThreadSanitizer executables."
  58. echo "See http://www.chromium.org/developers/how-tos/using-valgrind/threadsanitizer/threadsanitizer-on-windows"
  59. echo "for the instructions on how to get them."
  60. exit /B 1
  61. :TSAN_BINARY_OK
  62. %TSAN_SFX% -o%TSAN_PATH%\unpacked -y
  63. set PIN_COMMAND=%TSAN_PATH%\unpacked\tsan-x86-windows\tsan.bat
  64. :: }}}
  65. goto :RUN_TESTS
  66. :RUN_TESTS
  67. set PYTHONPATH=%THISDIR%..\python\google;%THISDIR%..\valgrind
  68. set RUNNING_ON_VALGRIND=yes
  69. python %THISDIR%libyuv_tests.py %*