Debian Codegraph @

src/external/googletest/ci/windows-presubmit.bat

raw
1 SETLOCAL ENABLEDELAYEDEXPANSION
2
3 SET BAZEL_EXE=%KOKORO_GFILE_DIR%\bazel-8.0.0-windows-x86_64.exe
4
5 SET PATH=C:\Python34;%PATH%
6 SET BAZEL_PYTHON=C:\python34\python.exe
7 SET BAZEL_SH=C:\tools\msys64\usr\bin\bash.exe
8 SET CMAKE_BIN="cmake.exe"
9 SET CTEST_BIN="ctest.exe"
10 SET CTEST_OUTPUT_ON_FAILURE=1
11 SET CMAKE_BUILD_PARALLEL_LEVEL=16
12 SET CTEST_PARALLEL_LEVEL=16
13
14 SET GTEST_ROOT=%~dp0\..
15 IF %errorlevel% neq 0 EXIT /B 1
16
17 :: ----------------------------------------------------------------------------
18 :: CMake
19 SET CMAKE_BUILD_PATH=cmake_msvc2022
20 MKDIR %CMAKE_BUILD_PATH%
21 CD %CMAKE_BUILD_PATH%
22
23 %CMAKE_BIN% %GTEST_ROOT% ^
24 -G "Visual Studio 17 2022" ^
25 -DCMAKE_CXX_STANDARD=17 ^
26 -DPYTHON_EXECUTABLE:FILEPATH=c:\python37\python.exe ^
27 -DPYTHON_INCLUDE_DIR:PATH=c:\python37\include ^
28 -DPYTHON_LIBRARY:FILEPATH=c:\python37\lib\site-packages\pip ^
29 -Dgtest_build_samples=ON ^
30 -Dgtest_build_tests=ON ^
31 -Dgmock_build_tests=ON
32 IF %errorlevel% neq 0 EXIT /B 1
33
34 %CMAKE_BIN% --build . --target ALL_BUILD --config Debug -- -maxcpucount
35 IF %errorlevel% neq 0 EXIT /B 1
36
37 %CTEST_BIN% -C Debug --timeout 600
38 IF %errorlevel% neq 0 EXIT /B 1
39
40 CD %GTEST_ROOT%
41 RMDIR /S /Q %CMAKE_BUILD_PATH%
42
43 :: ----------------------------------------------------------------------------
44 :: Bazel
45
46 :: The default home directory on Kokoro is a long path which causes errors
47 :: because of Windows limitations on path length.
48 :: --output_user_root=C:\tmp causes Bazel to use a shorter path.
49 SET BAZEL_VS=C:\Program Files\Microsoft Visual Studio\2022\Community
50
51 :: C++17
52 %BAZEL_EXE% ^
53 --output_user_root=C:\tmp ^
54 test ... ^
55 --compilation_mode=dbg ^
56 --copt=/std:c++17 ^
57 --copt=/WX ^
58 --enable_bzlmod=true ^
59 --keep_going ^
60 --test_output=errors ^
61 --test_tag_filters=-no_test_msvc2017
62 IF %errorlevel% neq 0 EXIT /B 1
63
64 :: C++20
65 %BAZEL_EXE% ^
66 --output_user_root=C:\tmp ^
67 test ... ^
68 --compilation_mode=dbg ^
69 --copt=/std:c++20 ^
70 --copt=/WX ^
71 --enable_bzlmod=true ^
72 --keep_going ^
73 --test_output=errors ^
74 --test_tag_filters=-no_test_msvc2017
75 IF %errorlevel% neq 0 EXIT /B 1