Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/kokoro
diff options
context:
space:
mode:
authorEhsan <ehsann@google.com>2019-01-07 18:00:49 +0300
committerdan sinclair <dj2@everburning.com>2019-01-07 18:00:49 +0300
commit2f004baa99d5faca5087b4cafa3665a74ea3f209 (patch)
tree9f5a73547c7d0a8910fc410d814eaff8e61ea69c /kokoro
parenta87d3ce48e88a653e855c3245a6b68deeae58efc (diff)
[kokoro] Fix usage of ERRORLEVEL in Windows script. (#2262)
Diffstat (limited to 'kokoro')
-rw-r--r--kokoro/scripts/windows/build.bat25
1 files changed, 15 insertions, 10 deletions
diff --git a/kokoro/scripts/windows/build.bat b/kokoro/scripts/windows/build.bat
index a2472fb4f..1985419f0 100644
--- a/kokoro/scripts/windows/build.bat
+++ b/kokoro/scripts/windows/build.bat
@@ -58,33 +58,38 @@ if "%KOKORO_GITHUB_COMMIT%." == "." (
set BUILD_SHA=%KOKORO_GITHUB_COMMIT%
)
+set CMAKE_FLAGS=-GNinja -DSPIRV_BUILD_COMPRESSION=ON -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_INSTALL_PREFIX=install -DRE2_BUILD_TESTING=OFF -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe
+
:: Skip building tests for VS2013
if %VS_VERSION% == 2013 (
- cmake -GNinja -DSPIRV_SKIP_TESTS=ON -DSPIRV_BUILD_COMPRESSION=ON -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_INSTALL_PREFIX=install -DRE2_BUILD_TESTING=OFF -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe ..
-) else (
- cmake -GNinja -DSPIRV_BUILD_COMPRESSION=ON -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_INSTALL_PREFIX=install -DRE2_BUILD_TESTING=OFF -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe ..
+ set CMAKE_FLAGS=%CMAKE_FLAGS% -DSPIRV_SKIP_TESTS=ON
)
-if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
+cmake %CMAKE_FLAGS% ..
+
+if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
echo "Build everything... %DATE% %TIME%"
ninja
-if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
+if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
echo "Build Completed %DATE% %TIME%"
+:: This lets us use !ERRORLEVEL! inside an IF ... () and get the actual error at that point.
+setlocal ENABLEDELAYEDEXPANSION
+
:: ################################################
:: Run the tests (We no longer run tests on VS2013)
:: ################################################
-if NOT %VS_VERSION% == 2013 (
- echo "Running Tests... %DATE% %TIME%"
+echo "Running Tests... %DATE% %TIME%"
+if %VS_VERSION% NEQ 2013 (
ctest -C %BUILD_TYPE% --output-on-failure --timeout 300
- if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
- echo "Tests Completed %DATE% %TIME%"
+ if !ERRORLEVEL! NEQ 0 exit /b !ERRORLEVEL!
)
+echo "Tests Completed %DATE% %TIME%"
:: Clean up some directories.
rm -rf %SRC%\build
rm -rf %SRC%\external
-exit /b %ERRORLEVEL%
+exit /b 0