From a3876adba67b9e2237f8c46c27ecff7a1f246ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Sat, 8 Sep 2018 20:56:31 +0200 Subject: [PATCH 1/3] Fix CTest regex error The desired behaviour was to match a literal "[.]", so the regex has to be escaped as "\\[\\.\\]" -- double backslashes, because it has to be escaped from CMake as well as from the regex engine. --- projects/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/CMakeLists.txt b/projects/CMakeLists.txt index a2ddb23b..57f1f6f8 100644 --- a/projects/CMakeLists.txt +++ b/projects/CMakeLists.txt @@ -320,7 +320,7 @@ set_tests_properties(ListTests PROPERTIES add_test(NAME ListTags COMMAND $ --list-tags) set_tests_properties(ListTags PROPERTIES PASS_REGULAR_EXPRESSION "[0-9]+ tags" - FAIL_REGULAR_EXPRESSION "[.]") + FAIL_REGULAR_EXPRESSION "\\[\\.\\]") add_test(NAME ListReporters COMMAND $ --list-reporters) set_tests_properties(ListReporters PROPERTIES PASS_REGULAR_EXPRESSION "Available reporters:") From bcfa9b177548a35734a6f7283c617dbcc86295a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Sat, 8 Sep 2018 19:36:42 +0200 Subject: [PATCH 2/3] Properly exit appveyor batch scripts on error --- misc/appveyorBuildConfigurationScript.bat | 15 ++++++++------- misc/appveyorTestRunScript.bat | 12 +++++++----- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/misc/appveyorBuildConfigurationScript.bat b/misc/appveyorBuildConfigurationScript.bat index 95757fac..6d3d0b8a 100644 --- a/misc/appveyorBuildConfigurationScript.bat +++ b/misc/appveyorBuildConfigurationScript.bat @@ -1,3 +1,4 @@ +SETLOCAL EnableDelayedExpansion @REM # Possibilities: @REM # Debug build + coverage @@ -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! ) diff --git a/misc/appveyorTestRunScript.bat b/misc/appveyorTestRunScript.bat index 19a364be..c129d99e 100644 --- a/misc/appveyorTestRunScript.bat +++ b/misc/appveyorTestRunScript.bat @@ -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! ) From 1e98c820bbc6712e0e9bec4dc63f9b1cd83dee78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Sat, 8 Sep 2018 20:15:51 +0200 Subject: [PATCH 3/3] Simplify the Appveyor configuration batch script --- examples/CMakeLists.txt | 2 ++ misc/appveyorBuildConfigurationScript.bat | 10 ++-------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 8e07e4cd..aa89ab45 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -8,6 +8,8 @@ cmake_minimum_required( VERSION 3.0 ) project( CatchExamples CXX ) +message( STATUS "Examples included" ) + # define folders used: set( EXAMPLES_DIR ${CATCH_DIR}/examples ) diff --git a/misc/appveyorBuildConfigurationScript.bat b/misc/appveyorBuildConfigurationScript.bat index 6d3d0b8a..f07bb707 100644 --- a/misc/appveyorBuildConfigurationScript.bat +++ b/misc/appveyorBuildConfigurationScript.bat @@ -13,14 +13,8 @@ if "%CONFIGURATION%"=="Debug" ( 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 || 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% || exit /b !ERRORLEVEL! - ) + python scripts\generateSingleHeader.py || exit /b !ERRORLEVEL! + cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain% -DCATCH_BUILD_EXAMPLES=%examples% -DCATCH_BUILD_EXTRA_TESTS=%examples% || exit /b !ERRORLEVEL! ) ) if "%CONFIGURATION%"=="Release" (