xref: /freebsd/contrib/googletest/ci/windows-presubmit.bat (revision 02e9120893770924227138ba49df1edb3896112a)
1SETLOCAL ENABLEDELAYEDEXPANSION
2
3SET BAZEL_EXE=%KOKORO_GFILE_DIR%\bazel-5.1.1-windows-x86_64.exe
4
5SET PATH=C:\Python34;%PATH%
6SET BAZEL_PYTHON=C:\python34\python.exe
7SET BAZEL_SH=C:\tools\msys64\usr\bin\bash.exe
8SET CMAKE_BIN="cmake.exe"
9SET CTEST_BIN="ctest.exe"
10SET CTEST_OUTPUT_ON_FAILURE=1
11SET CMAKE_BUILD_PARALLEL_LEVEL=16
12SET CTEST_PARALLEL_LEVEL=16
13
14IF EXIST git\googletest (
15  CD git\googletest
16) ELSE IF EXIST github\googletest (
17  CD github\googletest
18)
19
20IF %errorlevel% neq 0 EXIT /B 1
21
22:: ----------------------------------------------------------------------------
23:: CMake
24MKDIR cmake_msvc2022
25CD cmake_msvc2022
26
27%CMAKE_BIN% .. ^
28  -G "Visual Studio 17 2022" ^
29  -DPYTHON_EXECUTABLE:FILEPATH=c:\python37\python.exe ^
30  -DPYTHON_INCLUDE_DIR:PATH=c:\python37\include ^
31  -DPYTHON_LIBRARY:FILEPATH=c:\python37\lib\site-packages\pip ^
32  -Dgtest_build_samples=ON ^
33  -Dgtest_build_tests=ON ^
34  -Dgmock_build_tests=ON
35IF %errorlevel% neq 0 EXIT /B 1
36
37%CMAKE_BIN% --build . --target ALL_BUILD --config Debug -- -maxcpucount
38IF %errorlevel% neq 0 EXIT /B 1
39
40%CTEST_BIN% -C Debug --timeout 600
41IF %errorlevel% neq 0 EXIT /B 1
42
43CD ..
44RMDIR /S /Q cmake_msvc2022
45
46:: ----------------------------------------------------------------------------
47:: Bazel
48
49SET BAZEL_VS=C:\Program Files\Microsoft Visual Studio\2022\Community
50%BAZEL_EXE% test ... ^
51  --compilation_mode=dbg ^
52  --copt=/std:c++14 ^
53  --copt=/WX ^
54  --features=external_include_paths ^
55  --keep_going ^
56  --test_output=errors ^
57  --test_tag_filters=-no_test_msvc2017
58IF %errorlevel% neq 0 EXIT /B 1
59