1@echo off 2@rem Copyright 2024 googletest authors. 3@rem 4@rem Licensed under the Apache License, Version 2.0 (the "License"); 5@rem you may not use this file except in compliance with the License. 6@rem You may obtain a copy of the License at 7@rem 8@rem http://www.apache.org/licenses/LICENSE-2.0 9@rem 10@rem Unless required by applicable law or agreed to in writing, software 11@rem distributed under the License is distributed on an "AS IS" BASIS, 12@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13@rem See the License for the specific language governing permissions and 14@rem limitations under the License. 15 16SETLOCAL ENABLEDELAYEDEXPANSION 17 18SET BAZEL_EXE=%KOKORO_GFILE_DIR%\bazel-5.1.1-windows-x86_64.exe 19 20SET PATH=C:\Python34;%PATH% 21SET BAZEL_PYTHON=C:\python34\python.exe 22SET BAZEL_SH=C:\tools\msys64\usr\bin\bash.exe 23SET CMAKE_BIN="cmake.exe" 24SET CTEST_BIN="ctest.exe" 25SET CTEST_OUTPUT_ON_FAILURE=1 26SET CMAKE_BUILD_PARALLEL_LEVEL=16 27SET CTEST_PARALLEL_LEVEL=16 28 29IF EXIST git\googletest ( 30 CD git\googletest 31) ELSE IF EXIST github\googletest ( 32 CD github\googletest 33) 34 35IF %errorlevel% neq 0 EXIT /B 1 36 37:: ---------------------------------------------------------------------------- 38:: CMake 39MKDIR cmake_msvc2022 40CD cmake_msvc2022 41 42%CMAKE_BIN% .. ^ 43 -G "Visual Studio 17 2022" ^ 44 -DPYTHON_EXECUTABLE:FILEPATH=c:\python37\python.exe ^ 45 -DPYTHON_INCLUDE_DIR:PATH=c:\python37\include ^ 46 -DPYTHON_LIBRARY:FILEPATH=c:\python37\lib\site-packages\pip ^ 47 -Dgtest_build_samples=ON ^ 48 -Dgtest_build_tests=ON ^ 49 -Dgmock_build_tests=ON 50IF %errorlevel% neq 0 EXIT /B 1 51 52%CMAKE_BIN% --build . --target ALL_BUILD --config Debug -- -maxcpucount 53IF %errorlevel% neq 0 EXIT /B 1 54 55%CTEST_BIN% -C Debug --timeout 600 56IF %errorlevel% neq 0 EXIT /B 1 57 58CD .. 59RMDIR /S /Q cmake_msvc2022 60 61:: ---------------------------------------------------------------------------- 62:: Bazel 63 64SET BAZEL_VS=C:\Program Files\Microsoft Visual Studio\2022\Community 65%BAZEL_EXE% test ... ^ 66 --compilation_mode=dbg ^ 67 --copt=/std:c++14 ^ 68 --copt=/WX ^ 69 --features=external_include_paths ^ 70 --keep_going ^ 71 --test_output=errors ^ 72 --test_tag_filters=-no_test_msvc2017 73IF %errorlevel% neq 0 EXIT /B 1 74