mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-22 20:45:39 +02:00
Compare commits
45 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ff349a50bf | ||
![]() |
aca2472d40 | ||
![]() |
765ac08f08 | ||
![]() |
8dd25b0410 | ||
![]() |
69297ceeb6 | ||
![]() |
2d30df3500 | ||
![]() |
77b2a7daea | ||
![]() |
e905edb10f | ||
![]() |
87074da73e | ||
![]() |
e6f5e05ebc | ||
![]() |
44900d5371 | ||
![]() |
7c75ecaef4 | ||
![]() |
fba0feeba1 | ||
![]() |
3e8800beb1 | ||
![]() |
314a05d809 | ||
![]() |
eadf4e32b6 | ||
![]() |
f9620d11be | ||
![]() |
00db4fb497 | ||
![]() |
2fc83e7e9c | ||
![]() |
a2e5ce2418 | ||
![]() |
fd9f5ac661 | ||
![]() |
f0dc4d9be0 | ||
![]() |
284672cc84 | ||
![]() |
2b34b5c7d0 | ||
![]() |
708487d201 | ||
![]() |
6859c683e0 | ||
![]() |
de3a208e16 | ||
![]() |
229cc4823c | ||
![]() |
7f21cc6c55 | ||
![]() |
4c85248179 | ||
![]() |
b4e2237152 | ||
![]() |
40937b67c7 | ||
![]() |
0d5b131394 | ||
![]() |
ad3b90553b | ||
![]() |
b1c45652e5 | ||
![]() |
b79a83e4aa | ||
![]() |
89fe35d515 | ||
![]() |
115d6a1c40 | ||
![]() |
91576352f9 | ||
![]() |
6f7c191513 | ||
![]() |
4eb9d37e05 | ||
![]() |
53d8af8e96 | ||
![]() |
46fde0c597 | ||
![]() |
de103db696 | ||
![]() |
fedc3a7b7b |
@@ -14,14 +14,12 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
project(Catch2 LANGUAGES CXX VERSION 2.12.4)
|
project(Catch2 LANGUAGES CXX VERSION 2.13.3)
|
||||||
|
|
||||||
# Provide path for scripts
|
# Provide path for scripts
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
include(CMakePackageConfigHelpers)
|
|
||||||
include(CTest)
|
|
||||||
|
|
||||||
option(CATCH_USE_VALGRIND "Perform SelfTests with Valgrind" OFF)
|
option(CATCH_USE_VALGRIND "Perform SelfTests with Valgrind" OFF)
|
||||||
option(CATCH_BUILD_TESTING "Build SelfTest project" ON)
|
option(CATCH_BUILD_TESTING "Build SelfTest project" ON)
|
||||||
@@ -33,8 +31,6 @@ option(CATCH_INSTALL_DOCS "Install documentation alongside library" ON)
|
|||||||
option(CATCH_INSTALL_HELPERS "Install contrib alongside library" ON)
|
option(CATCH_INSTALL_HELPERS "Install contrib alongside library" ON)
|
||||||
|
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
|
||||||
|
|
||||||
# define some folders
|
# define some folders
|
||||||
set(CATCH_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
set(CATCH_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
set(SELF_TEST_DIR ${CATCH_DIR}/projects/SelfTest)
|
set(SELF_TEST_DIR ${CATCH_DIR}/projects/SelfTest)
|
||||||
@@ -45,13 +41,17 @@ if(USE_WMAIN)
|
|||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ENTRY:wmainCRTStartup")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ENTRY:wmainCRTStartup")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (BUILD_TESTING AND CATCH_BUILD_TESTING AND NOT_SUBPROJECT)
|
if(NOT_SUBPROJECT)
|
||||||
|
include(CTest)
|
||||||
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
|
if(BUILD_TESTING AND CATCH_BUILD_TESTING)
|
||||||
find_package(PythonInterp)
|
find_package(PythonInterp)
|
||||||
if (NOT PYTHONINTERP_FOUND)
|
if (NOT PYTHONINTERP_FOUND)
|
||||||
message(FATAL_ERROR "Python not found, but required for tests")
|
message(FATAL_ERROR "Python not found, but required for tests")
|
||||||
endif()
|
endif()
|
||||||
add_subdirectory(projects)
|
add_subdirectory(projects)
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(CATCH_BUILD_EXAMPLES)
|
if(CATCH_BUILD_EXAMPLES)
|
||||||
add_subdirectory(examples)
|
add_subdirectory(examples)
|
||||||
@@ -107,6 +107,7 @@ add_library(Catch2::Catch2 ALIAS Catch2)
|
|||||||
# a subproject via `add_subdirectory`, or the destinations will break,
|
# a subproject via `add_subdirectory`, or the destinations will break,
|
||||||
# see https://github.com/catchorg/Catch2/issues/1373
|
# see https://github.com/catchorg/Catch2/issues/1373
|
||||||
if (NOT_SUBPROJECT)
|
if (NOT_SUBPROJECT)
|
||||||
|
include(CMakePackageConfigHelpers)
|
||||||
set(CATCH_CMAKE_CONFIG_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Catch2")
|
set(CATCH_CMAKE_CONFIG_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Catch2")
|
||||||
|
|
||||||
configure_package_config_file(
|
configure_package_config_file(
|
||||||
|
@@ -2,14 +2,14 @@
|
|||||||

|

|
||||||
|
|
||||||
[](https://github.com/catchorg/catch2/releases)
|
[](https://github.com/catchorg/catch2/releases)
|
||||||
[](https://travis-ci.org/catchorg/Catch2)
|
[](https://travis-ci.org/catchorg/Catch2)
|
||||||
[](https://ci.appveyor.com/project/catchorg/catch2)
|
[](https://ci.appveyor.com/project/catchorg/catch2)
|
||||||
[](https://codecov.io/gh/catchorg/Catch2)
|
[](https://codecov.io/gh/catchorg/Catch2)
|
||||||
[](https://wandbox.org/permlink/wRuqI3INY7fTagL7)
|
[](https://wandbox.org/permlink/6JUH8Eybx4CtvkJS)
|
||||||
[](https://discord.gg/4CWS9zD)
|
[](https://discord.gg/4CWS9zD)
|
||||||
|
|
||||||
|
|
||||||
<a href="https://github.com/catchorg/Catch2/releases/download/v2.12.4/catch.hpp">The latest version of the single header can be downloaded directly using this link</a>
|
<a href="https://github.com/catchorg/Catch2/releases/download/v2.13.3/catch.hpp">The latest version of the single header can be downloaded directly using this link</a>
|
||||||
|
|
||||||
## Catch2 is released!
|
## Catch2 is released!
|
||||||
|
|
||||||
|
@@ -19,7 +19,7 @@ coverage:
|
|||||||
|
|
||||||
|
|
||||||
codecov:
|
codecov:
|
||||||
branch: master
|
branch: v2.x
|
||||||
|
|
||||||
comment:
|
comment:
|
||||||
layout: "diff"
|
layout: "diff"
|
||||||
|
@@ -33,6 +33,10 @@ same as the Catch name; see also ``TEST_PREFIX`` and ``TEST_SUFFIX``.
|
|||||||
[TEST_SUFFIX suffix]
|
[TEST_SUFFIX suffix]
|
||||||
[PROPERTIES name1 value1...]
|
[PROPERTIES name1 value1...]
|
||||||
[TEST_LIST var]
|
[TEST_LIST var]
|
||||||
|
[REPORTER reporter]
|
||||||
|
[OUTPUT_DIR dir]
|
||||||
|
[OUTPUT_PREFIX prefix}
|
||||||
|
[OUTPUT_SUFFIX suffix]
|
||||||
)
|
)
|
||||||
|
|
||||||
``catch_discover_tests`` sets up a post-build command on the test executable
|
``catch_discover_tests`` sets up a post-build command on the test executable
|
||||||
@@ -90,6 +94,28 @@ same as the Catch name; see also ``TEST_PREFIX`` and ``TEST_SUFFIX``.
|
|||||||
executable is being used in multiple calls to ``catch_discover_tests()``.
|
executable is being used in multiple calls to ``catch_discover_tests()``.
|
||||||
Note that this variable is only available in CTest.
|
Note that this variable is only available in CTest.
|
||||||
|
|
||||||
|
``REPORTER reporter``
|
||||||
|
Use the specified reporter when running the test case. The reporter will
|
||||||
|
be passed to the Catch executable as ``--reporter reporter``.
|
||||||
|
|
||||||
|
``OUTPUT_DIR dir``
|
||||||
|
If specified, the parameter is passed along as
|
||||||
|
``--out dir/<test_name>`` to Catch executable. The actual file name is the
|
||||||
|
same as the test name. This should be used instead of
|
||||||
|
``EXTRA_ARGS --out foo`` to avoid race conditions writing the result output
|
||||||
|
when using parallel test execution.
|
||||||
|
|
||||||
|
``OUTPUT_PREFIX prefix``
|
||||||
|
May be used in conjunction with ``OUTPUT_DIR``.
|
||||||
|
If specified, ``prefix`` is added to each output file name, like so
|
||||||
|
``--out dir/prefix<test_name>``.
|
||||||
|
|
||||||
|
``OUTPUT_SUFFIX suffix``
|
||||||
|
May be used in conjunction with ``OUTPUT_DIR``.
|
||||||
|
If specified, ``suffix`` is added to each output file name, like so
|
||||||
|
``--out dir/<test_name>suffix``. This can be used to add a file extension to
|
||||||
|
the output e.g. ".xml".
|
||||||
|
|
||||||
#]=======================================================================]
|
#]=======================================================================]
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
@@ -97,7 +123,7 @@ function(catch_discover_tests TARGET)
|
|||||||
cmake_parse_arguments(
|
cmake_parse_arguments(
|
||||||
""
|
""
|
||||||
""
|
""
|
||||||
"TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST"
|
"TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST;REPORTER;OUTPUT_DIR;OUTPUT_PREFIX;OUTPUT_SUFFIX"
|
||||||
"TEST_SPEC;EXTRA_ARGS;PROPERTIES"
|
"TEST_SPEC;EXTRA_ARGS;PROPERTIES"
|
||||||
${ARGN}
|
${ARGN}
|
||||||
)
|
)
|
||||||
@@ -110,7 +136,7 @@ function(catch_discover_tests TARGET)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
## Generate a unique name based on the extra arguments
|
## Generate a unique name based on the extra arguments
|
||||||
string(SHA1 args_hash "${_TEST_SPEC} ${_EXTRA_ARGS}")
|
string(SHA1 args_hash "${_TEST_SPEC} ${_EXTRA_ARGS} ${_REPORTER} ${_OUTPUT_DIR} ${_OUTPUT_PREFIX} ${_OUTPUT_SUFFIX}")
|
||||||
string(SUBSTRING ${args_hash} 0 7 args_hash)
|
string(SUBSTRING ${args_hash} 0 7 args_hash)
|
||||||
|
|
||||||
# Define rule to generate test list for aforementioned test executable
|
# Define rule to generate test list for aforementioned test executable
|
||||||
@@ -134,6 +160,10 @@ function(catch_discover_tests TARGET)
|
|||||||
-D "TEST_PREFIX=${_TEST_PREFIX}"
|
-D "TEST_PREFIX=${_TEST_PREFIX}"
|
||||||
-D "TEST_SUFFIX=${_TEST_SUFFIX}"
|
-D "TEST_SUFFIX=${_TEST_SUFFIX}"
|
||||||
-D "TEST_LIST=${_TEST_LIST}"
|
-D "TEST_LIST=${_TEST_LIST}"
|
||||||
|
-D "TEST_REPORTER=${_REPORTER}"
|
||||||
|
-D "TEST_OUTPUT_DIR=${_OUTPUT_DIR}"
|
||||||
|
-D "TEST_OUTPUT_PREFIX=${_OUTPUT_PREFIX}"
|
||||||
|
-D "TEST_OUTPUT_SUFFIX=${_OUTPUT_SUFFIX}"
|
||||||
-D "CTEST_FILE=${ctest_tests_file}"
|
-D "CTEST_FILE=${ctest_tests_file}"
|
||||||
-P "${_CATCH_DISCOVER_TESTS_SCRIPT}"
|
-P "${_CATCH_DISCOVER_TESTS_SCRIPT}"
|
||||||
VERBATIM
|
VERBATIM
|
||||||
|
@@ -6,6 +6,10 @@ set(suffix "${TEST_SUFFIX}")
|
|||||||
set(spec ${TEST_SPEC})
|
set(spec ${TEST_SPEC})
|
||||||
set(extra_args ${TEST_EXTRA_ARGS})
|
set(extra_args ${TEST_EXTRA_ARGS})
|
||||||
set(properties ${TEST_PROPERTIES})
|
set(properties ${TEST_PROPERTIES})
|
||||||
|
set(reporter ${TEST_REPORTER})
|
||||||
|
set(output_dir ${TEST_OUTPUT_DIR})
|
||||||
|
set(output_prefix ${TEST_OUTPUT_PREFIX})
|
||||||
|
set(output_suffix ${TEST_OUTPUT_SUFFIX})
|
||||||
set(script)
|
set(script)
|
||||||
set(suite)
|
set(suite)
|
||||||
set(tests)
|
set(tests)
|
||||||
@@ -32,6 +36,7 @@ execute_process(
|
|||||||
COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-test-names-only
|
COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-test-names-only
|
||||||
OUTPUT_VARIABLE output
|
OUTPUT_VARIABLE output
|
||||||
RESULT_VARIABLE result
|
RESULT_VARIABLE result
|
||||||
|
WORKING_DIRECTORY "${TEST_WORKING_DIR}"
|
||||||
)
|
)
|
||||||
# Catch --list-test-names-only reports the number of tests, so 0 is... surprising
|
# Catch --list-test-names-only reports the number of tests, so 0 is... surprising
|
||||||
if(${result} EQUAL 0)
|
if(${result} EQUAL 0)
|
||||||
@@ -48,6 +53,44 @@ endif()
|
|||||||
|
|
||||||
string(REPLACE "\n" ";" output "${output}")
|
string(REPLACE "\n" ";" output "${output}")
|
||||||
|
|
||||||
|
# Run test executable to get list of available reporters
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-reporters
|
||||||
|
OUTPUT_VARIABLE reporters_output
|
||||||
|
RESULT_VARIABLE reporters_result
|
||||||
|
WORKING_DIRECTORY "${TEST_WORKING_DIR}"
|
||||||
|
)
|
||||||
|
if(${reporters_result} EQUAL 0)
|
||||||
|
message(WARNING
|
||||||
|
"Test executable '${TEST_EXECUTABLE}' contains no reporters!\n"
|
||||||
|
)
|
||||||
|
elseif(${reporters_result} LESS 0)
|
||||||
|
message(FATAL_ERROR
|
||||||
|
"Error running test executable '${TEST_EXECUTABLE}':\n"
|
||||||
|
" Result: ${reporters_result}\n"
|
||||||
|
" Output: ${reporters_output}\n"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
string(FIND "${reporters_output}" "${reporter}" reporter_is_valid)
|
||||||
|
if(reporter AND ${reporter_is_valid} EQUAL -1)
|
||||||
|
message(FATAL_ERROR
|
||||||
|
"\"${reporter}\" is not a valid reporter!\n"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Prepare reporter
|
||||||
|
if(reporter)
|
||||||
|
set(reporter_arg "--reporter ${reporter}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Prepare output dir
|
||||||
|
if(output_dir AND NOT IS_ABSOLUTE ${output_dir})
|
||||||
|
set(output_dir "${TEST_WORKING_DIR}/${output_dir}")
|
||||||
|
if(NOT EXISTS ${output_dir})
|
||||||
|
file(MAKE_DIRECTORY ${output_dir})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# Parse output
|
# Parse output
|
||||||
foreach(line ${output})
|
foreach(line ${output})
|
||||||
set(test ${line})
|
set(test ${line})
|
||||||
@@ -56,6 +99,12 @@ foreach(line ${output})
|
|||||||
foreach(char , [ ])
|
foreach(char , [ ])
|
||||||
string(REPLACE ${char} "\\${char}" test_name ${test_name})
|
string(REPLACE ${char} "\\${char}" test_name ${test_name})
|
||||||
endforeach(char)
|
endforeach(char)
|
||||||
|
# ...add output dir
|
||||||
|
if(output_dir)
|
||||||
|
string(REGEX REPLACE "[^A-Za-z0-9_]" "_" test_name_clean ${test_name})
|
||||||
|
set(output_dir_arg "--out ${output_dir}/${output_prefix}${test_name_clean}${output_suffix}")
|
||||||
|
endif()
|
||||||
|
|
||||||
# ...and add to script
|
# ...and add to script
|
||||||
add_command(add_test
|
add_command(add_test
|
||||||
"${prefix}${test}${suffix}"
|
"${prefix}${test}${suffix}"
|
||||||
@@ -63,6 +112,8 @@ foreach(line ${output})
|
|||||||
"${TEST_EXECUTABLE}"
|
"${TEST_EXECUTABLE}"
|
||||||
"${test_name}"
|
"${test_name}"
|
||||||
${extra_args}
|
${extra_args}
|
||||||
|
"${reporter_arg}"
|
||||||
|
"${output_dir_arg}"
|
||||||
)
|
)
|
||||||
add_command(set_tests_properties
|
add_command(set_tests_properties
|
||||||
"${prefix}${test}${suffix}"
|
"${prefix}${test}${suffix}"
|
||||||
|
@@ -1,9 +1,11 @@
|
|||||||
#==================================================================================================#
|
#==================================================================================================#
|
||||||
# supported macros #
|
# supported macros #
|
||||||
# - TEST_CASE, #
|
# - TEST_CASE, #
|
||||||
|
# - TEMPLATE_TEST_CASE #
|
||||||
# - SCENARIO, #
|
# - SCENARIO, #
|
||||||
# - TEST_CASE_METHOD, #
|
# - TEST_CASE_METHOD, #
|
||||||
# - CATCH_TEST_CASE, #
|
# - CATCH_TEST_CASE, #
|
||||||
|
# - CATCH_TEMPLATE_TEST_CASE #
|
||||||
# - CATCH_SCENARIO, #
|
# - CATCH_SCENARIO, #
|
||||||
# - CATCH_TEST_CASE_METHOD. #
|
# - CATCH_TEST_CASE_METHOD. #
|
||||||
# #
|
# #
|
||||||
@@ -106,7 +108,8 @@ function(ParseAndAddCatchTests_ParseFile SourceFile TestTarget)
|
|||||||
ParseAndAddCatchTests_RemoveComments(Contents)
|
ParseAndAddCatchTests_RemoveComments(Contents)
|
||||||
|
|
||||||
# Find definition of test names
|
# Find definition of test names
|
||||||
string(REGEX MATCHALL "[ \t]*(CATCH_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)[ \t]*\\([^\)]+\\)+[ \t\n]*{+[ \t]*(//[^\n]*[Tt][Ii][Mm][Ee][Oo][Uu][Tt][ \t]*[0-9]+)*" Tests "${Contents}")
|
# https://regex101.com/r/JygOND/1
|
||||||
|
string(REGEX MATCHALL "[ \t]*(CATCH_)?(TEMPLATE_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)[ \t]*\\([ \t\n]*\"[^\"]*\"[ \t\n]*(,[ \t\n]*\"[^\"]*\")?(,[ \t\n]*[^\,\)]*)*\\)[ \t\n]*\{+[ \t]*(//[^\n]*[Tt][Ii][Mm][Ee][Oo][Uu][Tt][ \t]*[0-9]+)*" Tests "${Contents}")
|
||||||
|
|
||||||
if(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS AND Tests)
|
if(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS AND Tests)
|
||||||
ParseAndAddCatchTests_PrintDebugMessage("Adding ${SourceFile} to CMAKE_CONFIGURE_DEPENDS property")
|
ParseAndAddCatchTests_PrintDebugMessage("Adding ${SourceFile} to CMAKE_CONFIGURE_DEPENDS property")
|
||||||
@@ -117,13 +120,21 @@ function(ParseAndAddCatchTests_ParseFile SourceFile TestTarget)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# check CMP0110 policy for new add_test() behavior
|
||||||
|
if(POLICY CMP0110)
|
||||||
|
cmake_policy(GET CMP0110 _cmp0110_value) # new add_test() behavior
|
||||||
|
else()
|
||||||
|
# just to be thorough explicitly set the variable
|
||||||
|
set(_cmp0110_value)
|
||||||
|
endif()
|
||||||
|
|
||||||
foreach(TestName ${Tests})
|
foreach(TestName ${Tests})
|
||||||
# Strip newlines
|
# Strip newlines
|
||||||
string(REGEX REPLACE "\\\\\n|\n" "" TestName "${TestName}")
|
string(REGEX REPLACE "\\\\\n|\n" "" TestName "${TestName}")
|
||||||
|
|
||||||
# Get test type and fixture if applicable
|
# Get test type and fixture if applicable
|
||||||
string(REGEX MATCH "(CATCH_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)[ \t]*\\([^,^\"]*" TestTypeAndFixture "${TestName}")
|
string(REGEX MATCH "(CATCH_)?(TEMPLATE_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)[ \t]*\\([^,^\"]*" TestTypeAndFixture "${TestName}")
|
||||||
string(REGEX MATCH "(CATCH_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)" TestType "${TestTypeAndFixture}")
|
string(REGEX MATCH "(CATCH_)?(TEMPLATE_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)" TestType "${TestTypeAndFixture}")
|
||||||
string(REGEX REPLACE "${TestType}\\([ \t]*" "" TestFixture "${TestTypeAndFixture}")
|
string(REGEX REPLACE "${TestType}\\([ \t]*" "" TestFixture "${TestTypeAndFixture}")
|
||||||
|
|
||||||
# Get string parts of test definition
|
# Get string parts of test definition
|
||||||
@@ -189,24 +200,39 @@ function(ParseAndAddCatchTests_ParseFile SourceFile TestTarget)
|
|||||||
# Escape commas in the test spec
|
# Escape commas in the test spec
|
||||||
string(REPLACE "," "\\," Name ${Name})
|
string(REPLACE "," "\\," Name ${Name})
|
||||||
|
|
||||||
|
# Work around CMake 3.18.0 change in `add_test()`, before the escaped quotes were neccessary,
|
||||||
|
# only with CMake 3.18.0 the escaped double quotes confuse the call. This change is reverted in 3.18.1
|
||||||
|
# And properly introduced in 3.19 with the CMP0110 policy
|
||||||
|
if(_cmp0110_value STREQUAL "NEW" OR ${CMAKE_VERSION} VERSION_EQUAL "3.18")
|
||||||
|
ParseAndAddCatchTests_PrintDebugMessage("CMP0110 set to NEW, no need for add_test(\"\") workaround")
|
||||||
|
else()
|
||||||
|
ParseAndAddCatchTests_PrintDebugMessage("CMP0110 set to OLD adding \"\" for add_test() workaround")
|
||||||
|
set(CTestName "\"${CTestName}\"")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Handle template test cases
|
||||||
|
if("${TestTypeAndFixture}" MATCHES ".*TEMPLATE_.*")
|
||||||
|
set(Name "${Name} - *")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Add the test and set its properties
|
# Add the test and set its properties
|
||||||
add_test(NAME "\"${CTestName}\"" COMMAND ${OptionalCatchTestLauncher} $<TARGET_FILE:${TestTarget}> ${Name} ${AdditionalCatchParameters})
|
add_test(NAME "${CTestName}" COMMAND ${OptionalCatchTestLauncher} $<TARGET_FILE:${TestTarget}> ${Name} ${AdditionalCatchParameters})
|
||||||
# Old CMake versions do not document VERSION_GREATER_EQUAL, so we use VERSION_GREATER with 3.8 instead
|
# Old CMake versions do not document VERSION_GREATER_EQUAL, so we use VERSION_GREATER with 3.8 instead
|
||||||
if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_GREATER "3.8")
|
if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_GREATER "3.8")
|
||||||
ParseAndAddCatchTests_PrintDebugMessage("Setting DISABLED test property")
|
ParseAndAddCatchTests_PrintDebugMessage("Setting DISABLED test property")
|
||||||
set_tests_properties("\"${CTestName}\"" PROPERTIES DISABLED ON)
|
set_tests_properties("${CTestName}" PROPERTIES DISABLED ON)
|
||||||
else()
|
else()
|
||||||
set_tests_properties("\"${CTestName}\"" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran"
|
set_tests_properties("${CTestName}" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran"
|
||||||
LABELS "${Labels}")
|
LABELS "${Labels}")
|
||||||
endif()
|
endif()
|
||||||
set_property(
|
set_property(
|
||||||
TARGET ${TestTarget}
|
TARGET ${TestTarget}
|
||||||
APPEND
|
APPEND
|
||||||
PROPERTY ParseAndAddCatchTests_TESTS "\"${CTestName}\"")
|
PROPERTY ParseAndAddCatchTests_TESTS "${CTestName}")
|
||||||
set_property(
|
set_property(
|
||||||
SOURCE ${SourceFile}
|
SOURCE ${SourceFile}
|
||||||
APPEND
|
APPEND
|
||||||
PROPERTY ParseAndAddCatchTests_TESTS "\"${CTestName}\"")
|
PROPERTY ParseAndAddCatchTests_TESTS "${CTestName}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
@@ -36,6 +36,20 @@ add_subdirectory(lib/Catch2)
|
|||||||
target_link_libraries(tests Catch2::Catch2)
|
target_link_libraries(tests Catch2::Catch2)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Another possibility is to use [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html):
|
||||||
|
```cmake
|
||||||
|
Include(FetchContent)
|
||||||
|
|
||||||
|
FetchContent_Declare(
|
||||||
|
Catch2
|
||||||
|
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||||
|
GIT_TAG v2.13.1)
|
||||||
|
|
||||||
|
FetchContent_MakeAvailable(Catch2)
|
||||||
|
|
||||||
|
target_link_libraries(tests Catch2::Catch2)
|
||||||
|
```
|
||||||
|
|
||||||
## Automatic test registration
|
## Automatic test registration
|
||||||
|
|
||||||
Catch2's repository also contains two CMake scripts that help users
|
Catch2's repository also contains two CMake scripts that help users
|
||||||
@@ -83,6 +97,10 @@ catch_discover_tests(target
|
|||||||
[TEST_SUFFIX suffix]
|
[TEST_SUFFIX suffix]
|
||||||
[PROPERTIES name1 value1...]
|
[PROPERTIES name1 value1...]
|
||||||
[TEST_LIST var]
|
[TEST_LIST var]
|
||||||
|
[REPORTER reporter]
|
||||||
|
[OUTPUT_DIR dir]
|
||||||
|
[OUTPUT_PREFIX prefix]
|
||||||
|
[OUTPUT_SUFFIX suffix]
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -129,6 +147,32 @@ default `<target>_TESTS`. This can be useful when the same test
|
|||||||
executable is being used in multiple calls to `catch_discover_tests()`.
|
executable is being used in multiple calls to `catch_discover_tests()`.
|
||||||
Note that this variable is only available in CTest.
|
Note that this variable is only available in CTest.
|
||||||
|
|
||||||
|
* `REPORTER reporter`
|
||||||
|
|
||||||
|
Use the specified reporter when running the test case. The reporter will
|
||||||
|
be passed to the test runner as `--reporter reporter`.
|
||||||
|
|
||||||
|
* `OUTPUT_DIR dir`
|
||||||
|
|
||||||
|
If specified, the parameter is passed along as
|
||||||
|
`--out dir/<test_name>` to test executable. The actual file name is the
|
||||||
|
same as the test name. This should be used instead of
|
||||||
|
`EXTRA_ARGS --out foo` to avoid race conditions writing the result output
|
||||||
|
when using parallel test execution.
|
||||||
|
|
||||||
|
* `OUTPUT_PREFIX prefix`
|
||||||
|
|
||||||
|
May be used in conjunction with `OUTPUT_DIR`.
|
||||||
|
If specified, `prefix` is added to each output file name, like so
|
||||||
|
`--out dir/prefix<test_name>`.
|
||||||
|
|
||||||
|
* `OUTPUT_SUFFIX suffix`
|
||||||
|
|
||||||
|
May be used in conjunction with `OUTPUT_DIR`.
|
||||||
|
If specified, `suffix` is added to each output file name, like so
|
||||||
|
`--out dir/<test_name>suffix`. This can be used to add a file extension to
|
||||||
|
the output file name e.g. ".xml".
|
||||||
|
|
||||||
|
|
||||||
### `ParseAndAddCatchTests.cmake`
|
### `ParseAndAddCatchTests.cmake`
|
||||||
|
|
||||||
|
@@ -222,6 +222,16 @@ available warnings
|
|||||||
|
|
||||||
When set to ```yes``` Catch will report the duration of each test case, in milliseconds. Note that it does this regardless of whether a test case passes or fails. Note, also, the certain reporters (e.g. Junit) always report test case durations regardless of this option being set or not.
|
When set to ```yes``` Catch will report the duration of each test case, in milliseconds. Note that it does this regardless of whether a test case passes or fails. Note, also, the certain reporters (e.g. Junit) always report test case durations regardless of this option being set or not.
|
||||||
|
|
||||||
|
<pre>-D, --min-duration <value></pre>
|
||||||
|
|
||||||
|
> `--min-duration` was [introduced](https://github.com/catchorg/Catch2/pull/1910) in Catch 2.13.0
|
||||||
|
|
||||||
|
When set, Catch will report the duration of each test case that took more
|
||||||
|
than <value> seconds, in milliseconds. This option is overriden by both
|
||||||
|
`-d yes` and `-d no`, so that either all durations are reported, or none
|
||||||
|
are.
|
||||||
|
|
||||||
|
|
||||||
<a id="input-file"></a>
|
<a id="input-file"></a>
|
||||||
## Load test names to run from a file
|
## Load test names to run from a file
|
||||||
<pre>-f, --input-file <filename></pre>
|
<pre>-f, --input-file <filename></pre>
|
||||||
|
@@ -21,8 +21,8 @@ to the codebase itself.
|
|||||||
|
|
||||||
## Using Git(Hub)
|
## Using Git(Hub)
|
||||||
|
|
||||||
Ongoing development happens in the `master` branch for Catch2 v2, and in
|
Ongoing development happens in the `v2.x` branch for Catch2 v2, and in
|
||||||
`dev-v3` for the next major version, v3.
|
`devel` for the next major version, v3.
|
||||||
|
|
||||||
Commits should be small and atomic. A commit is atomic when, after it is
|
Commits should be small and atomic. A commit is atomic when, after it is
|
||||||
applied, the codebase, tests and all, still works as expected. Small
|
applied, the codebase, tests and all, still works as expected. Small
|
||||||
|
@@ -12,29 +12,16 @@ are run once per each value in a generator.
|
|||||||
This is best explained with an example:
|
This is best explained with an example:
|
||||||
```cpp
|
```cpp
|
||||||
TEST_CASE("Generators") {
|
TEST_CASE("Generators") {
|
||||||
auto i = GENERATE(1, 2);
|
auto i = GENERATE(1, 3, 5);
|
||||||
SECTION("one") {
|
REQUIRE(is_odd(i));
|
||||||
auto j = GENERATE(-3, -2);
|
|
||||||
REQUIRE(j < i);
|
|
||||||
}
|
|
||||||
SECTION("two") {
|
|
||||||
auto k = GENERATE(4, 5, 6);
|
|
||||||
REQUIRE(j != k);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The `SECTION` "one" will be run 4 (2*2) times, because the outer
|
The "Generators" `TEST_CASE` will be entered 3 times, and the value of
|
||||||
generator has 2 elements in it, and the inner generator also has 2
|
`i` will be 1, 3, and 5 in turn. `GENERATE`s can also be used multiple
|
||||||
elements in it. The `SECTION` "two" will be run 6 (2*3) times. The
|
times at the same scope, in which case the result will be a cartesian
|
||||||
sections will be run in order "one", "one", "two", "two", "two", "one",
|
product of all elements in the generators. This means that in the snippet
|
||||||
...
|
below, the test case will be run 6 (2\*3) times.
|
||||||
|
|
||||||
It is also possible to have multiple generators at the same level of
|
|
||||||
nesting. The result is the same as when generators are inside nested
|
|
||||||
sections, that is, the result will be a cartesian product of all
|
|
||||||
elements. This means that in the snippet below, the test case will be
|
|
||||||
run 6 (2*3) times.
|
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
TEST_CASE("Generators") {
|
TEST_CASE("Generators") {
|
||||||
@@ -43,11 +30,70 @@ TEST_CASE("Generators") {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
There are 2 parts to generators in Catch2, the `GENERATE` macro together
|
There are 2 parts to generators in Catch2, the `GENERATE` macro together
|
||||||
with the already provided generators, and the `IGenerator<T>` interface
|
with the already provided generators, and the `IGenerator<T>` interface
|
||||||
that allows users to implement their own generators.
|
that allows users to implement their own generators.
|
||||||
|
|
||||||
|
|
||||||
|
## Combining `GENERATE` and `SECTION`.
|
||||||
|
|
||||||
|
`GENERATE` can be seen as an implicit `SECTION`, that goes from the place
|
||||||
|
`GENERATE` is used, to the end of the scope. This can be used for various
|
||||||
|
effects. The simplest usage is shown below, where the `SECTION` "one"
|
||||||
|
runs 4 (2\*2) times, and `SECTION` "two" is run 6 times (2\*3).
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
TEST_CASE("Generators") {
|
||||||
|
auto i = GENERATE(1, 2);
|
||||||
|
SECTION("one") {
|
||||||
|
auto j = GENERATE(-3, -2);
|
||||||
|
REQUIRE(j < i);
|
||||||
|
}
|
||||||
|
SECTION("two") {
|
||||||
|
auto k = GENERATE(4, 5, 6);
|
||||||
|
REQUIRE(i != k);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The specific order of the `SECTION`s will be "one", "one", "two", "two",
|
||||||
|
"two", "one"...
|
||||||
|
|
||||||
|
|
||||||
|
The fact that `GENERATE` introduces a virtual `SECTION` can also be used
|
||||||
|
to make a generator replay only some `SECTION`s, without having to
|
||||||
|
explicitly add a `SECTION`. As an example, the code below reports 3
|
||||||
|
assertions, because the "first" section is run once, but the "second"
|
||||||
|
section is run twice.
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
TEST_CASE("GENERATE between SECTIONs") {
|
||||||
|
SECTION("first") { REQUIRE(true); }
|
||||||
|
auto _ = GENERATE(1, 2);
|
||||||
|
SECTION("second") { REQUIRE(true); }
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This can lead to surprisingly complex test flows. As an example, the test
|
||||||
|
below will report 14 assertions:
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
TEST_CASE("Complex mix of sections and generates") {
|
||||||
|
auto i = GENERATE(1, 2);
|
||||||
|
SECTION("A") {
|
||||||
|
SUCCEED("A");
|
||||||
|
}
|
||||||
|
auto j = GENERATE(3, 4);
|
||||||
|
SECTION("B") {
|
||||||
|
SUCCEED("B");
|
||||||
|
}
|
||||||
|
auto k = GENERATE(5, 6);
|
||||||
|
SUCCEED();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
> The ability to place `GENERATE` between two `SECTION`s was [introduced](https://github.com/catchorg/Catch2/issues/1938) in Catch 2.13.0.
|
||||||
|
|
||||||
## Provided generators
|
## Provided generators
|
||||||
|
|
||||||
Catch2's provided generator functionality consists of three parts,
|
Catch2's provided generator functionality consists of three parts,
|
||||||
|
@@ -94,6 +94,9 @@ A thread-safe header-only mocking framework for C++14.
|
|||||||
|
|
||||||
## Applications & Tools
|
## Applications & Tools
|
||||||
|
|
||||||
|
### [App Mesh](https://github.com/laoshanxi/app-mesh)
|
||||||
|
A high available cloud native micro-service application management platform implemented by modern C++.
|
||||||
|
|
||||||
### [ArangoDB](https://github.com/arangodb/arangodb)
|
### [ArangoDB](https://github.com/arangodb/arangodb)
|
||||||
ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values.
|
ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values.
|
||||||
|
|
||||||
|
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
# Release notes
|
# Release notes
|
||||||
**Contents**<br>
|
**Contents**<br>
|
||||||
|
[2.13.3](#2133)<br>
|
||||||
|
[2.13.2](#2132)<br>
|
||||||
|
[2.13.1](#2131)<br>
|
||||||
|
[2.13.0](#2130)<br>
|
||||||
[2.12.4](#2124)<br>
|
[2.12.4](#2124)<br>
|
||||||
[2.12.3](#2123)<br>
|
[2.12.3](#2123)<br>
|
||||||
[2.12.2](#2122)<br>
|
[2.12.2](#2122)<br>
|
||||||
@@ -40,6 +44,61 @@
|
|||||||
[Even Older versions](#even-older-versions)<br>
|
[Even Older versions](#even-older-versions)<br>
|
||||||
|
|
||||||
|
|
||||||
|
## 2.13.3
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
* Fixed possible infinite loop when combining generators with section filter (`-c` option) (#2025)
|
||||||
|
|
||||||
|
### Miscellaneous
|
||||||
|
* Fixed `ParseAndAddCatchTests` not finding `TEST_CASE`s without tags (#2055, #2056)
|
||||||
|
* `ParseAndAddCatchTests` supports `CMP0110` policy for changing behaviour of `add_test` (#2057)
|
||||||
|
* This was the shortlived change in CMake 3.18.0 that temporarily broke `ParseAndAddCatchTests`
|
||||||
|
|
||||||
|
|
||||||
|
## 2.13.2
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
* Implemented workaround for AppleClang shadowing bug (#2030)
|
||||||
|
* Implemented workaround for NVCC ICE (#2005, #2027)
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
* Fixed detection of `std::uncaught_exceptions` support under non-msvc platforms (#2021)
|
||||||
|
* Fixed the experimental stdout/stderr capture under Windows (#2013)
|
||||||
|
|
||||||
|
### Miscellaneous
|
||||||
|
* `catch_discover_tests` has been improved significantly (#2023, #2039)
|
||||||
|
* You can now specify which reporter should be used
|
||||||
|
* You can now modify where the output will be written
|
||||||
|
* `WORKING_DIRECTORY` setting is respected
|
||||||
|
* `ParseAndAddCatchTests` now supports `TEMPLATE_TEST_CASE` macros (#2031)
|
||||||
|
* Various documentation fixes and improvements (#2022, #2028, #2034)
|
||||||
|
|
||||||
|
|
||||||
|
## 2.13.1
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
* `ParseAndAddCatchTests` handles CMake v3.18.0 correctly (#1984)
|
||||||
|
* Improved autodetection of `std::byte` (#1992)
|
||||||
|
* Simplified implementation of templated test cases (#2007)
|
||||||
|
* This should have a tiny positive effect on its compilation throughput
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
* Automatic stringification of ranges handles sentinel ranges properly (#2004)
|
||||||
|
|
||||||
|
|
||||||
|
## 2.13.0
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
* `GENERATE` can now follow a `SECTION` at the same level of nesting (#1938)
|
||||||
|
* The `SECTION`(s) before the `GENERATE` will not be run multiple times, the following ones will.
|
||||||
|
* Added `-D`/`--min-duration` command line flag (#1910)
|
||||||
|
* If a test takes longer to finish than the provided value, its name and duration will be printed.
|
||||||
|
* This flag is overriden by setting `-d`/`--duration`.
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
* `TAPReporter` no longer skips successful assertions (#1983)
|
||||||
|
|
||||||
|
|
||||||
## 2.12.4
|
## 2.12.4
|
||||||
|
|
||||||
### Improvements
|
### Improvements
|
||||||
@@ -619,7 +678,7 @@ than `single_include/catch.hpp`.**
|
|||||||
* CLR objects (`T^`) can now be stringified (#1216)
|
* CLR objects (`T^`) can now be stringified (#1216)
|
||||||
* This affects code compiled as C++/CLI
|
* This affects code compiled as C++/CLI
|
||||||
* Added `PredicateMatcher`, a matcher that takes an arbitrary predicate function (#1236)
|
* Added `PredicateMatcher`, a matcher that takes an arbitrary predicate function (#1236)
|
||||||
* See [documentation for details](https://github.com/catchorg/Catch2/blob/master/docs/matchers.md)
|
* See [documentation for details](https://github.com/catchorg/Catch2/blob/v2.x/docs/matchers.md)
|
||||||
|
|
||||||
### Others
|
### Others
|
||||||
* Modified CMake-installed pkg-config to allow `#include <catch.hpp>`(#1239)
|
* Modified CMake-installed pkg-config to allow `#include <catch.hpp>`(#1239)
|
||||||
@@ -647,7 +706,7 @@ than `single_include/catch.hpp`.**
|
|||||||
* Added an option to warn (+ exit with error) when no tests were ran (#1158)
|
* Added an option to warn (+ exit with error) when no tests were ran (#1158)
|
||||||
* Use as `-w NoTests`
|
* Use as `-w NoTests`
|
||||||
* Added provisional support for Emscripten (#1114)
|
* Added provisional support for Emscripten (#1114)
|
||||||
* [Added a way to override the fallback stringifier](https://github.com/catchorg/Catch2/blob/master/docs/configuration.md#fallback-stringifier) (#1024)
|
* [Added a way to override the fallback stringifier](https://github.com/catchorg/Catch2/blob/v2.x/docs/configuration.md#fallback-stringifier) (#1024)
|
||||||
* This allows project's own stringification machinery to be easily reused for Catch
|
* This allows project's own stringification machinery to be easily reused for Catch
|
||||||
* `Catch::Session::run()` now accepts `char const * const *`, allowing it to accept array of string literals (#1031, #1178)
|
* `Catch::Session::run()` now accepts `char const * const *`, allowing it to accept array of string literals (#1031, #1178)
|
||||||
* The embedded version of Clara was bumped to v1.1.3
|
* The embedded version of Clara was bumped to v1.1.3
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
## Getting Catch2
|
## Getting Catch2
|
||||||
|
|
||||||
The simplest way to get Catch2 is to download the latest [single header version](https://raw.githubusercontent.com/catchorg/Catch2/master/single_include/catch2/catch.hpp). The single header is generated by merging a set of individual headers but it is still just normal source code in a header file.
|
The simplest way to get Catch2 is to download the latest [single header version](https://raw.githubusercontent.com/catchorg/Catch2/v2.x/single_include/catch2/catch.hpp). The single header is generated by merging a set of individual headers but it is still just normal source code in a header file.
|
||||||
|
|
||||||
Alternative ways of getting Catch2 include using your system package
|
Alternative ways of getting Catch2 include using your system package
|
||||||
manager, or installing it using [its CMake package](cmake-integration.md#installing-catch2-from-git-repository).
|
manager, or installing it using [its CMake package](cmake-integration.md#installing-catch2-from-git-repository).
|
||||||
|
@@ -10,8 +10,8 @@
|
|||||||
#define TWOBLUECUBES_CATCH_HPP_INCLUDED
|
#define TWOBLUECUBES_CATCH_HPP_INCLUDED
|
||||||
|
|
||||||
#define CATCH_VERSION_MAJOR 2
|
#define CATCH_VERSION_MAJOR 2
|
||||||
#define CATCH_VERSION_MINOR 12
|
#define CATCH_VERSION_MINOR 13
|
||||||
#define CATCH_VERSION_PATCH 4
|
#define CATCH_VERSION_PATCH 3
|
||||||
|
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
# pragma clang system_header
|
# pragma clang system_header
|
||||||
|
@@ -170,6 +170,9 @@ namespace Catch {
|
|||||||
| Opt( [&]( bool flag ) { config.showDurations = flag ? ShowDurations::Always : ShowDurations::Never; }, "yes|no" )
|
| Opt( [&]( bool flag ) { config.showDurations = flag ? ShowDurations::Always : ShowDurations::Never; }, "yes|no" )
|
||||||
["-d"]["--durations"]
|
["-d"]["--durations"]
|
||||||
( "show test durations" )
|
( "show test durations" )
|
||||||
|
| Opt( config.minDuration, "seconds" )
|
||||||
|
["-D"]["--min-duration"]
|
||||||
|
( "show test durations for tests taking at least the given number of seconds" )
|
||||||
| Opt( loadTestNamesFromFile, "filename" )
|
| Opt( loadTestNamesFromFile, "filename" )
|
||||||
["-f"]["--input-file"]
|
["-f"]["--input-file"]
|
||||||
( "load test names to run from a file" )
|
( "load test names to run from a file" )
|
||||||
|
@@ -39,13 +39,9 @@
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__cpp_lib_uncaught_exceptions)
|
|
||||||
# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// We have to avoid both ICC and Clang, because they try to mask themselves
|
// We have to avoid both ICC and Clang, because they try to mask themselves
|
||||||
// as gcc, and we want only GCC in this block
|
// as gcc, and we want only GCC in this block
|
||||||
#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC)
|
#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && !defined(__CUDACC__)
|
||||||
# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic push" )
|
# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic push" )
|
||||||
# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic pop" )
|
# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic pop" )
|
||||||
|
|
||||||
@@ -69,7 +65,7 @@
|
|||||||
// ```
|
// ```
|
||||||
//
|
//
|
||||||
// Therefore, `CATCH_INTERNAL_IGNORE_BUT_WARN` is not implemented.
|
// Therefore, `CATCH_INTERNAL_IGNORE_BUT_WARN` is not implemented.
|
||||||
# if !defined(__ibmxl__)
|
# if !defined(__ibmxl__) && !defined(__CUDACC__)
|
||||||
# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) /* NOLINT(cppcoreguidelines-pro-type-vararg, hicpp-vararg) */
|
# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) /* NOLINT(cppcoreguidelines-pro-type-vararg, hicpp-vararg) */
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
@@ -153,9 +149,6 @@
|
|||||||
# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION __pragma( warning(push) )
|
# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION __pragma( warning(push) )
|
||||||
# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION __pragma( warning(pop) )
|
# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION __pragma( warning(pop) )
|
||||||
|
|
||||||
# if _MSC_VER >= 1900 // Visual Studio 2015 or newer
|
|
||||||
# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
|
|
||||||
# endif
|
|
||||||
|
|
||||||
// Universal Windows platform does not support SEH
|
// Universal Windows platform does not support SEH
|
||||||
// Or console colours (or console at all...)
|
// Or console colours (or console at all...)
|
||||||
@@ -240,7 +233,10 @@
|
|||||||
|
|
||||||
// Check if byte is available and usable
|
// Check if byte is available and usable
|
||||||
# if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
|
# if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
|
||||||
|
# include <cstddef>
|
||||||
|
# if __cpp_lib_byte > 0
|
||||||
# define CATCH_INTERNAL_CONFIG_CPP17_BYTE
|
# define CATCH_INTERNAL_CONFIG_CPP17_BYTE
|
||||||
|
# endif
|
||||||
# endif // __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
|
# endif // __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
|
||||||
|
|
||||||
// Check if variant is available and usable
|
// Check if variant is available and usable
|
||||||
@@ -284,10 +280,6 @@
|
|||||||
# define CATCH_CONFIG_CPP17_OPTIONAL
|
# define CATCH_CONFIG_CPP17_OPTIONAL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
|
|
||||||
# define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW)
|
#if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW)
|
||||||
# define CATCH_CONFIG_CPP17_STRING_VIEW
|
# define CATCH_CONFIG_CPP17_STRING_VIEW
|
||||||
#endif
|
#endif
|
||||||
|
@@ -64,6 +64,7 @@ namespace Catch {
|
|||||||
bool Config::warnAboutMissingAssertions() const { return !!(m_data.warnings & WarnAbout::NoAssertions); }
|
bool Config::warnAboutMissingAssertions() const { return !!(m_data.warnings & WarnAbout::NoAssertions); }
|
||||||
bool Config::warnAboutNoTests() const { return !!(m_data.warnings & WarnAbout::NoTests); }
|
bool Config::warnAboutNoTests() const { return !!(m_data.warnings & WarnAbout::NoTests); }
|
||||||
ShowDurations::OrNot Config::showDurations() const { return m_data.showDurations; }
|
ShowDurations::OrNot Config::showDurations() const { return m_data.showDurations; }
|
||||||
|
double Config::minDuration() const { return m_data.minDuration; }
|
||||||
RunTests::InWhatOrder Config::runOrder() const { return m_data.runOrder; }
|
RunTests::InWhatOrder Config::runOrder() const { return m_data.runOrder; }
|
||||||
unsigned int Config::rngSeed() const { return m_data.rngSeed; }
|
unsigned int Config::rngSeed() const { return m_data.rngSeed; }
|
||||||
UseColour::YesOrNo Config::useColour() const { return m_data.useColour; }
|
UseColour::YesOrNo Config::useColour() const { return m_data.useColour; }
|
||||||
|
@@ -52,6 +52,7 @@ namespace Catch {
|
|||||||
Verbosity verbosity = Verbosity::Normal;
|
Verbosity verbosity = Verbosity::Normal;
|
||||||
WarnAbout::What warnings = WarnAbout::Nothing;
|
WarnAbout::What warnings = WarnAbout::Nothing;
|
||||||
ShowDurations::OrNot showDurations = ShowDurations::DefaultForReporter;
|
ShowDurations::OrNot showDurations = ShowDurations::DefaultForReporter;
|
||||||
|
double minDuration = -1;
|
||||||
RunTests::InWhatOrder runOrder = RunTests::InDeclarationOrder;
|
RunTests::InWhatOrder runOrder = RunTests::InDeclarationOrder;
|
||||||
UseColour::YesOrNo useColour = UseColour::Auto;
|
UseColour::YesOrNo useColour = UseColour::Auto;
|
||||||
WaitForKeypress::When waitForKeypress = WaitForKeypress::Never;
|
WaitForKeypress::When waitForKeypress = WaitForKeypress::Never;
|
||||||
@@ -103,6 +104,7 @@ namespace Catch {
|
|||||||
bool warnAboutMissingAssertions() const override;
|
bool warnAboutMissingAssertions() const override;
|
||||||
bool warnAboutNoTests() const override;
|
bool warnAboutNoTests() const override;
|
||||||
ShowDurations::OrNot showDurations() const override;
|
ShowDurations::OrNot showDurations() const override;
|
||||||
|
double minDuration() const override;
|
||||||
RunTests::InWhatOrder runOrder() const override;
|
RunTests::InWhatOrder runOrder() const override;
|
||||||
unsigned int rngSeed() const override;
|
unsigned int rngSeed() const override;
|
||||||
UseColour::YesOrNo useColour() const override;
|
UseColour::YesOrNo useColour() const override;
|
||||||
|
44
include/internal/catch_config_uncaught_exceptions.hpp
Normal file
44
include/internal/catch_config_uncaught_exceptions.hpp
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
|
||||||
|
// Copyright Catch2 Authors
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// https://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
// SPDX-License-Identifier: BSL-1.0
|
||||||
|
|
||||||
|
/** \file
|
||||||
|
* Wrapper for UNCAUGHT_EXCEPTIONS configuration option
|
||||||
|
*
|
||||||
|
* For some functionality, Catch2 requires to know whether there is
|
||||||
|
* an active exception. Because `std::uncaught_exception` is deprecated
|
||||||
|
* in C++17, we want to use `std::uncaught_exceptions` if possible.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP
|
||||||
|
#define CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
# if _MSC_VER >= 1900 // Visual Studio 2015 or newer
|
||||||
|
# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#include <exception>
|
||||||
|
|
||||||
|
#if defined(__cpp_lib_uncaught_exceptions) \
|
||||||
|
&& !defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
|
||||||
|
|
||||||
|
# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
|
||||||
|
#endif // __cpp_lib_uncaught_exceptions
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) \
|
||||||
|
&& !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) \
|
||||||
|
&& !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
|
||||||
|
|
||||||
|
# define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif // CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP
|
@@ -69,6 +69,7 @@ namespace Catch {
|
|||||||
virtual int abortAfter() const = 0;
|
virtual int abortAfter() const = 0;
|
||||||
virtual bool showInvisibles() const = 0;
|
virtual bool showInvisibles() const = 0;
|
||||||
virtual ShowDurations::OrNot showDurations() const = 0;
|
virtual ShowDurations::OrNot showDurations() const = 0;
|
||||||
|
virtual double minDuration() const = 0;
|
||||||
virtual TestSpec const& testSpec() const = 0;
|
virtual TestSpec const& testSpec() const = 0;
|
||||||
virtual bool hasTestFilters() const = 0;
|
virtual bool hasTestFilters() const = 0;
|
||||||
virtual std::vector<std::string> const& getTestsOrTags() const = 0;
|
virtual std::vector<std::string> const& getTestsOrTags() const = 0;
|
||||||
|
@@ -66,7 +66,7 @@ namespace Catch {
|
|||||||
if (tmpnam_s(m_buffer)) {
|
if (tmpnam_s(m_buffer)) {
|
||||||
CATCH_RUNTIME_ERROR("Could not get a temp filename");
|
CATCH_RUNTIME_ERROR("Could not get a temp filename");
|
||||||
}
|
}
|
||||||
if (fopen_s(&m_file, m_buffer, "w")) {
|
if (fopen_s(&m_file, m_buffer, "w+")) {
|
||||||
char buffer[100];
|
char buffer[100];
|
||||||
if (strerror_s(buffer, errno)) {
|
if (strerror_s(buffer, errno)) {
|
||||||
CATCH_RUNTIME_ERROR("Could not translate errno to a string");
|
CATCH_RUNTIME_ERROR("Could not translate errno to a string");
|
||||||
|
@@ -50,7 +50,7 @@ namespace Catch {
|
|||||||
currentTracker.addChild( tracker );
|
currentTracker.addChild( tracker );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !ctx.completedCycle() && !tracker->isComplete() ) {
|
if( !tracker->isComplete() ) {
|
||||||
tracker->open();
|
tracker->open();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,8 +64,68 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
void close() override {
|
void close() override {
|
||||||
TrackerBase::close();
|
TrackerBase::close();
|
||||||
// Generator interface only finds out if it has another item on atual move
|
// If a generator has a child (it is followed by a section)
|
||||||
if (m_runState == CompletedSuccessfully && m_generator->next()) {
|
// and none of its children have started, then we must wait
|
||||||
|
// until later to start consuming its values.
|
||||||
|
// This catches cases where `GENERATE` is placed between two
|
||||||
|
// `SECTION`s.
|
||||||
|
// **The check for m_children.empty cannot be removed**.
|
||||||
|
// doing so would break `GENERATE` _not_ followed by `SECTION`s.
|
||||||
|
const bool should_wait_for_child = [&]() {
|
||||||
|
// No children -> nobody to wait for
|
||||||
|
if ( m_children.empty() ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// If at least one child started executing, don't wait
|
||||||
|
if ( std::find_if(
|
||||||
|
m_children.begin(),
|
||||||
|
m_children.end(),
|
||||||
|
[]( TestCaseTracking::ITrackerPtr tracker ) {
|
||||||
|
return tracker->hasStarted();
|
||||||
|
} ) != m_children.end() ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// No children have started. We need to check if they _can_
|
||||||
|
// start, and thus we should wait for them, or they cannot
|
||||||
|
// start (due to filters), and we shouldn't wait for them
|
||||||
|
auto* parent = m_parent;
|
||||||
|
// This is safe: there is always at least one section
|
||||||
|
// tracker in a test case tracking tree
|
||||||
|
while ( !parent->isSectionTracker() ) {
|
||||||
|
parent = &( parent->parent() );
|
||||||
|
}
|
||||||
|
assert( parent &&
|
||||||
|
"Missing root (test case) level section" );
|
||||||
|
|
||||||
|
auto const& parentSection =
|
||||||
|
static_cast<SectionTracker&>( *parent );
|
||||||
|
auto const& filters = parentSection.getFilters();
|
||||||
|
// No filters -> no restrictions on running sections
|
||||||
|
if ( filters.empty() ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( auto const& child : m_children ) {
|
||||||
|
if ( child->isSectionTracker() &&
|
||||||
|
std::find( filters.begin(),
|
||||||
|
filters.end(),
|
||||||
|
static_cast<SectionTracker&>( *child )
|
||||||
|
.trimmedName() ) !=
|
||||||
|
filters.end() ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}();
|
||||||
|
|
||||||
|
// This check is a bit tricky, because m_generator->next()
|
||||||
|
// has a side-effect, where it consumes generator's current
|
||||||
|
// value, but we do not want to invoke the side-effect if
|
||||||
|
// this generator is still waiting for any child to start.
|
||||||
|
if ( should_wait_for_child ||
|
||||||
|
( m_runState == CompletedSuccessfully &&
|
||||||
|
m_generator->next() ) ) {
|
||||||
m_children.clear();
|
m_children.clear();
|
||||||
m_runState = Executing;
|
m_runState = Executing;
|
||||||
}
|
}
|
||||||
@@ -206,7 +266,6 @@ namespace Catch {
|
|||||||
using namespace Generators;
|
using namespace Generators;
|
||||||
GeneratorTracker& tracker = GeneratorTracker::acquire(m_trackerContext,
|
GeneratorTracker& tracker = GeneratorTracker::acquire(m_trackerContext,
|
||||||
TestCaseTracking::NameAndLocation( static_cast<std::string>(generatorName), lineInfo ) );
|
TestCaseTracking::NameAndLocation( static_cast<std::string>(generatorName), lineInfo ) );
|
||||||
assert( tracker.isOpen() );
|
|
||||||
m_lastAssertionInfo.lineInfo = lineInfo;
|
m_lastAssertionInfo.lineInfo = lineInfo;
|
||||||
return tracker;
|
return tracker;
|
||||||
}
|
}
|
||||||
|
@@ -22,10 +22,10 @@ namespace Catch {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
struct TestHasher {
|
struct TestHasher {
|
||||||
explicit TestHasher(Catch::SimplePcg32& rng) {
|
explicit TestHasher(Catch::SimplePcg32& rng_instance) {
|
||||||
basis = rng();
|
basis = rng_instance();
|
||||||
basis <<= 32;
|
basis <<= 32;
|
||||||
basis |= rng();
|
basis |= rng_instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t basis;
|
uint64_t basis;
|
||||||
|
@@ -187,7 +187,8 @@ namespace TestCaseTracking {
|
|||||||
bool SectionTracker::isComplete() const {
|
bool SectionTracker::isComplete() const {
|
||||||
bool complete = true;
|
bool complete = true;
|
||||||
|
|
||||||
if ((m_filters.empty() || m_filters[0] == "")
|
if (m_filters.empty()
|
||||||
|
|| m_filters[0] == ""
|
||||||
|| std::find(m_filters.begin(), m_filters.end(), m_trimmed_name) != m_filters.end()) {
|
|| std::find(m_filters.begin(), m_filters.end(), m_trimmed_name) != m_filters.end()) {
|
||||||
complete = TrackerBase::isComplete();
|
complete = TrackerBase::isComplete();
|
||||||
}
|
}
|
||||||
@@ -232,6 +233,14 @@ namespace TestCaseTracking {
|
|||||||
m_filters.insert( m_filters.end(), filters.begin()+1, filters.end() );
|
m_filters.insert( m_filters.end(), filters.begin()+1, filters.end() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> const& SectionTracker::getFilters() const {
|
||||||
|
return m_filters;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string const& SectionTracker::trimmedName() const {
|
||||||
|
return m_trimmed_name;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace TestCaseTracking
|
} // namespace TestCaseTracking
|
||||||
|
|
||||||
using TestCaseTracking::ITracker;
|
using TestCaseTracking::ITracker;
|
||||||
|
@@ -55,6 +55,7 @@ namespace TestCaseTracking {
|
|||||||
virtual bool isSuccessfullyCompleted() const = 0;
|
virtual bool isSuccessfullyCompleted() const = 0;
|
||||||
virtual bool isOpen() const = 0; // Started but not complete
|
virtual bool isOpen() const = 0; // Started but not complete
|
||||||
virtual bool hasChildren() const = 0;
|
virtual bool hasChildren() const = 0;
|
||||||
|
virtual bool hasStarted() const = 0;
|
||||||
|
|
||||||
virtual ITracker& parent() = 0;
|
virtual ITracker& parent() = 0;
|
||||||
|
|
||||||
@@ -121,7 +122,9 @@ namespace TestCaseTracking {
|
|||||||
bool isSuccessfullyCompleted() const override;
|
bool isSuccessfullyCompleted() const override;
|
||||||
bool isOpen() const override;
|
bool isOpen() const override;
|
||||||
bool hasChildren() const override;
|
bool hasChildren() const override;
|
||||||
|
bool hasStarted() const override {
|
||||||
|
return m_runState != NotStarted;
|
||||||
|
}
|
||||||
|
|
||||||
void addChild( ITrackerPtr const& child ) override;
|
void addChild( ITrackerPtr const& child ) override;
|
||||||
|
|
||||||
@@ -160,6 +163,10 @@ namespace TestCaseTracking {
|
|||||||
|
|
||||||
void addInitialFilters( std::vector<std::string> const& filters );
|
void addInitialFilters( std::vector<std::string> const& filters );
|
||||||
void addNextFilters( std::vector<std::string> const& filters );
|
void addNextFilters( std::vector<std::string> const& filters );
|
||||||
|
//! Returns filters active in this tracker
|
||||||
|
std::vector<std::string> const& getFilters() const;
|
||||||
|
//! Returns whitespace-trimmed name of the tracked section
|
||||||
|
std::string const& trimmedName() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace TestCaseTracking
|
} // namespace TestCaseTracking
|
||||||
|
@@ -160,7 +160,7 @@ struct AutoReg : NonCopyable {
|
|||||||
int index = 0; \
|
int index = 0; \
|
||||||
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
|
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
|
||||||
using expander = int[];\
|
using expander = int[];\
|
||||||
(void)expander{(reg_test(Types{}, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++, 0)... };/* NOLINT */ \
|
(void)expander{(reg_test(Types{}, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++)... };/* NOLINT */ \
|
||||||
}\
|
}\
|
||||||
};\
|
};\
|
||||||
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
|
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
|
||||||
@@ -206,7 +206,7 @@ struct AutoReg : NonCopyable {
|
|||||||
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
|
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
|
||||||
constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\
|
constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\
|
||||||
constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\
|
constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\
|
||||||
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFuncName<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++, 0)... };/* NOLINT */\
|
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFuncName<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++)... };/* NOLINT */\
|
||||||
} \
|
} \
|
||||||
}; \
|
}; \
|
||||||
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \
|
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \
|
||||||
@@ -250,7 +250,7 @@ struct AutoReg : NonCopyable {
|
|||||||
void reg_tests() { \
|
void reg_tests() { \
|
||||||
int index = 0; \
|
int index = 0; \
|
||||||
using expander = int[]; \
|
using expander = int[]; \
|
||||||
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFunc<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++, 0)... };/* NOLINT */\
|
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFunc<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++)... };/* NOLINT */\
|
||||||
} \
|
} \
|
||||||
};\
|
};\
|
||||||
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \
|
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \
|
||||||
@@ -285,7 +285,7 @@ struct AutoReg : NonCopyable {
|
|||||||
int index = 0; \
|
int index = 0; \
|
||||||
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
|
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
|
||||||
using expander = int[];\
|
using expander = int[];\
|
||||||
(void)expander{(reg_test(Types{}, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++, 0)... };/* NOLINT */ \
|
(void)expander{(reg_test(Types{}, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++)... };/* NOLINT */ \
|
||||||
}\
|
}\
|
||||||
};\
|
};\
|
||||||
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
|
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
|
||||||
@@ -334,7 +334,7 @@ struct AutoReg : NonCopyable {
|
|||||||
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
|
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
|
||||||
constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\
|
constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\
|
||||||
constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\
|
constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\
|
||||||
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++, 0)... };/* NOLINT */ \
|
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++)... };/* NOLINT */ \
|
||||||
}\
|
}\
|
||||||
};\
|
};\
|
||||||
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
|
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
|
||||||
@@ -381,7 +381,7 @@ struct AutoReg : NonCopyable {
|
|||||||
void reg_tests(){\
|
void reg_tests(){\
|
||||||
int index = 0;\
|
int index = 0;\
|
||||||
using expander = int[];\
|
using expander = int[];\
|
||||||
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++, 0)... };/* NOLINT */ \
|
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++)... };/* NOLINT */ \
|
||||||
}\
|
}\
|
||||||
};\
|
};\
|
||||||
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
|
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
|
||||||
|
@@ -309,8 +309,8 @@ namespace Catch {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace Detail {
|
namespace Detail {
|
||||||
template<typename InputIterator>
|
template<typename InputIterator, typename Sentinel = InputIterator>
|
||||||
std::string rangeToString(InputIterator first, InputIterator last) {
|
std::string rangeToString(InputIterator first, Sentinel last) {
|
||||||
ReusableStringStream rss;
|
ReusableStringStream rss;
|
||||||
rss << "{ ";
|
rss << "{ ";
|
||||||
if (first != last) {
|
if (first != last) {
|
||||||
|
@@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
#include "catch_compiler_capabilities.h"
|
#include "catch_compiler_capabilities.h"
|
||||||
#include "catch_uncaught_exceptions.h"
|
#include "catch_uncaught_exceptions.h"
|
||||||
|
#include "catch_config_uncaught_exceptions.hpp"
|
||||||
|
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
|
||||||
namespace Catch {
|
namespace Catch {
|
||||||
|
@@ -37,7 +37,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Version const& libraryVersion() {
|
Version const& libraryVersion() {
|
||||||
static Version version( 2, 12, 4, "", 0 );
|
static Version version( 2, 13, 3, "", 0 );
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -41,6 +41,17 @@ namespace Catch {
|
|||||||
return std::string(buffer);
|
return std::string(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool shouldShowDuration( IConfig const& config, double duration ) {
|
||||||
|
if ( config.showDurations() == ShowDurations::Always ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if ( config.showDurations() == ShowDurations::Never ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const double min = config.minDuration();
|
||||||
|
return min >= 0 && duration >= min;
|
||||||
|
}
|
||||||
|
|
||||||
std::string serializeFilters( std::vector<std::string> const& container ) {
|
std::string serializeFilters( std::vector<std::string> const& container ) {
|
||||||
ReusableStringStream oss;
|
ReusableStringStream oss;
|
||||||
bool first = true;
|
bool first = true;
|
||||||
|
@@ -25,6 +25,9 @@ namespace Catch {
|
|||||||
// Returns double formatted as %.3f (format expected on output)
|
// Returns double formatted as %.3f (format expected on output)
|
||||||
std::string getFormattedDuration( double duration );
|
std::string getFormattedDuration( double duration );
|
||||||
|
|
||||||
|
//! Should the reporter show
|
||||||
|
bool shouldShowDuration( IConfig const& config, double duration );
|
||||||
|
|
||||||
std::string serializeFilters( std::vector<std::string> const& container );
|
std::string serializeFilters( std::vector<std::string> const& container );
|
||||||
|
|
||||||
template<typename DerivedT>
|
template<typename DerivedT>
|
||||||
|
@@ -245,10 +245,6 @@ private:
|
|||||||
return "Reports test results on a single line, suitable for IDEs";
|
return "Reports test results on a single line, suitable for IDEs";
|
||||||
}
|
}
|
||||||
|
|
||||||
ReporterPreferences CompactReporter::getPreferences() const {
|
|
||||||
return m_reporterPrefs;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CompactReporter::noMatchingTestCases( std::string const& spec ) {
|
void CompactReporter::noMatchingTestCases( std::string const& spec ) {
|
||||||
stream << "No test cases matched '" << spec << '\'' << std::endl;
|
stream << "No test cases matched '" << spec << '\'' << std::endl;
|
||||||
}
|
}
|
||||||
@@ -275,8 +271,9 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CompactReporter::sectionEnded(SectionStats const& _sectionStats) {
|
void CompactReporter::sectionEnded(SectionStats const& _sectionStats) {
|
||||||
if (m_config->showDurations() == ShowDurations::Always) {
|
double dur = _sectionStats.durationInSeconds;
|
||||||
stream << getFormattedDuration(_sectionStats.durationInSeconds) << " s: " << _sectionStats.sectionInfo.name << std::endl;
|
if ( shouldShowDuration( *m_config, dur ) ) {
|
||||||
|
stream << getFormattedDuration( dur ) << " s: " << _sectionStats.sectionInfo.name << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -22,8 +22,6 @@ namespace Catch {
|
|||||||
|
|
||||||
static std::string getDescription();
|
static std::string getDescription();
|
||||||
|
|
||||||
ReporterPreferences getPreferences() const override;
|
|
||||||
|
|
||||||
void noMatchingTestCases(std::string const& spec) override;
|
void noMatchingTestCases(std::string const& spec) override;
|
||||||
|
|
||||||
void assertionStarting(AssertionInfo const&) override;
|
void assertionStarting(AssertionInfo const&) override;
|
||||||
|
@@ -418,8 +418,9 @@ void ConsoleReporter::sectionEnded(SectionStats const& _sectionStats) {
|
|||||||
stream << "\nNo assertions in test case";
|
stream << "\nNo assertions in test case";
|
||||||
stream << " '" << _sectionStats.sectionInfo.name << "'\n" << std::endl;
|
stream << " '" << _sectionStats.sectionInfo.name << "'\n" << std::endl;
|
||||||
}
|
}
|
||||||
if (m_config->showDurations() == ShowDurations::Always) {
|
double dur = _sectionStats.durationInSeconds;
|
||||||
stream << getFormattedDuration(_sectionStats.durationInSeconds) << " s: " << _sectionStats.sectionInfo.name << std::endl;
|
if (shouldShowDuration(*m_config, dur)) {
|
||||||
|
stream << getFormattedDuration(dur) << " s: " << _sectionStats.sectionInfo.name << std::endl;
|
||||||
}
|
}
|
||||||
if (m_headerPrinted) {
|
if (m_headerPrinted) {
|
||||||
m_headerPrinted = false;
|
m_headerPrinted = false;
|
||||||
|
@@ -23,16 +23,17 @@ namespace Catch {
|
|||||||
|
|
||||||
using StreamingReporterBase::StreamingReporterBase;
|
using StreamingReporterBase::StreamingReporterBase;
|
||||||
|
|
||||||
|
TAPReporter( ReporterConfig const& config ):
|
||||||
|
StreamingReporterBase( config ) {
|
||||||
|
m_reporterPrefs.shouldReportAllAssertions = true;
|
||||||
|
}
|
||||||
|
|
||||||
~TAPReporter() override;
|
~TAPReporter() override;
|
||||||
|
|
||||||
static std::string getDescription() {
|
static std::string getDescription() {
|
||||||
return "Reports test results in TAP format, suitable for test harnesses";
|
return "Reports test results in TAP format, suitable for test harnesses";
|
||||||
}
|
}
|
||||||
|
|
||||||
ReporterPreferences getPreferences() const override {
|
|
||||||
return m_reporterPrefs;
|
|
||||||
}
|
|
||||||
|
|
||||||
void noMatchingTestCases( std::string const& spec ) override {
|
void noMatchingTestCases( std::string const& spec ) override {
|
||||||
stream << "# No test cases matched '" << spec << "'" << std::endl;
|
stream << "# No test cases matched '" << spec << "'" << std::endl;
|
||||||
}
|
}
|
||||||
@@ -203,16 +204,15 @@ namespace Catch {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// using messages.end() directly (or auto) yields compilation error:
|
const auto itEnd = messages.cend();
|
||||||
std::vector<MessageInfo>::const_iterator itEnd = messages.end();
|
const auto N = static_cast<std::size_t>( std::distance( itMessage, itEnd ) );
|
||||||
const std::size_t N = static_cast<std::size_t>( std::distance( itMessage, itEnd ) );
|
|
||||||
|
|
||||||
{
|
{
|
||||||
Colour colourGuard( colour );
|
Colour colourGuard( colour );
|
||||||
stream << " with " << pluralise( N, "message" ) << ":";
|
stream << " with " << pluralise( N, "message" ) << ":";
|
||||||
}
|
}
|
||||||
|
|
||||||
for(; itMessage != itEnd; ) {
|
while( itMessage != itEnd ) {
|
||||||
// If this assertion is a warning ignore any INFO messages
|
// If this assertion is a warning ignore any INFO messages
|
||||||
if( printInfoMessages || itMessage->type != ResultWas::Info ) {
|
if( printInfoMessages || itMessage->type != ResultWas::Info ) {
|
||||||
stream << " '" << itMessage->message << "'";
|
stream << " '" << itMessage->message << "'";
|
||||||
@@ -220,7 +220,9 @@ namespace Catch {
|
|||||||
Colour colourGuard( dimColour() );
|
Colour colourGuard( dimColour() );
|
||||||
stream << " and";
|
stream << " and";
|
||||||
}
|
}
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
++itMessage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,10 +236,9 @@ namespace Catch {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void printTotals( const Totals& totals ) const {
|
void printTotals( const Totals& totals ) const {
|
||||||
|
stream << "1.." << totals.assertions.total();
|
||||||
if( totals.testCases.total() == 0 ) {
|
if( totals.testCases.total() == 0 ) {
|
||||||
stream << "1..0 # Skipped: No tests ran.";
|
stream << " # Skipped: No tests ran.";
|
||||||
} else {
|
|
||||||
stream << "1.." << counter;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -27,6 +27,7 @@ set(TEST_SOURCES
|
|||||||
${SELF_TEST_DIR}/IntrospectiveTests/StringManip.tests.cpp
|
${SELF_TEST_DIR}/IntrospectiveTests/StringManip.tests.cpp
|
||||||
${SELF_TEST_DIR}/IntrospectiveTests/Xml.tests.cpp
|
${SELF_TEST_DIR}/IntrospectiveTests/Xml.tests.cpp
|
||||||
${SELF_TEST_DIR}/IntrospectiveTests/ToString.tests.cpp
|
${SELF_TEST_DIR}/IntrospectiveTests/ToString.tests.cpp
|
||||||
|
${SELF_TEST_DIR}/TimingTests/Sleep.tests.cpp
|
||||||
${SELF_TEST_DIR}/UsageTests/Approx.tests.cpp
|
${SELF_TEST_DIR}/UsageTests/Approx.tests.cpp
|
||||||
${SELF_TEST_DIR}/UsageTests/BDD.tests.cpp
|
${SELF_TEST_DIR}/UsageTests/BDD.tests.cpp
|
||||||
${SELF_TEST_DIR}/UsageTests/Benchmark.tests.cpp
|
${SELF_TEST_DIR}/UsageTests/Benchmark.tests.cpp
|
||||||
@@ -123,6 +124,7 @@ set(INTERNAL_HEADERS
|
|||||||
${HEADER_DIR}/internal/catch_common.h
|
${HEADER_DIR}/internal/catch_common.h
|
||||||
${HEADER_DIR}/internal/catch_compiler_capabilities.h
|
${HEADER_DIR}/internal/catch_compiler_capabilities.h
|
||||||
${HEADER_DIR}/internal/catch_config.hpp
|
${HEADER_DIR}/internal/catch_config.hpp
|
||||||
|
${HEADER_DIR}/internal/catch_config_uncaught_exceptions.hpp
|
||||||
${HEADER_DIR}/internal/catch_console_colour.h
|
${HEADER_DIR}/internal/catch_console_colour.h
|
||||||
${HEADER_DIR}/internal/catch_context.h
|
${HEADER_DIR}/internal/catch_context.h
|
||||||
${HEADER_DIR}/internal/catch_debug_console.h
|
${HEADER_DIR}/internal/catch_debug_console.h
|
||||||
@@ -417,6 +419,33 @@ set_tests_properties(FilteredSection-1 PROPERTIES FAIL_REGULAR_EXPRESSION "No te
|
|||||||
add_test(NAME FilteredSection-2 COMMAND $<TARGET_FILE:SelfTest> \#1394\ nested -c NestedRunSection -c s1)
|
add_test(NAME FilteredSection-2 COMMAND $<TARGET_FILE:SelfTest> \#1394\ nested -c NestedRunSection -c s1)
|
||||||
set_tests_properties(FilteredSection-2 PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran")
|
set_tests_properties(FilteredSection-2 PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran")
|
||||||
|
|
||||||
|
add_test(
|
||||||
|
NAME
|
||||||
|
FilteredSection::GeneratorsDontCauseInfiniteLoop-1
|
||||||
|
COMMAND
|
||||||
|
$<TARGET_FILE:SelfTest> "#2025: original repro" -c "fov_0"
|
||||||
|
)
|
||||||
|
set_tests_properties(FilteredSection::GeneratorsDontCauseInfiniteLoop-1
|
||||||
|
PROPERTIES
|
||||||
|
PASS_REGULAR_EXPRESSION "inside with fov: 0" # This should happen
|
||||||
|
FAIL_REGULAR_EXPRESSION "inside with fov: 1" # This would mean there was no filtering
|
||||||
|
)
|
||||||
|
|
||||||
|
# GENERATE between filtered sections (both are selected)
|
||||||
|
add_test(
|
||||||
|
NAME
|
||||||
|
FilteredSection::GeneratorsDontCauseInfiniteLoop-2
|
||||||
|
COMMAND
|
||||||
|
$<TARGET_FILE:SelfTest> "#2025: same-level sections"
|
||||||
|
-c "A"
|
||||||
|
-c "B"
|
||||||
|
)
|
||||||
|
set_tests_properties(FilteredSection::GeneratorsDontCauseInfiniteLoop-2
|
||||||
|
PROPERTIES
|
||||||
|
PASS_REGULAR_EXPRESSION "All tests passed \\(4 assertions in 1 test case\\)"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# AppVeyor has a Python 2.7 in path, but doesn't have .py files as autorunnable
|
# AppVeyor has a Python 2.7 in path, but doesn't have .py files as autorunnable
|
||||||
add_test(NAME ApprovalTests COMMAND ${PYTHON_EXECUTABLE} ${CATCH_DIR}/scripts/approvalTests.py $<TARGET_FILE:SelfTest>)
|
add_test(NAME ApprovalTests COMMAND ${PYTHON_EXECUTABLE} ${CATCH_DIR}/scripts/approvalTests.py $<TARGET_FILE:SelfTest>)
|
||||||
set_tests_properties(ApprovalTests PROPERTIES FAIL_REGULAR_EXPRESSION "Results differed")
|
set_tests_properties(ApprovalTests PROPERTIES FAIL_REGULAR_EXPRESSION "Results differed")
|
||||||
|
@@ -10,6 +10,40 @@ project( Catch2ExtraTests LANGUAGES CXX )
|
|||||||
|
|
||||||
message( STATUS "Extra tests included" )
|
message( STATUS "Extra tests included" )
|
||||||
|
|
||||||
|
# The MinDuration reporting tests do not need separate compilation, but
|
||||||
|
# they have non-trivial execution time, so they are categorized as
|
||||||
|
# extra tests, so that they are run less.
|
||||||
|
add_test(NAME MinDuration::SimpleThreshold COMMAND $<TARGET_FILE:SelfTest> --min-duration 0.22 [min_duration_test])
|
||||||
|
set_tests_properties(
|
||||||
|
MinDuration::SimpleThreshold
|
||||||
|
PROPERTIES
|
||||||
|
PASS_REGULAR_EXPRESSION "s: sleep_for_250ms"
|
||||||
|
FAIL_REGULAR_EXPRESSION "sleep_for_100ms"
|
||||||
|
RUN_SERIAL ON # The test is timing sensitive, so we want to run it
|
||||||
|
# serially to avoid false positives on oversubscribed machines
|
||||||
|
)
|
||||||
|
|
||||||
|
# -d yes overrides the threshold, so we should see the faster test even
|
||||||
|
# with a ridiculous high min duration threshold
|
||||||
|
add_test(NAME MinDuration::DurationOverrideYes COMMAND $<TARGET_FILE:SelfTest> --min-duration 1.0 -d yes [min_duration_test])
|
||||||
|
set_tests_properties(
|
||||||
|
MinDuration::DurationOverrideYes
|
||||||
|
PROPERTIES
|
||||||
|
PASS_REGULAR_EXPRESSION "s: sleep_for_100ms"
|
||||||
|
)
|
||||||
|
|
||||||
|
# -d no overrides the threshold, so we should never see any tests even
|
||||||
|
# with ridiculously low min duration threshold
|
||||||
|
add_test(NAME MinDuration::DurationOverrideNo COMMAND $<TARGET_FILE:SelfTest> --min-duration 0.0001 -d no [min_duration_test])
|
||||||
|
set_tests_properties(
|
||||||
|
MinDuration::DurationOverrideNo
|
||||||
|
PROPERTIES
|
||||||
|
FAIL_REGULAR_EXPRESSION "sleep_for_250ms"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# ------------ end of duration reporting tests
|
||||||
|
|
||||||
# define folders used:
|
# define folders used:
|
||||||
|
|
||||||
set( TESTS_DIR ${CATCH_DIR}/projects/ExtraTests )
|
set( TESTS_DIR ${CATCH_DIR}/projects/ExtraTests )
|
||||||
|
@@ -36,6 +36,48 @@ Generators.tests.cpp:<line number>: passed: i != j for: 1 != 3
|
|||||||
Generators.tests.cpp:<line number>: passed: i != j for: 1 != 4
|
Generators.tests.cpp:<line number>: passed: i != j for: 1 != 4
|
||||||
Generators.tests.cpp:<line number>: passed: i != j for: 2 != 3
|
Generators.tests.cpp:<line number>: passed: i != j for: 2 != 3
|
||||||
Generators.tests.cpp:<line number>: passed: i != j for: 2 != 4
|
Generators.tests.cpp:<line number>: passed: i != j for: 2 != 4
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: with 1 message: 'A'
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: m for: 1
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: m for: 2
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: m for: 3
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: 1
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: m for: 2
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: m for: 3
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: m for: 1
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: m for: 2
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: m for: 3
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: with 1 message: 'A'
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 1' and 'j := 3' and 'k := 5'
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: with 1 message: 'B'
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 1' and 'j := 3' and 'k := 6'
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: with 1 message: 'B'
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 1' and 'j := 4' and 'k := 5'
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 1' and 'j := 4' and 'k := 6'
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: with 1 message: 'A'
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 2' and 'j := 3' and 'k := 5'
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: with 1 message: 'B'
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 2' and 'j := 3' and 'k := 6'
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: with 1 message: 'B'
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 2' and 'j := 4' and 'k := 5'
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: with 3 messages: 'i := 2' and 'j := 4' and 'k := 6'
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: m for: 1
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: n for: 1
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: m for: 1
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: n for: 2
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: m for: 1
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: n for: 3
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: m for: 2
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: n for: 1
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: m for: 2
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: n for: 2
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: m for: 2
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: n for: 3
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: m for: 3
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: n for: 1
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: m for: 3
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: n for: 2
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: m for: 3
|
||||||
|
PartTracker.tests.cpp:<line number>: passed: n for: 3
|
||||||
Misc.tests.cpp:<line number>: passed:
|
Misc.tests.cpp:<line number>: passed:
|
||||||
Misc.tests.cpp:<line number>: passed:
|
Misc.tests.cpp:<line number>: passed:
|
||||||
Misc.tests.cpp:<line number>: passed:
|
Misc.tests.cpp:<line number>: passed:
|
||||||
@@ -1161,6 +1203,7 @@ CmdLine.tests.cpp:<line number>: passed: config.benchmarkWarmupTime == 10 for: 1
|
|||||||
Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 3 >= 1
|
Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 3 >= 1
|
||||||
Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 2 >= 1
|
Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 2 >= 1
|
||||||
Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 1 >= 1
|
Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 1 >= 1
|
||||||
|
ToString.tests.cpp:<line number>: passed: Catch::Detail::stringify(UsesSentinel{}) == "{ }" for: "{ }" == "{ }"
|
||||||
Decomposition.tests.cpp:<line number>: failed: truthy(false) for: Hey, its truthy!
|
Decomposition.tests.cpp:<line number>: failed: truthy(false) for: Hey, its truthy!
|
||||||
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches("this STRING contains 'abc' as a substring") for: "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively
|
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches("this STRING contains 'abc' as a substring") for: "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively
|
||||||
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches("contains 'abc' as a substring") for: "this string contains 'abc' as a substring" matches "contains 'abc' as a substring" case sensitively
|
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches("contains 'abc' as a substring") for: "this string contains 'abc' as a substring" matches "contains 'abc' as a substring" case sensitively
|
||||||
|
@@ -1380,6 +1380,6 @@ due to unexpected exception with message:
|
|||||||
Why would you throw a std::string?
|
Why would you throw a std::string?
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
test cases: 316 | 242 passed | 70 failed | 4 failed as expected
|
test cases: 322 | 248 passed | 70 failed | 4 failed as expected
|
||||||
assertions: 1716 | 1564 passed | 131 failed | 21 failed as expected
|
assertions: 1759 | 1607 passed | 131 failed | 21 failed as expected
|
||||||
|
|
||||||
|
@@ -309,6 +309,424 @@ Generators.tests.cpp:<line number>: PASSED:
|
|||||||
with expansion:
|
with expansion:
|
||||||
2 != 4
|
2 != 4
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - GENERATE after a section
|
||||||
|
A
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with message:
|
||||||
|
A
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - GENERATE after a section
|
||||||
|
B
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
1
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - GENERATE after a section
|
||||||
|
B
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
2
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - GENERATE after a section
|
||||||
|
B
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
3
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - Section followed by flat generate
|
||||||
|
A
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( 1 )
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - Section followed by flat generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
2
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - Section followed by flat generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
3
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - flat generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
1
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - flat generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
2
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - flat generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
3
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
A
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with message:
|
||||||
|
A
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with messages:
|
||||||
|
i := 1
|
||||||
|
j := 3
|
||||||
|
k := 5
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
B
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with message:
|
||||||
|
B
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with messages:
|
||||||
|
i := 1
|
||||||
|
j := 3
|
||||||
|
k := 6
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
B
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with message:
|
||||||
|
B
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with messages:
|
||||||
|
i := 1
|
||||||
|
j := 4
|
||||||
|
k := 5
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with messages:
|
||||||
|
i := 1
|
||||||
|
j := 4
|
||||||
|
k := 6
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
A
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with message:
|
||||||
|
A
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with messages:
|
||||||
|
i := 2
|
||||||
|
j := 3
|
||||||
|
k := 5
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
B
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with message:
|
||||||
|
B
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with messages:
|
||||||
|
i := 2
|
||||||
|
j := 3
|
||||||
|
k := 6
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
B
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with message:
|
||||||
|
B
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with messages:
|
||||||
|
i := 2
|
||||||
|
j := 4
|
||||||
|
k := 5
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with messages:
|
||||||
|
i := 2
|
||||||
|
j := 4
|
||||||
|
k := 6
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - nested generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
1
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( n )
|
||||||
|
with expansion:
|
||||||
|
1
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - nested generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
1
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( n )
|
||||||
|
with expansion:
|
||||||
|
2
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - nested generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
1
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( n )
|
||||||
|
with expansion:
|
||||||
|
3
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - nested generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
2
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( n )
|
||||||
|
with expansion:
|
||||||
|
1
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - nested generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
2
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( n )
|
||||||
|
with expansion:
|
||||||
|
2
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - nested generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
2
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( n )
|
||||||
|
with expansion:
|
||||||
|
3
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - nested generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
3
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( n )
|
||||||
|
with expansion:
|
||||||
|
1
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - nested generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
3
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( n )
|
||||||
|
with expansion:
|
||||||
|
2
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - nested generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
3
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( n )
|
||||||
|
with expansion:
|
||||||
|
3
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0
|
#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@@ -8477,6 +8895,17 @@ Misc.tests.cpp:<line number>: PASSED:
|
|||||||
with expansion:
|
with expansion:
|
||||||
1 >= 1
|
1 >= 1
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Range type with sentinel
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
ToString.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
ToString.tests.cpp:<line number>: PASSED:
|
||||||
|
CHECK( Catch::Detail::stringify(UsesSentinel{}) == "{ }" )
|
||||||
|
with expansion:
|
||||||
|
"{ }" == "{ }"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Reconstruction should be based on stringification: #914
|
Reconstruction should be based on stringification: #914
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@@ -13709,6 +14138,6 @@ Misc.tests.cpp:<line number>
|
|||||||
Misc.tests.cpp:<line number>: PASSED:
|
Misc.tests.cpp:<line number>: PASSED:
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
test cases: 316 | 226 passed | 86 failed | 4 failed as expected
|
test cases: 322 | 232 passed | 86 failed | 4 failed as expected
|
||||||
assertions: 1733 | 1564 passed | 148 failed | 21 failed as expected
|
assertions: 1776 | 1607 passed | 148 failed | 21 failed as expected
|
||||||
|
|
||||||
|
@@ -309,6 +309,424 @@ Generators.tests.cpp:<line number>: PASSED:
|
|||||||
with expansion:
|
with expansion:
|
||||||
2 != 4
|
2 != 4
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - GENERATE after a section
|
||||||
|
A
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with message:
|
||||||
|
A
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - GENERATE after a section
|
||||||
|
B
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
1
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - GENERATE after a section
|
||||||
|
B
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
2
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - GENERATE after a section
|
||||||
|
B
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
3
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - Section followed by flat generate
|
||||||
|
A
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( 1 )
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - Section followed by flat generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
2
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - Section followed by flat generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
3
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - flat generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
1
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - flat generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
2
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - flat generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
3
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
A
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with message:
|
||||||
|
A
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with messages:
|
||||||
|
i := 1
|
||||||
|
j := 3
|
||||||
|
k := 5
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
B
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with message:
|
||||||
|
B
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with messages:
|
||||||
|
i := 1
|
||||||
|
j := 3
|
||||||
|
k := 6
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
B
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with message:
|
||||||
|
B
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with messages:
|
||||||
|
i := 1
|
||||||
|
j := 4
|
||||||
|
k := 5
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with messages:
|
||||||
|
i := 1
|
||||||
|
j := 4
|
||||||
|
k := 6
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
A
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with message:
|
||||||
|
A
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with messages:
|
||||||
|
i := 2
|
||||||
|
j := 3
|
||||||
|
k := 5
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
B
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with message:
|
||||||
|
B
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with messages:
|
||||||
|
i := 2
|
||||||
|
j := 3
|
||||||
|
k := 6
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
B
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with message:
|
||||||
|
B
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with messages:
|
||||||
|
i := 2
|
||||||
|
j := 4
|
||||||
|
k := 5
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - mixed sections and generates
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
with messages:
|
||||||
|
i := 2
|
||||||
|
j := 4
|
||||||
|
k := 6
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - nested generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
1
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( n )
|
||||||
|
with expansion:
|
||||||
|
1
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - nested generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
1
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( n )
|
||||||
|
with expansion:
|
||||||
|
2
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - nested generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
1
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( n )
|
||||||
|
with expansion:
|
||||||
|
3
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - nested generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
2
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( n )
|
||||||
|
with expansion:
|
||||||
|
1
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - nested generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
2
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( n )
|
||||||
|
with expansion:
|
||||||
|
2
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - nested generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
2
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( n )
|
||||||
|
with expansion:
|
||||||
|
3
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - nested generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
3
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( n )
|
||||||
|
with expansion:
|
||||||
|
1
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - nested generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
3
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( n )
|
||||||
|
with expansion:
|
||||||
|
2
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
#1938 - nested generate
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
PartTracker.tests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( m )
|
||||||
|
with expansion:
|
||||||
|
3
|
||||||
|
|
||||||
|
PartTracker.tests.cpp:<line number>: PASSED:
|
||||||
|
REQUIRE( n )
|
||||||
|
with expansion:
|
||||||
|
3
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0
|
#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@@ -513,6 +931,6 @@ Condition.tests.cpp:<line number>: FAILED:
|
|||||||
CHECK( true != true )
|
CHECK( true != true )
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
test cases: 26 | 21 passed | 3 failed | 2 failed as expected
|
test cases: 31 | 26 passed | 3 failed | 2 failed as expected
|
||||||
assertions: 58 | 51 passed | 4 failed | 3 failed as expected
|
assertions: 100 | 93 passed | 4 failed | 3 failed as expected
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<testsuitesloose text artifact
|
<testsuitesloose text artifact
|
||||||
>
|
>
|
||||||
<testsuite name="<exe-name>" errors="17" failures="132" tests="1734" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
|
<testsuite name="<exe-name>" errors="17" failures="132" tests="1777" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
|
||||||
<properties>
|
<properties>
|
||||||
<property name="filters" value="~[!nonportable]~[!benchmark]~[approvals]"/>
|
<property name="filters" value="~[!nonportable]~[!benchmark]~[approvals]"/>
|
||||||
<property name="random-seed" value="1"/>
|
<property name="random-seed" value="1"/>
|
||||||
@@ -35,6 +35,15 @@ Nor would this
|
|||||||
<testcase classname="<exe-name>.global" name="#1912 -- test spec parser handles escaping/backslash in test name" time="{duration}" status="run"/>
|
<testcase classname="<exe-name>.global" name="#1912 -- test spec parser handles escaping/backslash in test name" time="{duration}" status="run"/>
|
||||||
<testcase classname="<exe-name>.global" name="#1913 - GENERATE inside a for loop should not keep recreating the generator" time="{duration}" status="run"/>
|
<testcase classname="<exe-name>.global" name="#1913 - GENERATE inside a for loop should not keep recreating the generator" time="{duration}" status="run"/>
|
||||||
<testcase classname="<exe-name>.global" name="#1913 - GENERATEs can share a line" time="{duration}" status="run"/>
|
<testcase classname="<exe-name>.global" name="#1913 - GENERATEs can share a line" time="{duration}" status="run"/>
|
||||||
|
<testcase classname="<exe-name>.global" name="#1938 - GENERATE after a section/A" time="{duration}" status="run"/>
|
||||||
|
<testcase classname="<exe-name>.global" name="#1938 - GENERATE after a section/B" time="{duration}" status="run"/>
|
||||||
|
<testcase classname="<exe-name>.global" name="#1938 - Section followed by flat generate" time="{duration}" status="run"/>
|
||||||
|
<testcase classname="<exe-name>.global" name="#1938 - Section followed by flat generate/A" time="{duration}" status="run"/>
|
||||||
|
<testcase classname="<exe-name>.global" name="#1938 - flat generate" time="{duration}" status="run"/>
|
||||||
|
<testcase classname="<exe-name>.global" name="#1938 - mixed sections and generates" time="{duration}" status="run"/>
|
||||||
|
<testcase classname="<exe-name>.global" name="#1938 - mixed sections and generates/A" time="{duration}" status="run"/>
|
||||||
|
<testcase classname="<exe-name>.global" name="#1938 - mixed sections and generates/B" time="{duration}" status="run"/>
|
||||||
|
<testcase classname="<exe-name>.global" name="#1938 - nested generate" time="{duration}" status="run"/>
|
||||||
<testcase classname="<exe-name>.global" name="#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0" time="{duration}" status="run"/>
|
<testcase classname="<exe-name>.global" name="#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0" time="{duration}" status="run"/>
|
||||||
<testcase classname="<exe-name>.global" name="#1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0" time="{duration}" status="run"/>
|
<testcase classname="<exe-name>.global" name="#1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0" time="{duration}" status="run"/>
|
||||||
<testcase classname="<exe-name>.global" name="#1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0" time="{duration}" status="run"/>
|
<testcase classname="<exe-name>.global" name="#1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0" time="{duration}" status="run"/>
|
||||||
@@ -1036,6 +1045,7 @@ Message.tests.cpp:<line number>
|
|||||||
<testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple<int, double, float>" time="{duration}" status="run"/>
|
<testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple<int, double, float>" time="{duration}" status="run"/>
|
||||||
<testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple<int, double>" time="{duration}" status="run"/>
|
<testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple<int, double>" time="{duration}" status="run"/>
|
||||||
<testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple<int>" time="{duration}" status="run"/>
|
<testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple<int>" time="{duration}" status="run"/>
|
||||||
|
<testcase classname="<exe-name>.global" name="Range type with sentinel" time="{duration}" status="run"/>
|
||||||
<testcase classname="<exe-name>.global" name="Reconstruction should be based on stringification: #914" time="{duration}" status="run">
|
<testcase classname="<exe-name>.global" name="Reconstruction should be based on stringification: #914" time="{duration}" status="run">
|
||||||
<failure message="truthy(false)" type="CHECK">
|
<failure message="truthy(false)" type="CHECK">
|
||||||
FAILED:
|
FAILED:
|
||||||
|
@@ -99,6 +99,15 @@
|
|||||||
<testCase name="Generators internals/Range/Negative manual step/Integer/Slightly under end" duration="{duration}"/>
|
<testCase name="Generators internals/Range/Negative manual step/Integer/Slightly under end" duration="{duration}"/>
|
||||||
</file>
|
</file>
|
||||||
<file path="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp">
|
<file path="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp">
|
||||||
|
<testCase name="#1938 - GENERATE after a section/A" duration="{duration}"/>
|
||||||
|
<testCase name="#1938 - GENERATE after a section/B" duration="{duration}"/>
|
||||||
|
<testCase name="#1938 - Section followed by flat generate" duration="{duration}"/>
|
||||||
|
<testCase name="#1938 - Section followed by flat generate/A" duration="{duration}"/>
|
||||||
|
<testCase name="#1938 - flat generate" duration="{duration}"/>
|
||||||
|
<testCase name="#1938 - mixed sections and generates" duration="{duration}"/>
|
||||||
|
<testCase name="#1938 - mixed sections and generates/A" duration="{duration}"/>
|
||||||
|
<testCase name="#1938 - mixed sections and generates/B" duration="{duration}"/>
|
||||||
|
<testCase name="#1938 - nested generate" duration="{duration}"/>
|
||||||
<testCase name="Tracker" duration="{duration}"/>
|
<testCase name="Tracker" duration="{duration}"/>
|
||||||
<testCase name="Tracker/successfully close one section" duration="{duration}"/>
|
<testCase name="Tracker/successfully close one section" duration="{duration}"/>
|
||||||
<testCase name="Tracker/fail one section" duration="{duration}"/>
|
<testCase name="Tracker/fail one section" duration="{duration}"/>
|
||||||
@@ -153,6 +162,7 @@
|
|||||||
</file>
|
</file>
|
||||||
<file path="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp">
|
<file path="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp">
|
||||||
<testCase name="Directly creating an EnumInfo" duration="{duration}"/>
|
<testCase name="Directly creating an EnumInfo" duration="{duration}"/>
|
||||||
|
<testCase name="Range type with sentinel" duration="{duration}"/>
|
||||||
<testCase name="parseEnums/No enums" duration="{duration}"/>
|
<testCase name="parseEnums/No enums" duration="{duration}"/>
|
||||||
<testCase name="parseEnums/One enum value" duration="{duration}"/>
|
<testCase name="parseEnums/One enum value" duration="{duration}"/>
|
||||||
<testCase name="parseEnums/Multiple enum values" duration="{duration}"/>
|
<testCase name="parseEnums/Multiple enum values" duration="{duration}"/>
|
||||||
|
@@ -318,6 +318,342 @@ Nor would this
|
|||||||
</Expression>
|
</Expression>
|
||||||
<OverallResult success="true"/>
|
<OverallResult success="true"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
|
<TestCase name="#1938 - GENERATE after a section" tags="[!hide][.][generators][regression]" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Section name="A" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||||
|
</Section>
|
||||||
|
<Section name="B" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
m
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
1
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||||
|
</Section>
|
||||||
|
<Section name="B" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
m
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
2
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||||
|
</Section>
|
||||||
|
<Section name="B" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
m
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
3
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||||
|
</Section>
|
||||||
|
<OverallResult success="true"/>
|
||||||
|
</TestCase>
|
||||||
|
<TestCase name="#1938 - Section followed by flat generate" tags="[!hide][.][generators][regression]" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Section name="A" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
1
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
1
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||||
|
</Section>
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
m
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
2
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
m
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
3
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<OverallResult success="true"/>
|
||||||
|
</TestCase>
|
||||||
|
<TestCase name="#1938 - flat generate" tags="[!hide][.][generators][regression]" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
m
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
1
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
m
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
2
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
m
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
3
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<OverallResult success="true"/>
|
||||||
|
</TestCase>
|
||||||
|
<TestCase name="#1938 - mixed sections and generates" tags="[!hide][.][generators][regression]" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Section name="A" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||||
|
</Section>
|
||||||
|
<Info>
|
||||||
|
i := 1
|
||||||
|
</Info>
|
||||||
|
<Info>
|
||||||
|
j := 3
|
||||||
|
</Info>
|
||||||
|
<Info>
|
||||||
|
k := 5
|
||||||
|
</Info>
|
||||||
|
<Section name="B" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||||
|
</Section>
|
||||||
|
<Info>
|
||||||
|
i := 1
|
||||||
|
</Info>
|
||||||
|
<Info>
|
||||||
|
j := 3
|
||||||
|
</Info>
|
||||||
|
<Info>
|
||||||
|
k := 6
|
||||||
|
</Info>
|
||||||
|
<Section name="B" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||||
|
</Section>
|
||||||
|
<Info>
|
||||||
|
i := 1
|
||||||
|
</Info>
|
||||||
|
<Info>
|
||||||
|
j := 4
|
||||||
|
</Info>
|
||||||
|
<Info>
|
||||||
|
k := 5
|
||||||
|
</Info>
|
||||||
|
<Info>
|
||||||
|
i := 1
|
||||||
|
</Info>
|
||||||
|
<Info>
|
||||||
|
j := 4
|
||||||
|
</Info>
|
||||||
|
<Info>
|
||||||
|
k := 6
|
||||||
|
</Info>
|
||||||
|
<Section name="A" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||||
|
</Section>
|
||||||
|
<Info>
|
||||||
|
i := 2
|
||||||
|
</Info>
|
||||||
|
<Info>
|
||||||
|
j := 3
|
||||||
|
</Info>
|
||||||
|
<Info>
|
||||||
|
k := 5
|
||||||
|
</Info>
|
||||||
|
<Section name="B" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||||
|
</Section>
|
||||||
|
<Info>
|
||||||
|
i := 2
|
||||||
|
</Info>
|
||||||
|
<Info>
|
||||||
|
j := 3
|
||||||
|
</Info>
|
||||||
|
<Info>
|
||||||
|
k := 6
|
||||||
|
</Info>
|
||||||
|
<Section name="B" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||||
|
</Section>
|
||||||
|
<Info>
|
||||||
|
i := 2
|
||||||
|
</Info>
|
||||||
|
<Info>
|
||||||
|
j := 4
|
||||||
|
</Info>
|
||||||
|
<Info>
|
||||||
|
k := 5
|
||||||
|
</Info>
|
||||||
|
<Info>
|
||||||
|
i := 2
|
||||||
|
</Info>
|
||||||
|
<Info>
|
||||||
|
j := 4
|
||||||
|
</Info>
|
||||||
|
<Info>
|
||||||
|
k := 6
|
||||||
|
</Info>
|
||||||
|
<OverallResult success="true"/>
|
||||||
|
</TestCase>
|
||||||
|
<TestCase name="#1938 - nested generate" tags="[!hide][.][generators][regression]" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
m
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
1
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
n
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
1
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
m
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
1
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
n
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
2
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
m
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
1
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
n
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
3
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
m
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
2
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
n
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
1
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
m
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
2
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
n
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
2
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
m
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
2
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
n
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
3
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
m
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
3
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
n
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
1
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
m
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
3
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
n
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
2
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
m
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
3
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
n
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
3
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<OverallResult success="true"/>
|
||||||
|
</TestCase>
|
||||||
<TestCase name="#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0" tags="[!hide][.][compilation][regression]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
<TestCase name="#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0" tags="[!hide][.][compilation][regression]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
||||||
<OverallResult success="true"/>
|
<OverallResult success="true"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
@@ -10626,6 +10962,17 @@ Nor would this
|
|||||||
</Expression>
|
</Expression>
|
||||||
<OverallResult success="true"/>
|
<OverallResult success="true"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
|
<TestCase name="Range type with sentinel" filename="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
|
||||||
|
<Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
|
||||||
|
<Original>
|
||||||
|
Catch::Detail::stringify(UsesSentinel{}) == "{ }"
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
"{ }" == "{ }"
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<OverallResult success="true"/>
|
||||||
|
</TestCase>
|
||||||
<TestCase name="Reconstruction should be based on stringification: #914" tags="[!hide][.][Decomposition][failing]" filename="projects/<exe-name>/UsageTests/Decomposition.tests.cpp" >
|
<TestCase name="Reconstruction should be based on stringification: #914" tags="[!hide][.][Decomposition][failing]" filename="projects/<exe-name>/UsageTests/Decomposition.tests.cpp" >
|
||||||
<Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Decomposition.tests.cpp" >
|
<Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Decomposition.tests.cpp" >
|
||||||
<Original>
|
<Original>
|
||||||
@@ -16375,9 +16722,9 @@ loose text artifact
|
|||||||
</Section>
|
</Section>
|
||||||
<OverallResult success="true"/>
|
<OverallResult success="true"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
<OverallResults successes="1564" failures="149" expectedFailures="21"/>
|
<OverallResults successes="1607" failures="149" expectedFailures="21"/>
|
||||||
<OverallResultsCases successes="226" failures="86" expectedFailures="4"/>
|
<OverallResultsCases successes="232" failures="86" expectedFailures="4"/>
|
||||||
</Group>
|
</Group>
|
||||||
<OverallResults successes="1564" failures="148" expectedFailures="21"/>
|
<OverallResults successes="1607" failures="148" expectedFailures="21"/>
|
||||||
<OverallResultsCases successes="226" failures="86" expectedFailures="4"/>
|
<OverallResultsCases successes="232" failures="86" expectedFailures="4"/>
|
||||||
</Catch>
|
</Catch>
|
||||||
|
@@ -204,3 +204,50 @@ TEST_CASE("#1670 regression check", "[.approvals][tracker]") {
|
|||||||
SECTION("2") SUCCEED();
|
SECTION("2") SUCCEED();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// #1938 required a rework on how generator tracking works, so that `GENERATE`
|
||||||
|
// supports being sandwiched between two `SECTION`s. The following tests check
|
||||||
|
// various other scenarios through checking output in approval tests.
|
||||||
|
TEST_CASE("#1938 - GENERATE after a section", "[.][regression][generators]") {
|
||||||
|
SECTION("A") {
|
||||||
|
SUCCEED("A");
|
||||||
|
}
|
||||||
|
auto m = GENERATE(1, 2, 3);
|
||||||
|
SECTION("B") {
|
||||||
|
REQUIRE(m);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_CASE("#1938 - flat generate", "[.][regression][generators]") {
|
||||||
|
auto m = GENERATE(1, 2, 3);
|
||||||
|
REQUIRE(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_CASE("#1938 - nested generate", "[.][regression][generators]") {
|
||||||
|
auto m = GENERATE(1, 2, 3);
|
||||||
|
auto n = GENERATE(1, 2, 3);
|
||||||
|
REQUIRE(m);
|
||||||
|
REQUIRE(n);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_CASE("#1938 - mixed sections and generates", "[.][regression][generators]") {
|
||||||
|
auto i = GENERATE(1, 2);
|
||||||
|
SECTION("A") {
|
||||||
|
SUCCEED("A");
|
||||||
|
}
|
||||||
|
auto j = GENERATE(3, 4);
|
||||||
|
SECTION("B") {
|
||||||
|
SUCCEED("B");
|
||||||
|
}
|
||||||
|
auto k = GENERATE(5, 6);
|
||||||
|
CAPTURE(i, j, k);
|
||||||
|
SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_CASE("#1938 - Section followed by flat generate", "[.][regression][generators]") {
|
||||||
|
SECTION("A") {
|
||||||
|
REQUIRE(1);
|
||||||
|
}
|
||||||
|
auto m = GENERATE(2, 3);
|
||||||
|
REQUIRE(m);
|
||||||
|
}
|
||||||
|
@@ -4,6 +4,13 @@
|
|||||||
|
|
||||||
enum class EnumClass3 { Value1, Value2, Value3, Value4 };
|
enum class EnumClass3 { Value1, Value2, Value3, Value4 };
|
||||||
|
|
||||||
|
struct UsesSentinel {
|
||||||
|
using const_iterator = int const*;
|
||||||
|
using const_sentinel = std::nullptr_t;
|
||||||
|
|
||||||
|
const_iterator begin() const { return nullptr; }
|
||||||
|
const_iterator end() const { return nullptr; }
|
||||||
|
};
|
||||||
|
|
||||||
TEST_CASE( "parseEnums", "[Strings][enums]" ) {
|
TEST_CASE( "parseEnums", "[Strings][enums]" ) {
|
||||||
using namespace Catch::Matchers;
|
using namespace Catch::Matchers;
|
||||||
@@ -40,3 +47,7 @@ TEST_CASE( "Directly creating an EnumInfo" ) {
|
|||||||
CHECK( enumInfo->lookup(1) == "Value2" );
|
CHECK( enumInfo->lookup(1) == "Value2" );
|
||||||
CHECK( enumInfo->lookup(3) == "{** unexpected enum value **}" );
|
CHECK( enumInfo->lookup(3) == "{** unexpected enum value **}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE("Range type with sentinel") {
|
||||||
|
CHECK( Catch::Detail::stringify(UsesSentinel{}) == "{ }" );
|
||||||
|
}
|
23
projects/SelfTest/TimingTests/Sleep.tests.cpp
Normal file
23
projects/SelfTest/TimingTests/Sleep.tests.cpp
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
|
||||||
|
*
|
||||||
|
* Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "catch.hpp"
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
#include <thread>
|
||||||
|
|
||||||
|
TEST_CASE( "sleep_for_100ms", "[.min_duration_test][approvals]" )
|
||||||
|
{
|
||||||
|
std::this_thread::sleep_for( std::chrono::milliseconds( 100 ) );
|
||||||
|
CHECK( true );
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_CASE( "sleep_for_250ms", "[.min_duration_test][approvals]" )
|
||||||
|
{
|
||||||
|
std::this_thread::sleep_for( std::chrono::milliseconds( 250 ) );
|
||||||
|
CHECK( true );
|
||||||
|
}
|
@@ -267,6 +267,7 @@ TEST_CASE("#1913 - GENERATEs can share a line", "[regression][generators]") {
|
|||||||
REQUIRE(i != j);
|
REQUIRE(i != j);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
#pragma clang diagnostic pop
|
#pragma clang diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
@@ -402,3 +402,28 @@ TEST_CASE("#1514: stderr/stdout is not captured in tests aborted by an exception
|
|||||||
// FAIL aborts the test by throwing a Catch exception
|
// FAIL aborts the test by throwing a Catch exception
|
||||||
FAIL("1514");
|
FAIL("1514");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
TEST_CASE( "#2025: -c shouldn't cause infinite loop", "[sections][generators][regression][.approvals]" ) {
|
||||||
|
SECTION( "Check cursor from buffer offset" ) {
|
||||||
|
auto bufPos = GENERATE_REF( range( 0, 44 ) );
|
||||||
|
WHEN( "Buffer position is " << bufPos ) { REQUIRE( 1 == 1 ); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_CASE("#2025: original repro", "[sections][generators][regression][.approvals]") {
|
||||||
|
auto fov = GENERATE(true, false);
|
||||||
|
DYNAMIC_SECTION("fov_" << fov) {
|
||||||
|
std::cout << "inside with fov: " << fov << '\n';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_CASE("#2025: same-level sections", "[sections][generators][regression][.approvals]") {
|
||||||
|
SECTION("A") {
|
||||||
|
SUCCEED();
|
||||||
|
}
|
||||||
|
auto i = GENERATE(1, 2, 3);
|
||||||
|
SECTION("B") {
|
||||||
|
REQUIRE(i < 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -15,9 +15,9 @@ import random
|
|||||||
def list_tests(self_test_exe, tags, rng_seed):
|
def list_tests(self_test_exe, tags, rng_seed):
|
||||||
cmd = [self_test_exe, '--list-test-names-only', '--order', 'rand',
|
cmd = [self_test_exe, '--list-test-names-only', '--order', 'rand',
|
||||||
'--rng-seed', str(rng_seed)]
|
'--rng-seed', str(rng_seed)]
|
||||||
tags_arg = ','.join('[{}]'.format(t) for t in tags)
|
tags_arg = ','.join('[{}]~[.]'.format(t) for t in tags)
|
||||||
if tags_arg:
|
if tags_arg:
|
||||||
cmd.append(tags_arg + '~[.]')
|
cmd.append(tags_arg)
|
||||||
process = subprocess.Popen(
|
process = subprocess.Popen(
|
||||||
cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
stdout, stderr = process.communicate()
|
stdout, stderr = process.communicate()
|
||||||
|
@@ -79,13 +79,15 @@ class Version:
|
|||||||
f.write( line + "\n" )
|
f.write( line + "\n" )
|
||||||
|
|
||||||
def updateReadmeFile(version):
|
def updateReadmeFile(version):
|
||||||
import updateWandbox
|
|
||||||
|
# Wandbox no longer accepts the single-header upload, skip
|
||||||
|
# import updateWandbox
|
||||||
|
|
||||||
downloadParser = re.compile( r'<a href=\"https://github.com/catchorg/Catch2/releases/download/v\d+\.\d+\.\d+/catch.hpp\">' )
|
downloadParser = re.compile( r'<a href=\"https://github.com/catchorg/Catch2/releases/download/v\d+\.\d+\.\d+/catch.hpp\">' )
|
||||||
success, wandboxLink = updateWandbox.uploadFiles()
|
# success, wandboxLink = updateWandbox.uploadFiles()
|
||||||
if not success:
|
# if not success:
|
||||||
print('Error when uploading to wandbox: {}'.format(wandboxLink))
|
# print('Error when uploading to wandbox: {}'.format(wandboxLink))
|
||||||
exit(1)
|
# exit(1)
|
||||||
f = open( readmePath, 'r' )
|
f = open( readmePath, 'r' )
|
||||||
lines = []
|
lines = []
|
||||||
for line in f:
|
for line in f:
|
||||||
@@ -94,8 +96,8 @@ def updateReadmeFile(version):
|
|||||||
f = open( readmePath, 'w' )
|
f = open( readmePath, 'w' )
|
||||||
for line in lines:
|
for line in lines:
|
||||||
line = downloadParser.sub( r'<a href="https://github.com/catchorg/Catch2/releases/download/v{0}/catch.hpp">'.format(version.getVersionString()) , line)
|
line = downloadParser.sub( r'<a href="https://github.com/catchorg/Catch2/releases/download/v{0}/catch.hpp">'.format(version.getVersionString()) , line)
|
||||||
if '[]' in line:
|
# if '[]' in line:
|
||||||
line = '[]({0})'.format(wandboxLink)
|
# line = '[]({0})'.format(wandboxLink)
|
||||||
f.write( line + "\n" )
|
f.write( line + "\n" )
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Catch v2.12.4
|
* Catch v2.13.3
|
||||||
* Generated: 2020-07-05 11:47:18.451282
|
* Generated: 2020-10-31 18:20:31.045274
|
||||||
* ----------------------------------------------------------
|
* ----------------------------------------------------------
|
||||||
* This file has been merged from multiple headers. Please don't edit it directly
|
* This file has been merged from multiple headers. Please don't edit it directly
|
||||||
* Copyright (c) 2020 Two Blue Cubes Ltd. All rights reserved.
|
* Copyright (c) 2020 Two Blue Cubes Ltd. All rights reserved.
|
||||||
@@ -14,8 +14,8 @@
|
|||||||
|
|
||||||
|
|
||||||
#define CATCH_VERSION_MAJOR 2
|
#define CATCH_VERSION_MAJOR 2
|
||||||
#define CATCH_VERSION_MINOR 12
|
#define CATCH_VERSION_MINOR 13
|
||||||
#define CATCH_VERSION_PATCH 4
|
#define CATCH_VERSION_PATCH 3
|
||||||
|
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
# pragma clang system_header
|
# pragma clang system_header
|
||||||
@@ -132,13 +132,9 @@ namespace Catch {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__cpp_lib_uncaught_exceptions)
|
|
||||||
# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// We have to avoid both ICC and Clang, because they try to mask themselves
|
// We have to avoid both ICC and Clang, because they try to mask themselves
|
||||||
// as gcc, and we want only GCC in this block
|
// as gcc, and we want only GCC in this block
|
||||||
#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC)
|
#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && !defined(__CUDACC__)
|
||||||
# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic push" )
|
# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic push" )
|
||||||
# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic pop" )
|
# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic pop" )
|
||||||
|
|
||||||
@@ -162,7 +158,7 @@ namespace Catch {
|
|||||||
// ```
|
// ```
|
||||||
//
|
//
|
||||||
// Therefore, `CATCH_INTERNAL_IGNORE_BUT_WARN` is not implemented.
|
// Therefore, `CATCH_INTERNAL_IGNORE_BUT_WARN` is not implemented.
|
||||||
# if !defined(__ibmxl__)
|
# if !defined(__ibmxl__) && !defined(__CUDACC__)
|
||||||
# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) /* NOLINT(cppcoreguidelines-pro-type-vararg, hicpp-vararg) */
|
# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) /* NOLINT(cppcoreguidelines-pro-type-vararg, hicpp-vararg) */
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
@@ -244,10 +240,6 @@ namespace Catch {
|
|||||||
# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION __pragma( warning(push) )
|
# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION __pragma( warning(push) )
|
||||||
# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION __pragma( warning(pop) )
|
# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION __pragma( warning(pop) )
|
||||||
|
|
||||||
# if _MSC_VER >= 1900 // Visual Studio 2015 or newer
|
|
||||||
# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
|
|
||||||
# endif
|
|
||||||
|
|
||||||
// Universal Windows platform does not support SEH
|
// Universal Windows platform does not support SEH
|
||||||
// Or console colours (or console at all...)
|
// Or console colours (or console at all...)
|
||||||
# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
|
# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
|
||||||
@@ -330,7 +322,10 @@ namespace Catch {
|
|||||||
|
|
||||||
// Check if byte is available and usable
|
// Check if byte is available and usable
|
||||||
# if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
|
# if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
|
||||||
|
# include <cstddef>
|
||||||
|
# if __cpp_lib_byte > 0
|
||||||
# define CATCH_INTERNAL_CONFIG_CPP17_BYTE
|
# define CATCH_INTERNAL_CONFIG_CPP17_BYTE
|
||||||
|
# endif
|
||||||
# endif // __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
|
# endif // __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
|
||||||
|
|
||||||
// Check if variant is available and usable
|
// Check if variant is available and usable
|
||||||
@@ -373,10 +368,6 @@ namespace Catch {
|
|||||||
# define CATCH_CONFIG_CPP17_OPTIONAL
|
# define CATCH_CONFIG_CPP17_OPTIONAL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
|
|
||||||
# define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW)
|
#if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW)
|
||||||
# define CATCH_CONFIG_CPP17_STRING_VIEW
|
# define CATCH_CONFIG_CPP17_STRING_VIEW
|
||||||
#endif
|
#endif
|
||||||
@@ -1105,7 +1096,7 @@ struct AutoReg : NonCopyable {
|
|||||||
int index = 0; \
|
int index = 0; \
|
||||||
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
|
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
|
||||||
using expander = int[];\
|
using expander = int[];\
|
||||||
(void)expander{(reg_test(Types{}, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++, 0)... };/* NOLINT */ \
|
(void)expander{(reg_test(Types{}, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++)... };/* NOLINT */ \
|
||||||
}\
|
}\
|
||||||
};\
|
};\
|
||||||
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
|
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
|
||||||
@@ -1151,7 +1142,7 @@ struct AutoReg : NonCopyable {
|
|||||||
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
|
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
|
||||||
constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\
|
constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\
|
||||||
constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\
|
constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\
|
||||||
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFuncName<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++, 0)... };/* NOLINT */\
|
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFuncName<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++)... };/* NOLINT */\
|
||||||
} \
|
} \
|
||||||
}; \
|
}; \
|
||||||
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \
|
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \
|
||||||
@@ -1195,7 +1186,7 @@ struct AutoReg : NonCopyable {
|
|||||||
void reg_tests() { \
|
void reg_tests() { \
|
||||||
int index = 0; \
|
int index = 0; \
|
||||||
using expander = int[]; \
|
using expander = int[]; \
|
||||||
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFunc<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++, 0)... };/* NOLINT */\
|
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFunc<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++)... };/* NOLINT */\
|
||||||
} \
|
} \
|
||||||
};\
|
};\
|
||||||
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \
|
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \
|
||||||
@@ -1229,7 +1220,7 @@ struct AutoReg : NonCopyable {
|
|||||||
int index = 0; \
|
int index = 0; \
|
||||||
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
|
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
|
||||||
using expander = int[];\
|
using expander = int[];\
|
||||||
(void)expander{(reg_test(Types{}, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++, 0)... };/* NOLINT */ \
|
(void)expander{(reg_test(Types{}, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++)... };/* NOLINT */ \
|
||||||
}\
|
}\
|
||||||
};\
|
};\
|
||||||
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
|
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
|
||||||
@@ -1278,7 +1269,7 @@ struct AutoReg : NonCopyable {
|
|||||||
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
|
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
|
||||||
constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\
|
constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\
|
||||||
constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\
|
constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\
|
||||||
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++, 0)... };/* NOLINT */ \
|
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++)... };/* NOLINT */ \
|
||||||
}\
|
}\
|
||||||
};\
|
};\
|
||||||
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
|
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
|
||||||
@@ -1325,7 +1316,7 @@ struct AutoReg : NonCopyable {
|
|||||||
void reg_tests(){\
|
void reg_tests(){\
|
||||||
int index = 0;\
|
int index = 0;\
|
||||||
using expander = int[];\
|
using expander = int[];\
|
||||||
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++, 0)... };/* NOLINT */ \
|
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++)... };/* NOLINT */ \
|
||||||
}\
|
}\
|
||||||
};\
|
};\
|
||||||
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
|
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
|
||||||
@@ -1829,8 +1820,8 @@ namespace Catch {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace Detail {
|
namespace Detail {
|
||||||
template<typename InputIterator>
|
template<typename InputIterator, typename Sentinel = InputIterator>
|
||||||
std::string rangeToString(InputIterator first, InputIterator last) {
|
std::string rangeToString(InputIterator first, Sentinel last) {
|
||||||
ReusableStringStream rss;
|
ReusableStringStream rss;
|
||||||
rss << "{ ";
|
rss << "{ ";
|
||||||
if (first != last) {
|
if (first != last) {
|
||||||
@@ -4522,6 +4513,7 @@ namespace Catch {
|
|||||||
virtual int abortAfter() const = 0;
|
virtual int abortAfter() const = 0;
|
||||||
virtual bool showInvisibles() const = 0;
|
virtual bool showInvisibles() const = 0;
|
||||||
virtual ShowDurations::OrNot showDurations() const = 0;
|
virtual ShowDurations::OrNot showDurations() const = 0;
|
||||||
|
virtual double minDuration() const = 0;
|
||||||
virtual TestSpec const& testSpec() const = 0;
|
virtual TestSpec const& testSpec() const = 0;
|
||||||
virtual bool hasTestFilters() const = 0;
|
virtual bool hasTestFilters() const = 0;
|
||||||
virtual std::vector<std::string> const& getTestsOrTags() const = 0;
|
virtual std::vector<std::string> const& getTestsOrTags() const = 0;
|
||||||
@@ -5294,6 +5286,7 @@ namespace Catch {
|
|||||||
Verbosity verbosity = Verbosity::Normal;
|
Verbosity verbosity = Verbosity::Normal;
|
||||||
WarnAbout::What warnings = WarnAbout::Nothing;
|
WarnAbout::What warnings = WarnAbout::Nothing;
|
||||||
ShowDurations::OrNot showDurations = ShowDurations::DefaultForReporter;
|
ShowDurations::OrNot showDurations = ShowDurations::DefaultForReporter;
|
||||||
|
double minDuration = -1;
|
||||||
RunTests::InWhatOrder runOrder = RunTests::InDeclarationOrder;
|
RunTests::InWhatOrder runOrder = RunTests::InDeclarationOrder;
|
||||||
UseColour::YesOrNo useColour = UseColour::Auto;
|
UseColour::YesOrNo useColour = UseColour::Auto;
|
||||||
WaitForKeypress::When waitForKeypress = WaitForKeypress::Never;
|
WaitForKeypress::When waitForKeypress = WaitForKeypress::Never;
|
||||||
@@ -5344,6 +5337,7 @@ namespace Catch {
|
|||||||
bool warnAboutMissingAssertions() const override;
|
bool warnAboutMissingAssertions() const override;
|
||||||
bool warnAboutNoTests() const override;
|
bool warnAboutNoTests() const override;
|
||||||
ShowDurations::OrNot showDurations() const override;
|
ShowDurations::OrNot showDurations() const override;
|
||||||
|
double minDuration() const override;
|
||||||
RunTests::InWhatOrder runOrder() const override;
|
RunTests::InWhatOrder runOrder() const override;
|
||||||
unsigned int rngSeed() const override;
|
unsigned int rngSeed() const override;
|
||||||
UseColour::YesOrNo useColour() const override;
|
UseColour::YesOrNo useColour() const override;
|
||||||
@@ -5721,6 +5715,9 @@ namespace Catch {
|
|||||||
// Returns double formatted as %.3f (format expected on output)
|
// Returns double formatted as %.3f (format expected on output)
|
||||||
std::string getFormattedDuration( double duration );
|
std::string getFormattedDuration( double duration );
|
||||||
|
|
||||||
|
//! Should the reporter show
|
||||||
|
bool shouldShowDuration( IConfig const& config, double duration );
|
||||||
|
|
||||||
std::string serializeFilters( std::vector<std::string> const& container );
|
std::string serializeFilters( std::vector<std::string> const& container );
|
||||||
|
|
||||||
template<typename DerivedT>
|
template<typename DerivedT>
|
||||||
@@ -6114,8 +6111,6 @@ namespace Catch {
|
|||||||
|
|
||||||
static std::string getDescription();
|
static std::string getDescription();
|
||||||
|
|
||||||
ReporterPreferences getPreferences() const override;
|
|
||||||
|
|
||||||
void noMatchingTestCases(std::string const& spec) override;
|
void noMatchingTestCases(std::string const& spec) override;
|
||||||
|
|
||||||
void assertionStarting(AssertionInfo const&) override;
|
void assertionStarting(AssertionInfo const&) override;
|
||||||
@@ -7499,6 +7494,7 @@ namespace TestCaseTracking {
|
|||||||
virtual bool isSuccessfullyCompleted() const = 0;
|
virtual bool isSuccessfullyCompleted() const = 0;
|
||||||
virtual bool isOpen() const = 0; // Started but not complete
|
virtual bool isOpen() const = 0; // Started but not complete
|
||||||
virtual bool hasChildren() const = 0;
|
virtual bool hasChildren() const = 0;
|
||||||
|
virtual bool hasStarted() const = 0;
|
||||||
|
|
||||||
virtual ITracker& parent() = 0;
|
virtual ITracker& parent() = 0;
|
||||||
|
|
||||||
@@ -7565,6 +7561,9 @@ namespace TestCaseTracking {
|
|||||||
bool isSuccessfullyCompleted() const override;
|
bool isSuccessfullyCompleted() const override;
|
||||||
bool isOpen() const override;
|
bool isOpen() const override;
|
||||||
bool hasChildren() const override;
|
bool hasChildren() const override;
|
||||||
|
bool hasStarted() const override {
|
||||||
|
return m_runState != NotStarted;
|
||||||
|
}
|
||||||
|
|
||||||
void addChild( ITrackerPtr const& child ) override;
|
void addChild( ITrackerPtr const& child ) override;
|
||||||
|
|
||||||
@@ -7603,6 +7602,10 @@ namespace TestCaseTracking {
|
|||||||
|
|
||||||
void addInitialFilters( std::vector<std::string> const& filters );
|
void addInitialFilters( std::vector<std::string> const& filters );
|
||||||
void addNextFilters( std::vector<std::string> const& filters );
|
void addNextFilters( std::vector<std::string> const& filters );
|
||||||
|
//! Returns filters active in this tracker
|
||||||
|
std::vector<std::string> const& getFilters() const;
|
||||||
|
//! Returns whitespace-trimmed name of the tracked section
|
||||||
|
std::string const& trimmedName() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace TestCaseTracking
|
} // namespace TestCaseTracking
|
||||||
@@ -9861,6 +9864,9 @@ namespace Catch {
|
|||||||
| Opt( [&]( bool flag ) { config.showDurations = flag ? ShowDurations::Always : ShowDurations::Never; }, "yes|no" )
|
| Opt( [&]( bool flag ) { config.showDurations = flag ? ShowDurations::Always : ShowDurations::Never; }, "yes|no" )
|
||||||
["-d"]["--durations"]
|
["-d"]["--durations"]
|
||||||
( "show test durations" )
|
( "show test durations" )
|
||||||
|
| Opt( config.minDuration, "seconds" )
|
||||||
|
["-D"]["--min-duration"]
|
||||||
|
( "show test durations for tests taking at least the given number of seconds" )
|
||||||
| Opt( loadTestNamesFromFile, "filename" )
|
| Opt( loadTestNamesFromFile, "filename" )
|
||||||
["-f"]["--input-file"]
|
["-f"]["--input-file"]
|
||||||
( "load test names to run from a file" )
|
( "load test names to run from a file" )
|
||||||
@@ -10008,6 +10014,7 @@ namespace Catch {
|
|||||||
bool Config::warnAboutMissingAssertions() const { return !!(m_data.warnings & WarnAbout::NoAssertions); }
|
bool Config::warnAboutMissingAssertions() const { return !!(m_data.warnings & WarnAbout::NoAssertions); }
|
||||||
bool Config::warnAboutNoTests() const { return !!(m_data.warnings & WarnAbout::NoTests); }
|
bool Config::warnAboutNoTests() const { return !!(m_data.warnings & WarnAbout::NoTests); }
|
||||||
ShowDurations::OrNot Config::showDurations() const { return m_data.showDurations; }
|
ShowDurations::OrNot Config::showDurations() const { return m_data.showDurations; }
|
||||||
|
double Config::minDuration() const { return m_data.minDuration; }
|
||||||
RunTests::InWhatOrder Config::runOrder() const { return m_data.runOrder; }
|
RunTests::InWhatOrder Config::runOrder() const { return m_data.runOrder; }
|
||||||
unsigned int Config::rngSeed() const { return m_data.rngSeed; }
|
unsigned int Config::rngSeed() const { return m_data.rngSeed; }
|
||||||
UseColour::YesOrNo Config::useColour() const { return m_data.useColour; }
|
UseColour::YesOrNo Config::useColour() const { return m_data.useColour; }
|
||||||
@@ -12030,7 +12037,7 @@ namespace Catch {
|
|||||||
if (tmpnam_s(m_buffer)) {
|
if (tmpnam_s(m_buffer)) {
|
||||||
CATCH_RUNTIME_ERROR("Could not get a temp filename");
|
CATCH_RUNTIME_ERROR("Could not get a temp filename");
|
||||||
}
|
}
|
||||||
if (fopen_s(&m_file, m_buffer, "w")) {
|
if (fopen_s(&m_file, m_buffer, "w+")) {
|
||||||
char buffer[100];
|
char buffer[100];
|
||||||
if (strerror_s(buffer, errno)) {
|
if (strerror_s(buffer, errno)) {
|
||||||
CATCH_RUNTIME_ERROR("Could not translate errno to a string");
|
CATCH_RUNTIME_ERROR("Could not translate errno to a string");
|
||||||
@@ -12547,7 +12554,7 @@ namespace Catch {
|
|||||||
currentTracker.addChild( tracker );
|
currentTracker.addChild( tracker );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !ctx.completedCycle() && !tracker->isComplete() ) {
|
if( !tracker->isComplete() ) {
|
||||||
tracker->open();
|
tracker->open();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -12561,8 +12568,68 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
void close() override {
|
void close() override {
|
||||||
TrackerBase::close();
|
TrackerBase::close();
|
||||||
// Generator interface only finds out if it has another item on atual move
|
// If a generator has a child (it is followed by a section)
|
||||||
if (m_runState == CompletedSuccessfully && m_generator->next()) {
|
// and none of its children have started, then we must wait
|
||||||
|
// until later to start consuming its values.
|
||||||
|
// This catches cases where `GENERATE` is placed between two
|
||||||
|
// `SECTION`s.
|
||||||
|
// **The check for m_children.empty cannot be removed**.
|
||||||
|
// doing so would break `GENERATE` _not_ followed by `SECTION`s.
|
||||||
|
const bool should_wait_for_child = [&]() {
|
||||||
|
// No children -> nobody to wait for
|
||||||
|
if ( m_children.empty() ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// If at least one child started executing, don't wait
|
||||||
|
if ( std::find_if(
|
||||||
|
m_children.begin(),
|
||||||
|
m_children.end(),
|
||||||
|
[]( TestCaseTracking::ITrackerPtr tracker ) {
|
||||||
|
return tracker->hasStarted();
|
||||||
|
} ) != m_children.end() ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// No children have started. We need to check if they _can_
|
||||||
|
// start, and thus we should wait for them, or they cannot
|
||||||
|
// start (due to filters), and we shouldn't wait for them
|
||||||
|
auto* parent = m_parent;
|
||||||
|
// This is safe: there is always at least one section
|
||||||
|
// tracker in a test case tracking tree
|
||||||
|
while ( !parent->isSectionTracker() ) {
|
||||||
|
parent = &( parent->parent() );
|
||||||
|
}
|
||||||
|
assert( parent &&
|
||||||
|
"Missing root (test case) level section" );
|
||||||
|
|
||||||
|
auto const& parentSection =
|
||||||
|
static_cast<SectionTracker&>( *parent );
|
||||||
|
auto const& filters = parentSection.getFilters();
|
||||||
|
// No filters -> no restrictions on running sections
|
||||||
|
if ( filters.empty() ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( auto const& child : m_children ) {
|
||||||
|
if ( child->isSectionTracker() &&
|
||||||
|
std::find( filters.begin(),
|
||||||
|
filters.end(),
|
||||||
|
static_cast<SectionTracker&>( *child )
|
||||||
|
.trimmedName() ) !=
|
||||||
|
filters.end() ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}();
|
||||||
|
|
||||||
|
// This check is a bit tricky, because m_generator->next()
|
||||||
|
// has a side-effect, where it consumes generator's current
|
||||||
|
// value, but we do not want to invoke the side-effect if
|
||||||
|
// this generator is still waiting for any child to start.
|
||||||
|
if ( should_wait_for_child ||
|
||||||
|
( m_runState == CompletedSuccessfully &&
|
||||||
|
m_generator->next() ) ) {
|
||||||
m_children.clear();
|
m_children.clear();
|
||||||
m_runState = Executing;
|
m_runState = Executing;
|
||||||
}
|
}
|
||||||
@@ -12702,7 +12769,6 @@ namespace Catch {
|
|||||||
using namespace Generators;
|
using namespace Generators;
|
||||||
GeneratorTracker& tracker = GeneratorTracker::acquire(m_trackerContext,
|
GeneratorTracker& tracker = GeneratorTracker::acquire(m_trackerContext,
|
||||||
TestCaseTracking::NameAndLocation( static_cast<std::string>(generatorName), lineInfo ) );
|
TestCaseTracking::NameAndLocation( static_cast<std::string>(generatorName), lineInfo ) );
|
||||||
assert( tracker.isOpen() );
|
|
||||||
m_lastAssertionInfo.lineInfo = lineInfo;
|
m_lastAssertionInfo.lineInfo = lineInfo;
|
||||||
return tracker;
|
return tracker;
|
||||||
}
|
}
|
||||||
@@ -14060,10 +14126,10 @@ namespace Catch {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
struct TestHasher {
|
struct TestHasher {
|
||||||
explicit TestHasher(Catch::SimplePcg32& rng) {
|
explicit TestHasher(Catch::SimplePcg32& rng_instance) {
|
||||||
basis = rng();
|
basis = rng_instance();
|
||||||
basis <<= 32;
|
basis <<= 32;
|
||||||
basis |= rng();
|
basis |= rng_instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t basis;
|
uint64_t basis;
|
||||||
@@ -14381,7 +14447,8 @@ namespace TestCaseTracking {
|
|||||||
bool SectionTracker::isComplete() const {
|
bool SectionTracker::isComplete() const {
|
||||||
bool complete = true;
|
bool complete = true;
|
||||||
|
|
||||||
if ((m_filters.empty() || m_filters[0] == "")
|
if (m_filters.empty()
|
||||||
|
|| m_filters[0] == ""
|
||||||
|| std::find(m_filters.begin(), m_filters.end(), m_trimmed_name) != m_filters.end()) {
|
|| std::find(m_filters.begin(), m_filters.end(), m_trimmed_name) != m_filters.end()) {
|
||||||
complete = TrackerBase::isComplete();
|
complete = TrackerBase::isComplete();
|
||||||
}
|
}
|
||||||
@@ -14426,6 +14493,14 @@ namespace TestCaseTracking {
|
|||||||
m_filters.insert( m_filters.end(), filters.begin()+1, filters.end() );
|
m_filters.insert( m_filters.end(), filters.begin()+1, filters.end() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> const& SectionTracker::getFilters() const {
|
||||||
|
return m_filters;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string const& SectionTracker::trimmedName() const {
|
||||||
|
return m_trimmed_name;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace TestCaseTracking
|
} // namespace TestCaseTracking
|
||||||
|
|
||||||
using TestCaseTracking::ITracker;
|
using TestCaseTracking::ITracker;
|
||||||
@@ -15160,6 +15235,41 @@ namespace Catch {
|
|||||||
// end catch_totals.cpp
|
// end catch_totals.cpp
|
||||||
// start catch_uncaught_exceptions.cpp
|
// start catch_uncaught_exceptions.cpp
|
||||||
|
|
||||||
|
// start catch_config_uncaught_exceptions.hpp
|
||||||
|
|
||||||
|
// Copyright Catch2 Authors
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// https://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
// SPDX-License-Identifier: BSL-1.0
|
||||||
|
|
||||||
|
#ifndef CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP
|
||||||
|
#define CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
# if _MSC_VER >= 1900 // Visual Studio 2015 or newer
|
||||||
|
# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <exception>
|
||||||
|
|
||||||
|
#if defined(__cpp_lib_uncaught_exceptions) \
|
||||||
|
&& !defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
|
||||||
|
|
||||||
|
# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
|
||||||
|
#endif // __cpp_lib_uncaught_exceptions
|
||||||
|
|
||||||
|
#if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) \
|
||||||
|
&& !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) \
|
||||||
|
&& !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
|
||||||
|
|
||||||
|
# define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP
|
||||||
|
// end catch_config_uncaught_exceptions.hpp
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
|
||||||
namespace Catch {
|
namespace Catch {
|
||||||
@@ -15206,7 +15316,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Version const& libraryVersion() {
|
Version const& libraryVersion() {
|
||||||
static Version version( 2, 12, 4, "", 0 );
|
static Version version( 2, 13, 3, "", 0 );
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15608,6 +15718,17 @@ namespace Catch {
|
|||||||
return std::string(buffer);
|
return std::string(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool shouldShowDuration( IConfig const& config, double duration ) {
|
||||||
|
if ( config.showDurations() == ShowDurations::Always ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if ( config.showDurations() == ShowDurations::Never ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const double min = config.minDuration();
|
||||||
|
return min >= 0 && duration >= min;
|
||||||
|
}
|
||||||
|
|
||||||
std::string serializeFilters( std::vector<std::string> const& container ) {
|
std::string serializeFilters( std::vector<std::string> const& container ) {
|
||||||
ReusableStringStream oss;
|
ReusableStringStream oss;
|
||||||
bool first = true;
|
bool first = true;
|
||||||
@@ -15874,10 +15995,6 @@ private:
|
|||||||
return "Reports test results on a single line, suitable for IDEs";
|
return "Reports test results on a single line, suitable for IDEs";
|
||||||
}
|
}
|
||||||
|
|
||||||
ReporterPreferences CompactReporter::getPreferences() const {
|
|
||||||
return m_reporterPrefs;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CompactReporter::noMatchingTestCases( std::string const& spec ) {
|
void CompactReporter::noMatchingTestCases( std::string const& spec ) {
|
||||||
stream << "No test cases matched '" << spec << '\'' << std::endl;
|
stream << "No test cases matched '" << spec << '\'' << std::endl;
|
||||||
}
|
}
|
||||||
@@ -15904,8 +16021,9 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CompactReporter::sectionEnded(SectionStats const& _sectionStats) {
|
void CompactReporter::sectionEnded(SectionStats const& _sectionStats) {
|
||||||
if (m_config->showDurations() == ShowDurations::Always) {
|
double dur = _sectionStats.durationInSeconds;
|
||||||
stream << getFormattedDuration(_sectionStats.durationInSeconds) << " s: " << _sectionStats.sectionInfo.name << std::endl;
|
if ( shouldShowDuration( *m_config, dur ) ) {
|
||||||
|
stream << getFormattedDuration( dur ) << " s: " << _sectionStats.sectionInfo.name << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16325,8 +16443,9 @@ void ConsoleReporter::sectionEnded(SectionStats const& _sectionStats) {
|
|||||||
stream << "\nNo assertions in test case";
|
stream << "\nNo assertions in test case";
|
||||||
stream << " '" << _sectionStats.sectionInfo.name << "'\n" << std::endl;
|
stream << " '" << _sectionStats.sectionInfo.name << "'\n" << std::endl;
|
||||||
}
|
}
|
||||||
if (m_config->showDurations() == ShowDurations::Always) {
|
double dur = _sectionStats.durationInSeconds;
|
||||||
stream << getFormattedDuration(_sectionStats.durationInSeconds) << " s: " << _sectionStats.sectionInfo.name << std::endl;
|
if (shouldShowDuration(*m_config, dur)) {
|
||||||
|
stream << getFormattedDuration(dur) << " s: " << _sectionStats.sectionInfo.name << std::endl;
|
||||||
}
|
}
|
||||||
if (m_headerPrinted) {
|
if (m_headerPrinted) {
|
||||||
m_headerPrinted = false;
|
m_headerPrinted = false;
|
||||||
|
@@ -23,16 +23,17 @@ namespace Catch {
|
|||||||
|
|
||||||
using StreamingReporterBase::StreamingReporterBase;
|
using StreamingReporterBase::StreamingReporterBase;
|
||||||
|
|
||||||
|
TAPReporter( ReporterConfig const& config ):
|
||||||
|
StreamingReporterBase( config ) {
|
||||||
|
m_reporterPrefs.shouldReportAllAssertions = true;
|
||||||
|
}
|
||||||
|
|
||||||
~TAPReporter() override;
|
~TAPReporter() override;
|
||||||
|
|
||||||
static std::string getDescription() {
|
static std::string getDescription() {
|
||||||
return "Reports test results in TAP format, suitable for test harnesses";
|
return "Reports test results in TAP format, suitable for test harnesses";
|
||||||
}
|
}
|
||||||
|
|
||||||
ReporterPreferences getPreferences() const override {
|
|
||||||
return m_reporterPrefs;
|
|
||||||
}
|
|
||||||
|
|
||||||
void noMatchingTestCases( std::string const& spec ) override {
|
void noMatchingTestCases( std::string const& spec ) override {
|
||||||
stream << "# No test cases matched '" << spec << "'" << std::endl;
|
stream << "# No test cases matched '" << spec << "'" << std::endl;
|
||||||
}
|
}
|
||||||
@@ -203,16 +204,15 @@ namespace Catch {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// using messages.end() directly (or auto) yields compilation error:
|
const auto itEnd = messages.cend();
|
||||||
std::vector<MessageInfo>::const_iterator itEnd = messages.end();
|
const auto N = static_cast<std::size_t>( std::distance( itMessage, itEnd ) );
|
||||||
const std::size_t N = static_cast<std::size_t>( std::distance( itMessage, itEnd ) );
|
|
||||||
|
|
||||||
{
|
{
|
||||||
Colour colourGuard( colour );
|
Colour colourGuard( colour );
|
||||||
stream << " with " << pluralise( N, "message" ) << ":";
|
stream << " with " << pluralise( N, "message" ) << ":";
|
||||||
}
|
}
|
||||||
|
|
||||||
for(; itMessage != itEnd; ) {
|
while( itMessage != itEnd ) {
|
||||||
// If this assertion is a warning ignore any INFO messages
|
// If this assertion is a warning ignore any INFO messages
|
||||||
if( printInfoMessages || itMessage->type != ResultWas::Info ) {
|
if( printInfoMessages || itMessage->type != ResultWas::Info ) {
|
||||||
stream << " '" << itMessage->message << "'";
|
stream << " '" << itMessage->message << "'";
|
||||||
@@ -220,7 +220,9 @@ namespace Catch {
|
|||||||
Colour colourGuard( dimColour() );
|
Colour colourGuard( dimColour() );
|
||||||
stream << " and";
|
stream << " and";
|
||||||
}
|
}
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
++itMessage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,10 +236,9 @@ namespace Catch {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void printTotals( const Totals& totals ) const {
|
void printTotals( const Totals& totals ) const {
|
||||||
|
stream << "1.." << totals.assertions.total();
|
||||||
if( totals.testCases.total() == 0 ) {
|
if( totals.testCases.total() == 0 ) {
|
||||||
stream << "1..0 # Skipped: No tests ran.";
|
stream << " # Skipped: No tests ran.";
|
||||||
} else {
|
|
||||||
stream << "1.." << counter;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user