xref: /freebsd/contrib/googletest/ci/windows-presubmit.bat (revision b1879975794772ee51f0b4865753364c7d7626c3)
1SETLOCAL ENABLEDELAYEDEXPANSION
2
3SET BAZEL_EXE=%KOKORO_GFILE_DIR%\bazel-7.0.0-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
49:: The default home directory on Kokoro is a long path which causes errors
50:: because of Windows limitations on path length.
51:: --output_user_root=C:\tmp causes Bazel to use a shorter path.
52SET BAZEL_VS=C:\Program Files\Microsoft Visual Studio\2022\Community
53%BAZEL_EXE% ^
54  --output_user_root=C:\tmp ^
55  test ... ^
56  --compilation_mode=dbg ^
57  --copt=/std:c++14 ^
58  --copt=/WX ^
59  --enable_bzlmod=true ^
60  --keep_going ^
61  --test_output=errors ^
62  --test_tag_filters=-no_test_msvc2017
63IF %errorlevel% neq 0 EXIT /B 1
64