128f6c2f2SEnji CooperSETLOCAL ENABLEDELAYEDEXPANSION 228f6c2f2SEnji Cooper 3*5ca8c28cSEnji CooperSET BAZEL_EXE=%KOKORO_GFILE_DIR%\bazel-7.0.0-windows-x86_64.exe 428f6c2f2SEnji Cooper 528f6c2f2SEnji CooperSET PATH=C:\Python34;%PATH% 628f6c2f2SEnji CooperSET BAZEL_PYTHON=C:\python34\python.exe 728f6c2f2SEnji CooperSET BAZEL_SH=C:\tools\msys64\usr\bin\bash.exe 828f6c2f2SEnji CooperSET CMAKE_BIN="cmake.exe" 928f6c2f2SEnji CooperSET CTEST_BIN="ctest.exe" 1028f6c2f2SEnji CooperSET CTEST_OUTPUT_ON_FAILURE=1 1128f6c2f2SEnji CooperSET CMAKE_BUILD_PARALLEL_LEVEL=16 1228f6c2f2SEnji CooperSET CTEST_PARALLEL_LEVEL=16 1328f6c2f2SEnji Cooper 1428f6c2f2SEnji CooperIF EXIST git\googletest ( 1528f6c2f2SEnji Cooper CD git\googletest 1628f6c2f2SEnji Cooper) ELSE IF EXIST github\googletest ( 1728f6c2f2SEnji Cooper CD github\googletest 1828f6c2f2SEnji Cooper) 1928f6c2f2SEnji Cooper 2028f6c2f2SEnji CooperIF %errorlevel% neq 0 EXIT /B 1 2128f6c2f2SEnji Cooper 2228f6c2f2SEnji Cooper:: ---------------------------------------------------------------------------- 2328f6c2f2SEnji Cooper:: CMake 2428f6c2f2SEnji CooperMKDIR cmake_msvc2022 2528f6c2f2SEnji CooperCD cmake_msvc2022 2628f6c2f2SEnji Cooper 2728f6c2f2SEnji Cooper%CMAKE_BIN% .. ^ 2828f6c2f2SEnji Cooper -G "Visual Studio 17 2022" ^ 2928f6c2f2SEnji Cooper -DPYTHON_EXECUTABLE:FILEPATH=c:\python37\python.exe ^ 3028f6c2f2SEnji Cooper -DPYTHON_INCLUDE_DIR:PATH=c:\python37\include ^ 3128f6c2f2SEnji Cooper -DPYTHON_LIBRARY:FILEPATH=c:\python37\lib\site-packages\pip ^ 3228f6c2f2SEnji Cooper -Dgtest_build_samples=ON ^ 3328f6c2f2SEnji Cooper -Dgtest_build_tests=ON ^ 3428f6c2f2SEnji Cooper -Dgmock_build_tests=ON 3528f6c2f2SEnji CooperIF %errorlevel% neq 0 EXIT /B 1 3628f6c2f2SEnji Cooper 3728f6c2f2SEnji Cooper%CMAKE_BIN% --build . --target ALL_BUILD --config Debug -- -maxcpucount 3828f6c2f2SEnji CooperIF %errorlevel% neq 0 EXIT /B 1 3928f6c2f2SEnji Cooper 4028f6c2f2SEnji Cooper%CTEST_BIN% -C Debug --timeout 600 4128f6c2f2SEnji CooperIF %errorlevel% neq 0 EXIT /B 1 4228f6c2f2SEnji Cooper 4328f6c2f2SEnji CooperCD .. 4428f6c2f2SEnji CooperRMDIR /S /Q cmake_msvc2022 4528f6c2f2SEnji Cooper 4628f6c2f2SEnji Cooper:: ---------------------------------------------------------------------------- 4728f6c2f2SEnji Cooper:: Bazel 4828f6c2f2SEnji Cooper 49*5ca8c28cSEnji Cooper:: The default home directory on Kokoro is a long path which causes errors 50*5ca8c28cSEnji Cooper:: because of Windows limitations on path length. 51*5ca8c28cSEnji Cooper:: --output_user_root=C:\tmp causes Bazel to use a shorter path. 5228f6c2f2SEnji CooperSET BAZEL_VS=C:\Program Files\Microsoft Visual Studio\2022\Community 53*5ca8c28cSEnji Cooper%BAZEL_EXE% ^ 54*5ca8c28cSEnji Cooper --output_user_root=C:\tmp ^ 55*5ca8c28cSEnji Cooper test ... ^ 5628f6c2f2SEnji Cooper --compilation_mode=dbg ^ 5728f6c2f2SEnji Cooper --copt=/std:c++14 ^ 5828f6c2f2SEnji Cooper --copt=/WX ^ 59*5ca8c28cSEnji Cooper --enable_bzlmod=true ^ 6028f6c2f2SEnji Cooper --keep_going ^ 6128f6c2f2SEnji Cooper --test_output=errors ^ 6228f6c2f2SEnji Cooper --test_tag_filters=-no_test_msvc2017 6328f6c2f2SEnji CooperIF %errorlevel% neq 0 EXIT /B 1 64