windows-presubmit.bat 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. SETLOCAL ENABLEDELAYEDEXPANSION
  2. SET BAZEL_EXE=%KOKORO_GFILE_DIR%\bazel-5.1.1-windows-x86_64.exe
  3. SET PATH=C:\Python37;%PATH%
  4. SET BAZEL_PYTHON=C:\python37\python.exe
  5. SET BAZEL_SH=C:\tools\msys64\usr\bin\bash.exe
  6. SET CMAKE_BIN="C:\Program Files\CMake\bin\cmake.exe"
  7. SET CTEST_BIN="C:\Program Files\CMake\bin\ctest.exe"
  8. SET CTEST_OUTPUT_ON_FAILURE=1
  9. IF EXIST git\googletest (
  10. CD git\googletest
  11. ) ELSE IF EXIST github\googletest (
  12. CD github\googletest
  13. )
  14. IF %errorlevel% neq 0 EXIT /B 1
  15. :: ----------------------------------------------------------------------------
  16. :: CMake Visual Studio 15 2017 Win64
  17. MKDIR cmake_msvc2017
  18. CD cmake_msvc2017
  19. %CMAKE_BIN% .. ^
  20. -G "Visual Studio 15 2017 Win64" ^
  21. -DPYTHON_EXECUTABLE:FILEPATH=c:\python37\python.exe ^
  22. -DPYTHON_INCLUDE_DIR:PATH=c:\python37\include ^
  23. -DPYTHON_LIBRARY:FILEPATH=c:\python37\lib\site-packages\pip ^
  24. -Dgtest_build_samples=ON ^
  25. -Dgtest_build_tests=ON ^
  26. -Dgmock_build_tests=ON
  27. IF %errorlevel% neq 0 EXIT /B 1
  28. %CMAKE_BIN% --build . --target ALL_BUILD --config Debug -- -maxcpucount
  29. IF %errorlevel% neq 0 EXIT /B 1
  30. %CTEST_BIN% -C Debug --timeout 600
  31. IF %errorlevel% neq 0 EXIT /B 1
  32. CD ..
  33. RMDIR /S /Q cmake_msvc2017
  34. :: ----------------------------------------------------------------------------
  35. :: Bazel Visual Studio 15 2017 Win64
  36. SET BAZEL_VC=C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC
  37. %BAZEL_EXE% test ... ^
  38. --compilation_mode=dbg ^
  39. --copt=/std:c++14 ^
  40. --copt=/WX ^
  41. --features=external_include_paths ^
  42. --keep_going ^
  43. --test_output=errors ^
  44. --test_tag_filters=-no_test_msvc2017
  45. IF %errorlevel% neq 0 EXIT /B 1