Skip to content

Commit

Permalink
Properly exit appveyor batch scripts on error
Browse files Browse the repository at this point in the history
  • Loading branch information
horenmar committed Sep 9, 2018
1 parent a3876ad commit bcfa9b1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
15 changes: 8 additions & 7 deletions misc/appveyorBuildConfigurationScript.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
SETLOCAL EnableDelayedExpansion

@REM # Possibilities:
@REM # Debug build + coverage
Expand All @@ -7,21 +8,21 @@
if "%CONFIGURATION%"=="Debug" (
if "%coverage%"=="1" (
@REM # coverage needs to build the special helper as well as the main
cmake -Hmisc -Bbuild-misc -A%PLATFORM%
cmake --build build-misc
cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain% -DMEMORYCHECK_COMMAND=build-misc\Debug\CoverageHelper.exe -DMEMORYCHECK_COMMAND_OPTIONS=--sep-- -DMEMORYCHECK_TYPE=Valgrind
cmake -Hmisc -Bbuild-misc -A%PLATFORM% || exit /b !ERRORLEVEL!
cmake --build build-misc || exit /b !ERRORLEVEL!
cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain% -DMEMORYCHECK_COMMAND=build-misc\Debug\CoverageHelper.exe -DMEMORYCHECK_COMMAND_OPTIONS=--sep-- -DMEMORYCHECK_TYPE=Valgrind || exit /b !ERRORLEVEL! || exit /b !ERRORLEVEL!
) else (
@REM # We know that coverage is 0
if "%examples%"=="1" (
@REM # Examples live off the single header, so it needs to be regenerated
python scripts\generateSingleHeader.py
cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain% -DCATCH_BUILD_EXAMPLES=ON -DCATCH_BUILD_EXTRA_TESTS=ON
python scripts\generateSingleHeader.py || exit /b !ERRORLEVEL!
cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain% -DCATCH_BUILD_EXAMPLES=ON -DCATCH_BUILD_EXTRA_TESTS=ON || exit /b !ERRORLEVEL!
) else (
@REM # This is just a plain debug build
cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain%
cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain% || exit /b !ERRORLEVEL!
)
)
)
if "%CONFIGURATION%"=="Release" (
cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain%
cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain% || exit /b !ERRORLEVEL!
)
12 changes: 7 additions & 5 deletions misc/appveyorTestRunScript.bat
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
SETLOCAL EnableDelayedExpansion

cd Build
if "%CONFIGURATION%"=="Debug" (
if "%coverage%"=="1" (
ctest -j 2 -C %CONFIGURATION% -D ExperimentalMemCheck
python ..\misc\appveyorMergeCoverageScript.py
codecov --root .. --no-color --disable gcov -f cobertura.xml -t %CODECOV_TOKEN%
ctest -j 2 -C %CONFIGURATION% -D ExperimentalMemCheck || exit /b !ERRORLEVEL!
python ..\misc\appveyorMergeCoverageScript.py || exit /b !ERRORLEVEL!
codecov --root .. --no-color --disable gcov -f cobertura.xml -t %CODECOV_TOKEN% || exit /b !ERRORLEVEL!
) else (
ctest -j 2 -C %CONFIGURATION%
ctest -j 2 -C %CONFIGURATION% || exit /b !ERRORLEVEL!
)
)
if "%CONFIGURATION%"=="Release" (
ctest -j 2 -C %CONFIGURATION%
ctest -j 2 -C %CONFIGURATION% || exit /b !ERRORLEVEL!
)

0 comments on commit bcfa9b1

Please sign in to comment.