summaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorDino Radakovic <dinor@google.com>2022-10-17 17:39:12 (GMT)
committerCopybara-Service <copybara-worker@google.com>2022-10-17 17:39:48 (GMT)
commit88c59752c05d74475c3d487b28c5e82ad0b129b8 (patch)
treec046da096a6d09e9a3df0a2ce368d06e51a2b031 /ci
parenta9b2f0495cabb1ff01b51bcd0625cb1fd82da4ce (diff)
downloadgoogletest-88c59752c05d74475c3d487b28c5e82ad0b129b8.zip
googletest-88c59752c05d74475c3d487b28c5e82ad0b129b8.tar.gz
googletest-88c59752c05d74475c3d487b28c5e82ad0b129b8.tar.bz2
Add Windows CI script
PiperOrigin-RevId: 481680362 Change-Id: I87b2b71427a8ad2603f5445d6ef794c3fa84746e
Diffstat (limited to 'ci')
-rw-r--r--ci/windows-presubmit.bat56
1 files changed, 56 insertions, 0 deletions
diff --git a/ci/windows-presubmit.bat b/ci/windows-presubmit.bat
new file mode 100644
index 0000000..8668ff3
--- /dev/null
+++ b/ci/windows-presubmit.bat
@@ -0,0 +1,56 @@
+SETLOCAL ENABLEDELAYEDEXPANSION
+
+SET BAZEL_EXE=%KOKORO_GFILE_DIR%\bazel-5.1.1-windows-x86_64.exe
+
+SET PATH=C:\Python37;%PATH%
+SET BAZEL_PYTHON=C:\python37\python.exe
+SET BAZEL_SH=C:\tools\msys64\usr\bin\bash.exe
+SET CMAKE_BIN="C:\Program Files\CMake\bin\cmake.exe"
+SET CTEST_BIN="C:\Program Files\CMake\bin\ctest.exe"
+SET CTEST_OUTPUT_ON_FAILURE=1
+
+IF EXIST git\googletest (
+ CD git\googletest
+) ELSE IF EXIST github\googletest (
+ CD github\googletest
+)
+
+IF %errorlevel% neq 0 EXIT /B 1
+
+:: ----------------------------------------------------------------------------
+:: CMake Visual Studio 15 2017 Win64
+MKDIR cmake_msvc2017
+CD cmake_msvc2017
+
+%CMAKE_BIN% .. ^
+ -G "Visual Studio 15 2017 Win64" ^
+ -DPYTHON_EXECUTABLE:FILEPATH=c:\python37\python.exe ^
+ -DPYTHON_INCLUDE_DIR:PATH=c:\python37\include ^
+ -DPYTHON_LIBRARY:FILEPATH=c:\python37\lib\site-packages\pip ^
+ -Dgtest_build_samples=ON ^
+ -Dgtest_build_tests=ON ^
+ -Dgmock_build_tests=ON
+IF %errorlevel% neq 0 EXIT /B 1
+
+%CMAKE_BIN% --build . --target ALL_BUILD --config Debug -- -maxcpucount
+IF %errorlevel% neq 0 EXIT /B 1
+
+%CTEST_BIN% -C Debug --timeout 600
+IF %errorlevel% neq 0 EXIT /B 1
+
+CD ..
+RMDIR /S /Q cmake_msvc2017
+
+:: ----------------------------------------------------------------------------
+:: Bazel Visual Studio 15 2017 Win64
+
+SET BAZEL_VC=C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC
+%BAZEL_EXE% test ... ^
+ --compilation_mode=dbg ^
+ --copt=/std:c++14 ^
+ --copt=/WX ^
+ --features=external_include_paths ^
+ --keep_going ^
+ --test_output=errors ^
+ --test_tag_filters=-no_test_msvc2017
+IF %errorlevel% neq 0 EXIT /B 1