mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-11 07:55:39 +02:00
Compare commits
57 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
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 | ||
![]() |
c299133a31 | ||
![]() |
09b8017ea3 | ||
![]() |
bad3c93049 | ||
![]() |
0f05c034c2 | ||
![]() |
ee4538c0c6 | ||
![]() |
dc7a20fc74 | ||
![]() |
018dc0b74f | ||
![]() |
ad1940f336 | ||
![]() |
5399921622 | ||
![]() |
e815acddf8 | ||
![]() |
e7189f1e4f | ||
![]() |
1806b21545 | ||
![]() |
288416f501 | ||
![]() |
cbbebb65b6 | ||
![]() |
fb08596b1b | ||
![]() |
0614a4acb3 | ||
![]() |
0f12995501 | ||
![]() |
0807fdb175 | ||
![]() |
9500ded83b | ||
![]() |
6c6ebe374a |
25
.clang-format
Normal file
25
.clang-format
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
AccessModifierOffset: '-4'
|
||||
AlignEscapedNewlines: Left
|
||||
AllowAllConstructorInitializersOnNextLine: 'true'
|
||||
BinPackArguments: 'false'
|
||||
BinPackParameters: 'false'
|
||||
BreakConstructorInitializers: AfterColon
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
|
||||
DerivePointerAlignment: 'false'
|
||||
FixNamespaceComments: 'true'
|
||||
IncludeBlocks: Regroup
|
||||
IndentCaseLabels: 'false'
|
||||
IndentPPDirectives: AfterHash
|
||||
IndentWidth: '4'
|
||||
Language: Cpp
|
||||
NamespaceIndentation: All
|
||||
PointerAlignment: Left
|
||||
SpaceBeforeCtorInitializerColon: 'false'
|
||||
SpaceInEmptyParentheses: 'false'
|
||||
SpacesInParentheses: 'true'
|
||||
Standard: Cpp11
|
||||
TabWidth: '4'
|
||||
UseTab: Never
|
||||
|
||||
...
|
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@@ -1 +1 @@
|
||||
patreon: horenmar
|
||||
custom: "https://www.paypal.me/horenmar"
|
||||
|
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.5)
|
||||
# detect if Catch is being bundled,
|
||||
# disable testsuite in that case
|
||||
if(NOT DEFINED PROJECT_NAME)
|
||||
set(NOT_SUBPROJECT ON)
|
||||
set(NOT_SUBPROJECT ON)
|
||||
endif()
|
||||
|
||||
# Catch2's build breaks if done in-tree. You probably should not build
|
||||
@@ -14,14 +14,12 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||
endif()
|
||||
|
||||
|
||||
project(Catch2 LANGUAGES CXX VERSION 2.12.2)
|
||||
project(Catch2 LANGUAGES CXX VERSION 2.13.2)
|
||||
|
||||
# Provide path for scripts
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")
|
||||
|
||||
include(GNUInstallDirs)
|
||||
include(CMakePackageConfigHelpers)
|
||||
include(CTest)
|
||||
|
||||
option(CATCH_USE_VALGRIND "Perform SelfTests with Valgrind" OFF)
|
||||
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)
|
||||
|
||||
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
# define some folders
|
||||
set(CATCH_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(SELF_TEST_DIR ${CATCH_DIR}/projects/SelfTest)
|
||||
@@ -45,12 +41,16 @@ if(USE_WMAIN)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ENTRY:wmainCRTStartup")
|
||||
endif()
|
||||
|
||||
if (BUILD_TESTING AND CATCH_BUILD_TESTING AND NOT_SUBPROJECT)
|
||||
find_package(PythonInterp)
|
||||
if (NOT PYTHONINTERP_FOUND)
|
||||
message(FATAL_ERROR "Python not found, but required for tests")
|
||||
if(NOT_SUBPROJECT)
|
||||
include(CTest)
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
if(BUILD_TESTING AND CATCH_BUILD_TESTING)
|
||||
find_package(PythonInterp)
|
||||
if (NOT PYTHONINTERP_FOUND)
|
||||
message(FATAL_ERROR "Python not found, but required for tests")
|
||||
endif()
|
||||
add_subdirectory(projects)
|
||||
endif()
|
||||
add_subdirectory(projects)
|
||||
endif()
|
||||
|
||||
if(CATCH_BUILD_EXAMPLES)
|
||||
@@ -107,6 +107,7 @@ add_library(Catch2::Catch2 ALIAS Catch2)
|
||||
# a subproject via `add_subdirectory`, or the destinations will break,
|
||||
# see https://github.com/catchorg/Catch2/issues/1373
|
||||
if (NOT_SUBPROJECT)
|
||||
include(CMakePackageConfigHelpers)
|
||||
set(CATCH_CMAKE_CONFIG_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Catch2")
|
||||
|
||||
configure_package_config_file(
|
||||
|
@@ -5,11 +5,11 @@
|
||||
[](https://travis-ci.org/catchorg/Catch2)
|
||||
[](https://ci.appveyor.com/project/catchorg/catch2)
|
||||
[](https://codecov.io/gh/catchorg/Catch2)
|
||||
[](https://wandbox.org/permlink/QdDfqVqDGRuwcduN)
|
||||
[](https://wandbox.org/permlink/6JUH8Eybx4CtvkJS)
|
||||
[](https://discord.gg/4CWS9zD)
|
||||
|
||||
|
||||
<a href="https://github.com/catchorg/Catch2/releases/download/v2.12.2/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.2/catch.hpp">The latest version of the single header can be downloaded directly using this link</a>
|
||||
|
||||
## Catch2 is released!
|
||||
|
||||
|
@@ -33,6 +33,10 @@ same as the Catch name; see also ``TEST_PREFIX`` and ``TEST_SUFFIX``.
|
||||
[TEST_SUFFIX suffix]
|
||||
[PROPERTIES name1 value1...]
|
||||
[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
|
||||
@@ -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()``.
|
||||
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(
|
||||
""
|
||||
""
|
||||
"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"
|
||||
${ARGN}
|
||||
)
|
||||
@@ -110,7 +136,7 @@ function(catch_discover_tests TARGET)
|
||||
endif()
|
||||
|
||||
## 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)
|
||||
|
||||
# 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_SUFFIX=${_TEST_SUFFIX}"
|
||||
-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}"
|
||||
-P "${_CATCH_DISCOVER_TESTS_SCRIPT}"
|
||||
VERBATIM
|
||||
|
@@ -6,6 +6,10 @@ set(suffix "${TEST_SUFFIX}")
|
||||
set(spec ${TEST_SPEC})
|
||||
set(extra_args ${TEST_EXTRA_ARGS})
|
||||
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(suite)
|
||||
set(tests)
|
||||
@@ -32,6 +36,7 @@ execute_process(
|
||||
COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-test-names-only
|
||||
OUTPUT_VARIABLE output
|
||||
RESULT_VARIABLE result
|
||||
WORKING_DIRECTORY "${TEST_WORKING_DIR}"
|
||||
)
|
||||
# Catch --list-test-names-only reports the number of tests, so 0 is... surprising
|
||||
if(${result} EQUAL 0)
|
||||
@@ -48,6 +53,44 @@ endif()
|
||||
|
||||
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
|
||||
foreach(line ${output})
|
||||
set(test ${line})
|
||||
@@ -56,6 +99,12 @@ foreach(line ${output})
|
||||
foreach(char , [ ])
|
||||
string(REPLACE ${char} "\\${char}" test_name ${test_name})
|
||||
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
|
||||
add_command(add_test
|
||||
"${prefix}${test}${suffix}"
|
||||
@@ -63,6 +112,8 @@ foreach(line ${output})
|
||||
"${TEST_EXECUTABLE}"
|
||||
"${test_name}"
|
||||
${extra_args}
|
||||
"${reporter_arg}"
|
||||
"${output_dir_arg}"
|
||||
)
|
||||
add_command(set_tests_properties
|
||||
"${prefix}${test}${suffix}"
|
||||
|
@@ -1,9 +1,11 @@
|
||||
#==================================================================================================#
|
||||
# supported macros #
|
||||
# - TEST_CASE, #
|
||||
# - TEMPLATE_TEST_CASE #
|
||||
# - SCENARIO, #
|
||||
# - TEST_CASE_METHOD, #
|
||||
# - CATCH_TEST_CASE, #
|
||||
# - CATCH_TEMPLATE_TEST_CASE #
|
||||
# - CATCH_SCENARIO, #
|
||||
# - CATCH_TEST_CASE_METHOD. #
|
||||
# #
|
||||
@@ -106,7 +108,7 @@ function(ParseAndAddCatchTests_ParseFile SourceFile TestTarget)
|
||||
ParseAndAddCatchTests_RemoveComments(Contents)
|
||||
|
||||
# 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}")
|
||||
string(REGEX MATCHALL "[ \t]*(CATCH_)?(TEMPLATE_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)[ \t]*\\([ \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)
|
||||
ParseAndAddCatchTests_PrintDebugMessage("Adding ${SourceFile} to CMAKE_CONFIGURE_DEPENDS property")
|
||||
@@ -122,8 +124,8 @@ function(ParseAndAddCatchTests_ParseFile SourceFile TestTarget)
|
||||
string(REGEX REPLACE "\\\\\n|\n" "" TestName "${TestName}")
|
||||
|
||||
# Get test type and fixture if applicable
|
||||
string(REGEX MATCH "(CATCH_)?(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)[ \t]*\\([^,^\"]*" TestTypeAndFixture "${TestName}")
|
||||
string(REGEX MATCH "(CATCH_)?(TEMPLATE_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)" TestType "${TestTypeAndFixture}")
|
||||
string(REGEX REPLACE "${TestType}\\([ \t]*" "" TestFixture "${TestTypeAndFixture}")
|
||||
|
||||
# Get string parts of test definition
|
||||
@@ -189,24 +191,35 @@ function(ParseAndAddCatchTests_ParseFile SourceFile TestTarget)
|
||||
# Escape commas in the test spec
|
||||
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
|
||||
if(NOT ${CMAKE_VERSION} VERSION_EQUAL "3.18")
|
||||
set(CTestName "\"${CTestName}\"")
|
||||
endif()
|
||||
|
||||
# Handle template test cases
|
||||
if("${TestTypeAndFixture}" MATCHES ".*TEMPLATE_.*")
|
||||
set(Name "${Name} - *")
|
||||
endif()
|
||||
|
||||
# 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
|
||||
if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_GREATER "3.8")
|
||||
ParseAndAddCatchTests_PrintDebugMessage("Setting DISABLED test property")
|
||||
set_tests_properties("\"${CTestName}\"" PROPERTIES DISABLED ON)
|
||||
set_tests_properties("${CTestName}" PROPERTIES DISABLED ON)
|
||||
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}")
|
||||
endif()
|
||||
set_property(
|
||||
TARGET ${TestTarget}
|
||||
APPEND
|
||||
PROPERTY ParseAndAddCatchTests_TESTS "\"${CTestName}\"")
|
||||
PROPERTY ParseAndAddCatchTests_TESTS "${CTestName}")
|
||||
set_property(
|
||||
SOURCE ${SourceFile}
|
||||
APPEND
|
||||
PROPERTY ParseAndAddCatchTests_TESTS "\"${CTestName}\"")
|
||||
PROPERTY ParseAndAddCatchTests_TESTS "${CTestName}")
|
||||
endif()
|
||||
|
||||
|
||||
|
@@ -36,6 +36,20 @@ add_subdirectory(lib/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
|
||||
|
||||
Catch2's repository also contains two CMake scripts that help users
|
||||
@@ -83,6 +97,10 @@ catch_discover_tests(target
|
||||
[TEST_SUFFIX suffix]
|
||||
[PROPERTIES name1 value1...]
|
||||
[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()`.
|
||||
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`
|
||||
|
||||
|
@@ -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.
|
||||
|
||||
<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>
|
||||
## Load test names to run from a file
|
||||
<pre>-f, --input-file <filename></pre>
|
||||
|
@@ -1,100 +1,134 @@
|
||||
<a id="top"></a>
|
||||
# Contributing to Catch
|
||||
# Contributing to Catch2
|
||||
|
||||
**Contents**<br>
|
||||
[Branches](#branches)<br>
|
||||
[Directory structure](#directory-structure)<br>
|
||||
[Using Git(Hub)](#using-github)<br>
|
||||
[Testing your changes](#testing-your-changes)<br>
|
||||
[Documenting your code](#documenting-your-code)<br>
|
||||
[Code constructs to watch out for](#code-constructs-to-watch-out-for)<br>
|
||||
[Writing documentation](#writing-documentation)<br>
|
||||
[Writing code](#writing-code)<br>
|
||||
[CoC](#coc)<br>
|
||||
|
||||
So you want to contribute something to Catch? That's great! Whether it's a bug fix, a new feature, support for
|
||||
additional compilers - or just a fix to the documentation - all contributions are very welcome and very much appreciated.
|
||||
Of course so are bug reports and other comments and questions.
|
||||
So you want to contribute something to Catch2? That's great! Whether it's
|
||||
a bug fix, a new feature, support for additional compilers - or just
|
||||
a fix to the documentation - all contributions are very welcome and very
|
||||
much appreciated. Of course so are bug reports, other comments, and
|
||||
questions, but generally it is a better idea to ask questions in our
|
||||
[Discord](https://discord.gg/4CWS9zD), than in the issue tracker.
|
||||
|
||||
If you are contributing to the code base there are a few simple guidelines to keep in mind. This also includes notes to
|
||||
help you find your way around. As this is liable to drift out of date please raise an issue or, better still, a pull
|
||||
request for this file, if you notice that.
|
||||
|
||||
## Branches
|
||||
This page covers some guidelines and helpful tips for contributing
|
||||
to the codebase itself.
|
||||
|
||||
Ongoing development is currently on _master_. At some point an integration branch will be set-up and PRs should target
|
||||
that - but for now it's all against master. You may see feature branches come and go from time to time, too.
|
||||
## Using Git(Hub)
|
||||
|
||||
## Directory structure
|
||||
Ongoing development happens in the `master` branch for Catch2 v2, and in
|
||||
`dev-v3` for the next major version, v3.
|
||||
|
||||
_Users_ of Catch primarily use the single header version. _Maintainers_ should work with the full source (which is still,
|
||||
primarily, in headers). This can be found in the `include` folder. There are a set of test files, currently under
|
||||
`projects/SelfTest`. The test app can be built via CMake from the `CMakeLists.txt` file in the root, or you can generate
|
||||
project files for Visual Studio, XCode, and others (instructions in the `projects` folder). If you have access to CLion,
|
||||
it can work with the CMake file directly.
|
||||
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
|
||||
commits are also prefered, as they make later operations with git history,
|
||||
whether it is bisecting, reverting, or something else, easier.
|
||||
|
||||
As well as the runtime test files you'll also see a `SurrogateCpps` directory under `projects/SelfTest`.
|
||||
This contains a set of .cpp files that each `#include` a single header.
|
||||
While these files are not essential to compilation they help to keep the implementation headers self-contained.
|
||||
At time of writing this set is not complete but has reasonable coverage.
|
||||
If you add additional headers please try to remember to add a surrogate cpp for it.
|
||||
_When submitting a pull request please do not include changes to the
|
||||
single include. This means do not include them in your git commits!_
|
||||
|
||||
The other directories are `scripts` which contains a set of python scripts to help in testing Catch as well as
|
||||
generating the single include, and `docs`, which contains the documentation as a set of markdown files.
|
||||
|
||||
__When submitting a pull request please do not include changes to the single include, or to the version number file
|
||||
as these are managed by the scripts!__
|
||||
When addressing review comments in a MR, please do not rebase/squash the
|
||||
commits immediately. Doing so makes it harder to review the new changes,
|
||||
slowing down the process of merging a MR. Instead, when addressing review
|
||||
comments, you should append new commits to the branch and only squash
|
||||
them into other commits when the MR is ready to be merged. We recommend
|
||||
creating new commits with `git commit --fixup` (or `--squash`) and then
|
||||
later squashing them with `git rebase --autosquash` to make things easier.
|
||||
|
||||
|
||||
|
||||
## Testing your changes
|
||||
|
||||
Obviously all changes to Catch's code should be tested. If you added new
|
||||
functionality, you should add tests covering and showcasing it. Even if you have
|
||||
only made changes to Catch internals (i.e. you implemented some performance
|
||||
improvements), you should still test your changes.
|
||||
_Note: Running Catch2's tests requires Python3_
|
||||
|
||||
This means 2 things
|
||||
|
||||
* Compiling Catch's SelfTest project:
|
||||
Catch2 has multiple layers of tests that are then run as part of our CI.
|
||||
The most obvious one are the unit tests compiled into the `SelfTest`
|
||||
binary. These are then used in "Approval tests", which run (almost) all
|
||||
tests from `SelfTest` through a specific reporter and then compare the
|
||||
generated output with a known good output ("Baseline"). By default, new
|
||||
tests should be placed here.
|
||||
|
||||
However, not all tests can be written as plain unit tests. For example,
|
||||
checking that Catch2 orders tests randomly when asked to, and that this
|
||||
random ordering is subset-invariant, is better done as an integration
|
||||
test using an external check script. Catch2 integration tests are written
|
||||
using CTest, either as a direct command invocation + pass/fail regex,
|
||||
or by delegating the check to a Python script.
|
||||
|
||||
There are also two more kinds of tests, examples and "ExtraTests".
|
||||
Examples serve as a compilation test on the single-header distribution,
|
||||
and present a small and self-contained snippets of using Catch2 for
|
||||
writing tests. ExtraTests then are tests that either take a long time
|
||||
to run, or require separate compilation, e.g. because of testing compile
|
||||
time configuration options, and take a long time because of that.
|
||||
|
||||
Both of these are compiled against the single-header distribution of
|
||||
Catch2, and thus might require you to regenerate it manually. This is
|
||||
done by calling the `generateSingleHeader.py` script in `scripts`.
|
||||
|
||||
Examples and ExtraTests are not compiled by default. To compile them,
|
||||
add `-DCATCH_BUILD_EXAMPLES=ON` and `-DCATCH_BUILD_EXTRA_TESTS=ON` to
|
||||
the invocation of CMake configuration step.
|
||||
|
||||
Bringing this all together, the steps below should configure, build,
|
||||
and run all tests in the `Debug` compilation.
|
||||
|
||||
1. Regenerate the single header distribution
|
||||
```
|
||||
$ cd Catch2
|
||||
$ cmake -Bdebug-build -H. -DCMAKE_BUILD_TYPE=Debug
|
||||
$ ./scripts/generateSingleHeader.py
|
||||
```
|
||||
2. Configure the full test build
|
||||
```
|
||||
$ cmake -Bdebug-build -H. -DCMAKE_BUILD_TYPE=Debug -DCATCH_BUILD_EXAMPLES=ON -DCATCH_BUILD_EXTRA_TESTS=ON
|
||||
```
|
||||
3. Run the actual build
|
||||
```
|
||||
$ cmake --build debug-build
|
||||
```
|
||||
because code that does not compile is evidently incorrect. Obviously,
|
||||
you are not expected to have access to all the compilers and platforms
|
||||
supported by Catch2, but you should at least smoke test your changes
|
||||
on your platform. Our CI pipeline will check your PR against most of
|
||||
the supported platforms, but it takes an hour to finish -- compiling
|
||||
locally takes just a few minutes.
|
||||
|
||||
|
||||
* Running the tests via CTest:
|
||||
4. Run the tests using CTest
|
||||
```
|
||||
$ cd debug-build
|
||||
$ ctest -j 2 --output-on-failure
|
||||
$ ctest -j 4 --output-on-failure -C Debug
|
||||
```
|
||||
__Note:__ When running your tests with multi-configuration generators like
|
||||
Visual Studio, you might get errors "Test not available without configuration."
|
||||
You then have to pick one configuration (e.g. ` -C Debug`) in the `ctest` call.
|
||||
|
||||
If you added new tests, approval tests are very likely to fail. If they
|
||||
do not, it means that your changes weren't run as part of them. This
|
||||
_might_ be intentional, but usually is not.
|
||||
|
||||
The approval tests compare current output of the SelfTest binary in various
|
||||
configurations against known good outputs. The reason it fails is,
|
||||
_usually_, that you've added new tests but have not yet approved the changes
|
||||
they introduce. This is done with the `scripts/approve.py` script, but
|
||||
before you do so, you need to check that the introduced changes are indeed
|
||||
intentional.
|
||||
|
||||
|
||||
## Documenting your code
|
||||
## Writing documentation
|
||||
|
||||
If you have added new feature to Catch2, it needs documentation, so that
|
||||
other people can use it as well. This section collects some technical
|
||||
information that you will need for updating Catch2's documentation, and
|
||||
possibly some generic advise as well.
|
||||
|
||||
### Technicalities
|
||||
|
||||
First, the technicalities:
|
||||
|
||||
* If you have introduced a new document, there is a simple template you
|
||||
should use. It provides you with the top anchor mentioned to link to
|
||||
(more below), and also with a backlink to the top of the documentation:
|
||||
```markdown
|
||||
<a id="top"></a>
|
||||
# Cool feature
|
||||
|
||||
Text that explains how to use the cool feature.
|
||||
|
||||
|
||||
---
|
||||
|
||||
[Home](Readme.md#top)
|
||||
```
|
||||
|
||||
* Crosslinks to different pages should target the `top` anchor, like this
|
||||
`[link to contributing](contributing.md#top)`.
|
||||
|
||||
* We introduced version tags to the documentation, which show users in
|
||||
which version a specific feature was introduced. This means that newly
|
||||
written documentation should be tagged with a placeholder, that will
|
||||
@@ -106,23 +140,8 @@ tags for other features).
|
||||
placeholder is usually used after a section heading
|
||||
* `> X (Y and Z) was [introduced](link-to-issue-or-PR) in Catch X.Y.Z`
|
||||
- this placeholder is used when you need to tag a subpart of something,
|
||||
e.g. list
|
||||
* Crosslinks to different pages should target the `top` anchor, like this
|
||||
`[link to contributing](contributing.md#top)`.
|
||||
* If you have introduced a new document, there is a simple template you
|
||||
should use. It provides you with the top anchor mentioned above, and also
|
||||
with a backlink to the top of the documentation:
|
||||
```markdown
|
||||
<a id="top"></a>
|
||||
# Cool feature
|
||||
e.g. a list
|
||||
|
||||
Text that explains how to use the cool feature.
|
||||
|
||||
|
||||
---
|
||||
|
||||
[Home](Readme.md#top)
|
||||
```
|
||||
* For pages with more than 4 subheadings, we provide a table of contents
|
||||
(ToC) at the top of the page. Because GitHub markdown does not support
|
||||
automatic generation of ToC, it has to be handled semi-manually. Thus,
|
||||
@@ -130,21 +149,54 @@ if you've added a new subheading to some page, you should add it to the
|
||||
ToC. This can be done either manually, or by running the
|
||||
`updateDocumentToC.py` script in the `scripts/` folder.
|
||||
|
||||
### Contents
|
||||
|
||||
Now, for the generic tips:
|
||||
* Usage examples are good
|
||||
* Don't be afraid to introduce new pages
|
||||
* Try to be reasonably consistent with the surrounding documentation
|
||||
Now, for some content tips:
|
||||
|
||||
* Usage examples are good. However, having large code snippets inline
|
||||
can make the documentation less readable, and so the inline snippets
|
||||
should be kept reasonably short. To provide more complex compilable
|
||||
examples, consider adding new .cpp file to `examples/`.
|
||||
|
||||
* Don't be afraid to introduce new pages. The current documentation
|
||||
tends towards long pages, but a lot of that is caused by legacy, and
|
||||
we know that some of the pages are overly big and unfocused.
|
||||
|
||||
* When adding information to an existing page, please try to keep your
|
||||
formatting, style and changes consistent with the rest of the page.
|
||||
|
||||
* Any documentation has multiple different audiences, that desire
|
||||
different information from the text. The 3 basic user-types to try and
|
||||
cover are:
|
||||
* A beginner to Catch2, who requires closer guidance for the usage of Catch2.
|
||||
* Advanced user of Catch2, who want to customize their usage.
|
||||
* Experts, looking for full reference of Catch2's capabilities.
|
||||
|
||||
|
||||
## Writing code
|
||||
|
||||
If want to contribute code, this section contains some simple rules
|
||||
and tips on things like code formatting, code constructions to avoid,
|
||||
and so on.
|
||||
|
||||
|
||||
## Code constructs to watch out for
|
||||
### Formatting
|
||||
|
||||
To make code formatting simpler for the contributors, Catch2 provides
|
||||
its own config for `clang-format`. However, because it is currently
|
||||
impossible to replicate existing Catch2's formatting in clang-format,
|
||||
using it to reformat a whole file would cause massive diffs. To keep
|
||||
the size of your diffs reasonable, you should only use clang-format
|
||||
on the newly changed code.
|
||||
|
||||
|
||||
### Code constructs to watch out for
|
||||
|
||||
This section is a (sadly incomplete) listing of various constructs that
|
||||
are problematic and are not always caught by our CI infrastructure.
|
||||
|
||||
### Naked exceptions and exceptions-related function
|
||||
|
||||
#### Naked exceptions and exceptions-related function
|
||||
|
||||
If you are throwing an exception, it should be done via `CATCH_ERROR`
|
||||
or `CATCH_RUNTIME_ERROR` in `catch_enforce.h`. These macros will handle
|
||||
@@ -155,7 +207,8 @@ CI, but luckily there should not be too many reasons to use these.
|
||||
However, if you do, they should be kept behind a
|
||||
`CATCH_CONFIG_DISABLE_EXCEPTIONS` macro.
|
||||
|
||||
### Unqualified usage of functions from C's stdlib
|
||||
|
||||
#### Unqualified usage of functions from C's stdlib
|
||||
|
||||
If you are using a function from C's stdlib, please include the header
|
||||
as `<cfoo>` and call the function qualified. The common knowledge that
|
||||
@@ -163,7 +216,12 @@ there is no difference is wrong, QNX and VxWorks won't compile if you
|
||||
include the header as `<cfoo>` and call the function unqualified.
|
||||
|
||||
|
||||
----
|
||||
## CoC
|
||||
|
||||
This project has a [CoC](../CODE_OF_CONDUCT.md). Please adhere to it
|
||||
while contributing to Catch2.
|
||||
|
||||
-----------
|
||||
|
||||
_This documentation will always be in-progress as new information comes
|
||||
up, but we are trying to keep it as up to date as possible._
|
||||
|
@@ -12,23 +12,88 @@ are run once per each value in a generator.
|
||||
This is best explained with an example:
|
||||
```cpp
|
||||
TEST_CASE("Generators") {
|
||||
auto i = GENERATE(1, 2, 3);
|
||||
SECTION("one") {
|
||||
auto j = GENERATE( -3, -2, -1 );
|
||||
REQUIRE(j < i);
|
||||
}
|
||||
auto i = GENERATE(1, 3, 5);
|
||||
REQUIRE(is_odd(i));
|
||||
}
|
||||
```
|
||||
|
||||
The assertion in this test case will be run 9 times, because there
|
||||
are 3 possible values for `i` (1, 2, and 3) and there are 3 possible
|
||||
values for `j` (-3, -2, and -1).
|
||||
The "Generators" `TEST_CASE` will be entered 3 times, and the value of
|
||||
`i` will be 1, 3, and 5 in turn. `GENERATE`s can also be used multiple
|
||||
times at the same scope, in which case the result will be a cartesian
|
||||
product of all elements in the generators. This means that in the snippet
|
||||
below, the test case will be run 6 (2\*3) times.
|
||||
|
||||
```cpp
|
||||
TEST_CASE("Generators") {
|
||||
auto i = GENERATE(1, 2);
|
||||
auto j = GENERATE(3, 4, 5);
|
||||
}
|
||||
```
|
||||
|
||||
There are 2 parts to generators in Catch2, the `GENERATE` macro together
|
||||
with the already provided generators, and the `IGenerator<T>` interface
|
||||
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
|
||||
|
||||
Catch2's provided generator functionality consists of three parts,
|
||||
|
@@ -16,6 +16,7 @@
|
||||
- Configuration: [Provide your own output streams](../examples/231-Cfg-OutputStreams.cpp)
|
||||
- Generators: [Create your own generator](../examples/300-Gen-OwnGenerator.cpp)
|
||||
- Generators: [Use map to convert types in GENERATE expression](../examples/301-Gen-MapTypeConversion.cpp)
|
||||
- Generators: [Run test with a table of input values](../examples/302-Gen-Table.cpp)
|
||||
- Generators: [Use variables in generator expressions](../examples/310-Gen-VariablesInGenerators.cpp)
|
||||
- Generators: [Use custom variable capture in generator expressions](../examples/311-Gen-CustomCapture.cpp)
|
||||
|
||||
|
@@ -2,6 +2,11 @@
|
||||
|
||||
# Release notes
|
||||
**Contents**<br>
|
||||
[2.13.2](#2132)<br>
|
||||
[2.13.1](#2131)<br>
|
||||
[2.13.0](#2130)<br>
|
||||
[2.12.4](#2124)<br>
|
||||
[2.12.3](#2123)<br>
|
||||
[2.12.2](#2122)<br>
|
||||
[2.12.1](#2121)<br>
|
||||
[2.12.0](#2120)<br>
|
||||
@@ -38,6 +43,76 @@
|
||||
[Even Older versions](#even-older-versions)<br>
|
||||
|
||||
|
||||
## 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
|
||||
|
||||
### Improvements
|
||||
* Added support for MacOS on ARM (#1971)
|
||||
|
||||
|
||||
## 2.12.3
|
||||
|
||||
### Fixes
|
||||
* `GENERATE` nested in a for loop no longer creates multiple generators (#1913)
|
||||
* Fixed copy paste error breaking `TEMPLATE_TEST_CASE_SIG` for 6 or more arguments (#1954)
|
||||
* Fixed potential UB when handling non-ASCII characters in CLI args (#1943)
|
||||
|
||||
### Improvements
|
||||
* There can be multiple calls to `GENERATE` on a single line
|
||||
* Improved `fno-except` support for platforms that do not provide shims for exception-related std functions (#1950)
|
||||
* E.g. the Green Hills C++ compiler
|
||||
* XmlReporter now also reports test-case-level statistics (#1958)
|
||||
* This is done via a new element, `OverallResultsCases`
|
||||
|
||||
### Miscellaneous
|
||||
* Added `.clang-format` file to the repo (#1182, #1920)
|
||||
* Rewrote contributing docs
|
||||
* They should explain the different levels of testing and so on much better
|
||||
|
||||
|
||||
## 2.12.2
|
||||
|
||||
### Fixes
|
||||
|
@@ -1,7 +1,9 @@
|
||||
// 301-Gen-MapTypeConversion.cpp
|
||||
// Shows how to use map to modify generator's return type.
|
||||
|
||||
// TODO
|
||||
// Specifically we wrap a std::string returning generator with a generator
|
||||
// that converts the strings using stoi, so the returned type is actually
|
||||
// an int.
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
|
54
examples/302-Gen-Table.cpp
Normal file
54
examples/302-Gen-Table.cpp
Normal file
@@ -0,0 +1,54 @@
|
||||
// 302-Gen-Table.cpp
|
||||
// Shows how to use table to run a test many times with different inputs. Lifted from examples on
|
||||
// issue #850.
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <string>
|
||||
|
||||
struct TestSubject {
|
||||
// this is the method we are going to test. It returns the length of the
|
||||
// input string.
|
||||
size_t GetLength( const std::string& input ) const { return input.size(); }
|
||||
};
|
||||
|
||||
|
||||
TEST_CASE("Table allows pre-computed test inputs and outputs", "[example][generator]") {
|
||||
using std::make_tuple;
|
||||
// do setup here as normal
|
||||
TestSubject subj;
|
||||
|
||||
SECTION("This section is run for each row in the table") {
|
||||
std::string test_input;
|
||||
size_t expected_output;
|
||||
std::tie( test_input, expected_output ) =
|
||||
GENERATE( table<std::string, size_t>(
|
||||
{ /* In this case one of the parameters to our test case is the
|
||||
* expected output, but this is not required. There could be
|
||||
* multiple expected values in the table, which can have any
|
||||
* (fixed) number of columns.
|
||||
*/
|
||||
make_tuple( "one", 3 ),
|
||||
make_tuple( "two", 3 ),
|
||||
make_tuple( "three", 5 ),
|
||||
make_tuple( "four", 4 ) } ) );
|
||||
|
||||
// run the test
|
||||
auto result = subj.GetLength(test_input);
|
||||
// capture the input data to go with the outputs.
|
||||
CAPTURE(test_input);
|
||||
// check it matches the pre-calculated data
|
||||
REQUIRE(result == expected_output);
|
||||
} // end section
|
||||
}
|
||||
|
||||
/* Possible simplifications where less legacy toolchain support is needed:
|
||||
*
|
||||
* - With libstdc++6 or newer, the make_tuple() calls can be ommitted
|
||||
* (technically C++17 but does not require -std in GCC/Clang). See
|
||||
* https://stackoverflow.com/questions/12436586/tuple-vector-and-initializer-list
|
||||
*
|
||||
* - In C++17 mode std::tie() and the preceeding variable delcarations can be
|
||||
* replaced by structured bindings: auto [test_input, expected] = GENERATE(
|
||||
* table<std::string, size_t>({ ...
|
||||
*/
|
||||
// Compiling and running this file will result in 4 successful assertions
|
@@ -23,11 +23,11 @@ TEST_CASE("Generate random doubles across different ranges",
|
||||
}));
|
||||
|
||||
auto r2(r1);
|
||||
|
||||
|
||||
// This will take r1 by reference and r2 by value.
|
||||
// Note that there are no advantages for doing so in this example,
|
||||
// it is done only for expository purposes.
|
||||
auto number = Catch::Generators::generate( CATCH_INTERNAL_LINEINFO,
|
||||
auto number = Catch::Generators::generate( "custom capture generator", CATCH_INTERNAL_LINEINFO,
|
||||
[&r1, r2]{
|
||||
using namespace Catch::Generators;
|
||||
return makeGenerators(take(50, random(std::get<0>(r1), std::get<1>(r2))));
|
||||
|
@@ -46,6 +46,7 @@ set( SOURCES_IDIOMATIC_TESTS
|
||||
210-Evt-EventListeners.cpp
|
||||
300-Gen-OwnGenerator.cpp
|
||||
301-Gen-MapTypeConversion.cpp
|
||||
302-Gen-Table.cpp
|
||||
310-Gen-VariablesInGenerators.cpp
|
||||
311-Gen-CustomCapture.cpp
|
||||
)
|
||||
|
@@ -10,7 +10,7 @@
|
||||
#define TWOBLUECUBES_CATCH_HPP_INCLUDED
|
||||
|
||||
#define CATCH_VERSION_MAJOR 2
|
||||
#define CATCH_VERSION_MINOR 12
|
||||
#define CATCH_VERSION_MINOR 13
|
||||
#define CATCH_VERSION_PATCH 2
|
||||
|
||||
#ifdef __clang__
|
||||
|
2
include/external/clara.hpp
vendored
2
include/external/clara.hpp
vendored
@@ -667,7 +667,7 @@ namespace detail {
|
||||
}
|
||||
inline auto convertInto( std::string const &source, bool &target ) -> ParserResult {
|
||||
std::string srcLC = source;
|
||||
std::transform( srcLC.begin(), srcLC.end(), srcLC.begin(), []( char c ) { return static_cast<char>( std::tolower(c) ); } );
|
||||
std::transform( srcLC.begin(), srcLC.end(), srcLC.begin(), []( unsigned char c ) { return static_cast<char>( std::tolower(c) ); } );
|
||||
if (srcLC == "y" || srcLC == "1" || srcLC == "true" || srcLC == "yes" || srcLC == "on")
|
||||
target = true;
|
||||
else if (srcLC == "n" || srcLC == "0" || srcLC == "false" || srcLC == "no" || srcLC == "off")
|
||||
|
@@ -170,6 +170,9 @@ namespace Catch {
|
||||
| Opt( [&]( bool flag ) { config.showDurations = flag ? ShowDurations::Always : ShowDurations::Never; }, "yes|no" )
|
||||
["-d"]["--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" )
|
||||
["-f"]["--input-file"]
|
||||
( "load test names to run from a file" )
|
||||
|
@@ -39,13 +39,9 @@
|
||||
|
||||
#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
|
||||
// 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_STOP_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic pop" )
|
||||
|
||||
@@ -69,7 +65,7 @@
|
||||
// ```
|
||||
//
|
||||
// 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) */
|
||||
# endif
|
||||
|
||||
@@ -153,9 +149,6 @@
|
||||
# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION __pragma( warning(push) )
|
||||
# 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
|
||||
// Or console colours (or console at all...)
|
||||
@@ -240,7 +233,10 @@
|
||||
|
||||
// Check if byte is available and usable
|
||||
# if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
|
||||
# define CATCH_INTERNAL_CONFIG_CPP17_BYTE
|
||||
# include <cstddef>
|
||||
# if __cpp_lib_byte > 0
|
||||
# define CATCH_INTERNAL_CONFIG_CPP17_BYTE
|
||||
# endif
|
||||
# endif // __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
|
||||
|
||||
// Check if variant is available and usable
|
||||
@@ -284,10 +280,6 @@
|
||||
# define CATCH_CONFIG_CPP17_OPTIONAL
|
||||
#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)
|
||||
# define CATCH_CONFIG_CPP17_STRING_VIEW
|
||||
#endif
|
||||
|
@@ -64,6 +64,7 @@ namespace Catch {
|
||||
bool Config::warnAboutMissingAssertions() const { return !!(m_data.warnings & WarnAbout::NoAssertions); }
|
||||
bool Config::warnAboutNoTests() const { return !!(m_data.warnings & WarnAbout::NoTests); }
|
||||
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; }
|
||||
unsigned int Config::rngSeed() const { return m_data.rngSeed; }
|
||||
UseColour::YesOrNo Config::useColour() const { return m_data.useColour; }
|
||||
|
@@ -52,6 +52,7 @@ namespace Catch {
|
||||
Verbosity verbosity = Verbosity::Normal;
|
||||
WarnAbout::What warnings = WarnAbout::Nothing;
|
||||
ShowDurations::OrNot showDurations = ShowDurations::DefaultForReporter;
|
||||
double minDuration = -1;
|
||||
RunTests::InWhatOrder runOrder = RunTests::InDeclarationOrder;
|
||||
UseColour::YesOrNo useColour = UseColour::Auto;
|
||||
WaitForKeypress::When waitForKeypress = WaitForKeypress::Never;
|
||||
@@ -103,6 +104,7 @@ namespace Catch {
|
||||
bool warnAboutMissingAssertions() const override;
|
||||
bool warnAboutNoTests() const override;
|
||||
ShowDurations::OrNot showDurations() const override;
|
||||
double minDuration() const override;
|
||||
RunTests::InWhatOrder runOrder() const override;
|
||||
unsigned int rngSeed() 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
|
@@ -17,7 +17,11 @@ namespace Catch {
|
||||
|
||||
#ifdef CATCH_PLATFORM_MAC
|
||||
|
||||
#define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
#define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
|
||||
#elif defined(__aarch64__)
|
||||
#define CATCH_TRAP() __asm__(".inst 0xd4200000")
|
||||
#endif
|
||||
|
||||
#elif defined(CATCH_PLATFORM_IPHONE)
|
||||
|
||||
|
@@ -24,8 +24,8 @@ namespace Generators {
|
||||
|
||||
GeneratorUntypedBase::~GeneratorUntypedBase() {}
|
||||
|
||||
auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker& {
|
||||
return getResultCapture().acquireGeneratorTracker( lineInfo );
|
||||
auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& {
|
||||
return getResultCapture().acquireGeneratorTracker( generatorName, lineInfo );
|
||||
}
|
||||
|
||||
} // namespace Generators
|
||||
|
@@ -10,6 +10,7 @@
|
||||
#include "catch_interfaces_generatortracker.h"
|
||||
#include "catch_common.h"
|
||||
#include "catch_enforce.h"
|
||||
#include "catch_stringref.h"
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
@@ -181,16 +182,16 @@ namespace Generators {
|
||||
return makeGenerators( value( T( std::forward<U>( val ) ) ), std::forward<Gs>( moreGenerators )... );
|
||||
}
|
||||
|
||||
auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker&;
|
||||
auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker&;
|
||||
|
||||
template<typename L>
|
||||
// Note: The type after -> is weird, because VS2015 cannot parse
|
||||
// the expression used in the typedef inside, when it is in
|
||||
// return type. Yeah.
|
||||
auto generate( SourceLineInfo const& lineInfo, L const& generatorExpression ) -> decltype(std::declval<decltype(generatorExpression())>().get()) {
|
||||
auto generate( StringRef generatorName, SourceLineInfo const& lineInfo, L const& generatorExpression ) -> decltype(std::declval<decltype(generatorExpression())>().get()) {
|
||||
using UnderlyingType = typename decltype(generatorExpression())::type;
|
||||
|
||||
IGeneratorTracker& tracker = acquireGeneratorTracker( lineInfo );
|
||||
IGeneratorTracker& tracker = acquireGeneratorTracker( generatorName, lineInfo );
|
||||
if (!tracker.hasGenerator()) {
|
||||
tracker.setGenerator(pf::make_unique<Generators<UnderlyingType>>(generatorExpression()));
|
||||
}
|
||||
@@ -203,10 +204,16 @@ namespace Generators {
|
||||
} // namespace Catch
|
||||
|
||||
#define GENERATE( ... ) \
|
||||
Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [ ]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
|
||||
Catch::Generators::generate( INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_UNIQUE_NAME(generator)), \
|
||||
CATCH_INTERNAL_LINEINFO, \
|
||||
[ ]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
|
||||
#define GENERATE_COPY( ... ) \
|
||||
Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [=]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
|
||||
Catch::Generators::generate( INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_UNIQUE_NAME(generator)), \
|
||||
CATCH_INTERNAL_LINEINFO, \
|
||||
[=]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
|
||||
#define GENERATE_REF( ... ) \
|
||||
Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [&]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
|
||||
Catch::Generators::generate( INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_UNIQUE_NAME(generator)), \
|
||||
CATCH_INTERNAL_LINEINFO, \
|
||||
[&]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_GENERATORS_HPP_INCLUDED
|
||||
|
@@ -44,7 +44,7 @@ namespace Catch {
|
||||
virtual void sectionEnded( SectionEndInfo const& endInfo ) = 0;
|
||||
virtual void sectionEndedEarly( SectionEndInfo const& endInfo ) = 0;
|
||||
|
||||
virtual auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker& = 0;
|
||||
virtual auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& = 0;
|
||||
|
||||
#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
|
||||
virtual void benchmarkPreparing( std::string const& name ) = 0;
|
||||
|
@@ -69,6 +69,7 @@ namespace Catch {
|
||||
virtual int abortAfter() const = 0;
|
||||
virtual bool showInvisibles() const = 0;
|
||||
virtual ShowDurations::OrNot showDurations() const = 0;
|
||||
virtual double minDuration() const = 0;
|
||||
virtual TestSpec const& testSpec() const = 0;
|
||||
virtual bool hasTestFilters() const = 0;
|
||||
virtual std::vector<std::string> const& getTestsOrTags() const = 0;
|
||||
|
@@ -66,7 +66,7 @@ namespace Catch {
|
||||
if (tmpnam_s(m_buffer)) {
|
||||
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];
|
||||
if (strerror_s(buffer, errno)) {
|
||||
CATCH_RUNTIME_ERROR("Could not translate errno to a string");
|
||||
|
@@ -1,3 +1,4 @@
|
||||
|
||||
/*
|
||||
* Created by Jozef on 12/11/2018.
|
||||
* Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
|
||||
@@ -90,7 +91,7 @@
|
||||
#define INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_0, _1, _2, _3) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_1, _2, _3)
|
||||
#define INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_0, _1, _2, _3, _4) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_1, _2, _3, _4)
|
||||
#define INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_0, _1, _2, _3, _4, _5) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_1, _2, _3, _4, _5)
|
||||
#define INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_0, _1, _2, _3, _4, _5, _6) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_1, _2, _4, _5, _6)
|
||||
#define INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_0, _1, _2, _3, _4, _5, _6) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_1, _2, _3, _4, _5, _6)
|
||||
#define INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_0, _1, _2, _3, _4, _5, _6, _7) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_1, _2, _3, _4, _5, _6, _7)
|
||||
#define INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_1, _2, _3, _4, _5, _6, _7, _8)
|
||||
#define INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9)
|
||||
|
@@ -59,7 +59,11 @@ namespace Catch {
|
||||
m_tagAliasRegistry.add( alias, tag, lineInfo );
|
||||
}
|
||||
void registerStartupException() noexcept override {
|
||||
#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
|
||||
m_exceptionRegistry.add(std::current_exception());
|
||||
#else
|
||||
CATCH_INTERNAL_ERROR("Attempted to register active exception under CATCH_CONFIG_DISABLE_EXCEPTIONS!");
|
||||
#endif
|
||||
}
|
||||
IMutableEnumValuesRegistry& getMutableEnumValuesRegistry() override {
|
||||
return m_enumValuesRegistry;
|
||||
|
@@ -25,17 +25,32 @@ namespace Catch {
|
||||
std::shared_ptr<GeneratorTracker> tracker;
|
||||
|
||||
ITracker& currentTracker = ctx.currentTracker();
|
||||
if( TestCaseTracking::ITrackerPtr childTracker = currentTracker.findChild( nameAndLocation ) ) {
|
||||
// Under specific circumstances, the generator we want
|
||||
// to acquire is also the current tracker. If this is
|
||||
// the case, we have to avoid looking through current
|
||||
// tracker's children, and instead return the current
|
||||
// tracker.
|
||||
// A case where this check is important is e.g.
|
||||
// for (int i = 0; i < 5; ++i) {
|
||||
// int n = GENERATE(1, 2);
|
||||
// }
|
||||
//
|
||||
// without it, the code above creates 5 nested generators.
|
||||
if (currentTracker.nameAndLocation() == nameAndLocation) {
|
||||
auto thisTracker = currentTracker.parent().findChild(nameAndLocation);
|
||||
assert(thisTracker);
|
||||
assert(thisTracker->isGeneratorTracker());
|
||||
tracker = std::static_pointer_cast<GeneratorTracker>(thisTracker);
|
||||
} else if ( TestCaseTracking::ITrackerPtr childTracker = currentTracker.findChild( nameAndLocation ) ) {
|
||||
assert( childTracker );
|
||||
assert( childTracker->isGeneratorTracker() );
|
||||
tracker = std::static_pointer_cast<GeneratorTracker>( childTracker );
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
tracker = std::make_shared<GeneratorTracker>( nameAndLocation, ctx, ¤tTracker );
|
||||
currentTracker.addChild( tracker );
|
||||
}
|
||||
|
||||
if( !ctx.completedCycle() && !tracker->isComplete() ) {
|
||||
if( !tracker->isComplete() ) {
|
||||
tracker->open();
|
||||
}
|
||||
|
||||
@@ -49,8 +64,28 @@ namespace Catch {
|
||||
}
|
||||
void close() override {
|
||||
TrackerBase::close();
|
||||
// Generator interface only finds out if it has another item on atual move
|
||||
if (m_runState == CompletedSuccessfully && m_generator->next()) {
|
||||
// If a generator has a child (it is followed by a section)
|
||||
// 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 =
|
||||
!m_children.empty() &&
|
||||
std::find_if( m_children.begin(),
|
||||
m_children.end(),
|
||||
[]( TestCaseTracking::ITrackerPtr tracker ) {
|
||||
return tracker->hasStarted();
|
||||
} ) == m_children.end();
|
||||
|
||||
// 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_runState = Executing;
|
||||
}
|
||||
@@ -187,10 +222,10 @@ namespace Catch {
|
||||
|
||||
return true;
|
||||
}
|
||||
auto RunContext::acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker& {
|
||||
auto RunContext::acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& {
|
||||
using namespace Generators;
|
||||
GeneratorTracker& tracker = GeneratorTracker::acquire( m_trackerContext, TestCaseTracking::NameAndLocation( "generator", lineInfo ) );
|
||||
assert( tracker.isOpen() );
|
||||
GeneratorTracker& tracker = GeneratorTracker::acquire(m_trackerContext,
|
||||
TestCaseTracking::NameAndLocation( static_cast<std::string>(generatorName), lineInfo ) );
|
||||
m_lastAssertionInfo.lineInfo = lineInfo;
|
||||
return tracker;
|
||||
}
|
||||
@@ -233,17 +268,17 @@ namespace Catch {
|
||||
|
||||
#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
|
||||
void RunContext::benchmarkPreparing(std::string const& name) {
|
||||
m_reporter->benchmarkPreparing(name);
|
||||
}
|
||||
m_reporter->benchmarkPreparing(name);
|
||||
}
|
||||
void RunContext::benchmarkStarting( BenchmarkInfo const& info ) {
|
||||
m_reporter->benchmarkStarting( info );
|
||||
}
|
||||
void RunContext::benchmarkEnded( BenchmarkStats<> const& stats ) {
|
||||
m_reporter->benchmarkEnded( stats );
|
||||
}
|
||||
void RunContext::benchmarkFailed(std::string const & error) {
|
||||
m_reporter->benchmarkFailed(error);
|
||||
}
|
||||
void RunContext::benchmarkFailed(std::string const & error) {
|
||||
m_reporter->benchmarkFailed(error);
|
||||
}
|
||||
#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
|
||||
|
||||
void RunContext::pushScopedMessage(MessageInfo const & message) {
|
||||
|
@@ -80,7 +80,7 @@ namespace Catch {
|
||||
void sectionEnded( SectionEndInfo const& endInfo ) override;
|
||||
void sectionEndedEarly( SectionEndInfo const& endInfo ) override;
|
||||
|
||||
auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker& override;
|
||||
auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& override;
|
||||
|
||||
#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
|
||||
void benchmarkPreparing( std::string const& name ) override;
|
||||
|
@@ -9,6 +9,7 @@
|
||||
#include "catch_startup_exception_registry.h"
|
||||
#include "catch_compiler_capabilities.h"
|
||||
|
||||
#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
|
||||
namespace Catch {
|
||||
void StartupExceptionRegistry::add( std::exception_ptr const& exception ) noexcept {
|
||||
CATCH_TRY {
|
||||
@@ -24,3 +25,4 @@ void StartupExceptionRegistry::add( std::exception_ptr const& exception ) noexce
|
||||
}
|
||||
|
||||
} // end namespace Catch
|
||||
#endif
|
||||
|
@@ -15,11 +15,13 @@
|
||||
namespace Catch {
|
||||
|
||||
class StartupExceptionRegistry {
|
||||
#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
|
||||
public:
|
||||
void add(std::exception_ptr const& exception) noexcept;
|
||||
std::vector<std::exception_ptr> const& getExceptions() const noexcept;
|
||||
private:
|
||||
std::vector<std::exception_ptr> m_exceptions;
|
||||
#endif
|
||||
};
|
||||
|
||||
} // end namespace Catch
|
||||
|
@@ -18,7 +18,7 @@ namespace Catch {
|
||||
|
||||
namespace {
|
||||
char toLowerCh(char c) {
|
||||
return static_cast<char>( std::tolower( c ) );
|
||||
return static_cast<char>( std::tolower( static_cast<unsigned char>(c) ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -22,10 +22,10 @@ namespace Catch {
|
||||
|
||||
namespace {
|
||||
struct TestHasher {
|
||||
explicit TestHasher(Catch::SimplePcg32& rng) {
|
||||
basis = rng();
|
||||
explicit TestHasher(Catch::SimplePcg32& rng_instance) {
|
||||
basis = rng_instance();
|
||||
basis <<= 32;
|
||||
basis |= rng();
|
||||
basis |= rng_instance();
|
||||
}
|
||||
|
||||
uint64_t basis;
|
||||
|
@@ -65,15 +65,12 @@ namespace TestCaseTracking {
|
||||
}
|
||||
|
||||
|
||||
TrackerBase::TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent )
|
||||
: m_nameAndLocation( nameAndLocation ),
|
||||
TrackerBase::TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent ):
|
||||
ITracker(nameAndLocation),
|
||||
m_ctx( ctx ),
|
||||
m_parent( parent )
|
||||
{}
|
||||
|
||||
NameAndLocation const& TrackerBase::nameAndLocation() const {
|
||||
return m_nameAndLocation;
|
||||
}
|
||||
bool TrackerBase::isComplete() const {
|
||||
return m_runState == CompletedSuccessfully || m_runState == Failed;
|
||||
}
|
||||
@@ -190,7 +187,8 @@ namespace TestCaseTracking {
|
||||
bool SectionTracker::isComplete() const {
|
||||
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()) {
|
||||
complete = TrackerBase::isComplete();
|
||||
}
|
||||
|
@@ -23,23 +23,39 @@ namespace TestCaseTracking {
|
||||
SourceLineInfo location;
|
||||
|
||||
NameAndLocation( std::string const& _name, SourceLineInfo const& _location );
|
||||
friend bool operator==(NameAndLocation const& lhs, NameAndLocation const& rhs) {
|
||||
return lhs.name == rhs.name
|
||||
&& lhs.location == rhs.location;
|
||||
}
|
||||
};
|
||||
|
||||
struct ITracker;
|
||||
class ITracker;
|
||||
|
||||
using ITrackerPtr = std::shared_ptr<ITracker>;
|
||||
|
||||
struct ITracker {
|
||||
virtual ~ITracker();
|
||||
class ITracker {
|
||||
NameAndLocation m_nameAndLocation;
|
||||
|
||||
public:
|
||||
ITracker(NameAndLocation const& nameAndLoc) :
|
||||
m_nameAndLocation(nameAndLoc)
|
||||
{}
|
||||
|
||||
|
||||
// static queries
|
||||
virtual NameAndLocation const& nameAndLocation() const = 0;
|
||||
NameAndLocation const& nameAndLocation() const {
|
||||
return m_nameAndLocation;
|
||||
}
|
||||
|
||||
virtual ~ITracker();
|
||||
|
||||
|
||||
// dynamic queries
|
||||
virtual bool isComplete() const = 0; // Successfully completed or failed
|
||||
virtual bool isSuccessfullyCompleted() const = 0;
|
||||
virtual bool isOpen() const = 0; // Started but not complete
|
||||
virtual bool hasChildren() const = 0;
|
||||
virtual bool hasStarted() const = 0;
|
||||
|
||||
virtual ITracker& parent() = 0;
|
||||
|
||||
@@ -94,7 +110,6 @@ namespace TestCaseTracking {
|
||||
};
|
||||
|
||||
using Children = std::vector<ITrackerPtr>;
|
||||
NameAndLocation m_nameAndLocation;
|
||||
TrackerContext& m_ctx;
|
||||
ITracker* m_parent;
|
||||
Children m_children;
|
||||
@@ -103,12 +118,13 @@ namespace TestCaseTracking {
|
||||
public:
|
||||
TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent );
|
||||
|
||||
NameAndLocation const& nameAndLocation() const override;
|
||||
bool isComplete() const override;
|
||||
bool isSuccessfullyCompleted() const override;
|
||||
bool isOpen() const override;
|
||||
bool hasChildren() const override;
|
||||
|
||||
bool hasStarted() const override {
|
||||
return m_runState != NotStarted;
|
||||
}
|
||||
|
||||
void addChild( ITrackerPtr const& child ) override;
|
||||
|
||||
|
@@ -160,7 +160,7 @@ struct AutoReg : NonCopyable {
|
||||
int index = 0; \
|
||||
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
|
||||
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 ) = [](){\
|
||||
@@ -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* 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]);\
|
||||
(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 ) = [](){ \
|
||||
@@ -250,7 +250,7 @@ struct AutoReg : NonCopyable {
|
||||
void reg_tests() { \
|
||||
int index = 0; \
|
||||
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 ) = [](){ \
|
||||
@@ -285,7 +285,7 @@ struct AutoReg : NonCopyable {
|
||||
int index = 0; \
|
||||
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
|
||||
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 ) = [](){\
|
||||
@@ -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* 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]);\
|
||||
(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 ) = [](){\
|
||||
@@ -381,7 +381,7 @@ struct AutoReg : NonCopyable {
|
||||
void reg_tests(){\
|
||||
int index = 0;\
|
||||
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 ) = [](){\
|
||||
|
@@ -309,8 +309,8 @@ namespace Catch {
|
||||
#endif
|
||||
|
||||
namespace Detail {
|
||||
template<typename InputIterator>
|
||||
std::string rangeToString(InputIterator first, InputIterator last) {
|
||||
template<typename InputIterator, typename Sentinel = InputIterator>
|
||||
std::string rangeToString(InputIterator first, Sentinel last) {
|
||||
ReusableStringStream rss;
|
||||
rss << "{ ";
|
||||
if (first != last) {
|
||||
|
@@ -8,11 +8,15 @@
|
||||
|
||||
#include "catch_compiler_capabilities.h"
|
||||
#include "catch_uncaught_exceptions.h"
|
||||
#include "catch_config_uncaught_exceptions.hpp"
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace Catch {
|
||||
bool uncaught_exceptions() {
|
||||
#if defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
|
||||
#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
|
||||
return false;
|
||||
#elif defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
|
||||
return std::uncaught_exceptions() > 0;
|
||||
#else
|
||||
return std::uncaught_exception();
|
||||
|
@@ -37,7 +37,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
Version const& libraryVersion() {
|
||||
static Version version( 2, 12, 2, "", 0 );
|
||||
static Version version( 2, 13, 2, "", 0 );
|
||||
return version;
|
||||
}
|
||||
|
||||
|
@@ -41,6 +41,17 @@ namespace Catch {
|
||||
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 ) {
|
||||
ReusableStringStream oss;
|
||||
bool first = true;
|
||||
|
@@ -25,6 +25,9 @@ namespace Catch {
|
||||
// Returns double formatted as %.3f (format expected on output)
|
||||
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 );
|
||||
|
||||
template<typename DerivedT>
|
||||
@@ -52,7 +55,7 @@ namespace Catch {
|
||||
void noMatchingTestCases(std::string const&) override {}
|
||||
|
||||
void reportInvalidArguments(std::string const&) override {}
|
||||
|
||||
|
||||
void testRunStarting(TestRunInfo const& _testRunInfo) override {
|
||||
currentTestRunInfo = _testRunInfo;
|
||||
}
|
||||
|
@@ -245,10 +245,6 @@ private:
|
||||
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 ) {
|
||||
stream << "No test cases matched '" << spec << '\'' << std::endl;
|
||||
}
|
||||
@@ -275,8 +271,9 @@ private:
|
||||
}
|
||||
|
||||
void CompactReporter::sectionEnded(SectionStats const& _sectionStats) {
|
||||
if (m_config->showDurations() == ShowDurations::Always) {
|
||||
stream << getFormattedDuration(_sectionStats.durationInSeconds) << " s: " << _sectionStats.sectionInfo.name << std::endl;
|
||||
double dur = _sectionStats.durationInSeconds;
|
||||
if ( shouldShowDuration( *m_config, dur ) ) {
|
||||
stream << getFormattedDuration( dur ) << " s: " << _sectionStats.sectionInfo.name << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -22,8 +22,6 @@ namespace Catch {
|
||||
|
||||
static std::string getDescription();
|
||||
|
||||
ReporterPreferences getPreferences() const override;
|
||||
|
||||
void noMatchingTestCases(std::string const& spec) override;
|
||||
|
||||
void assertionStarting(AssertionInfo const&) override;
|
||||
|
@@ -418,8 +418,9 @@ void ConsoleReporter::sectionEnded(SectionStats const& _sectionStats) {
|
||||
stream << "\nNo assertions in test case";
|
||||
stream << " '" << _sectionStats.sectionInfo.name << "'\n" << std::endl;
|
||||
}
|
||||
if (m_config->showDurations() == ShowDurations::Always) {
|
||||
stream << getFormattedDuration(_sectionStats.durationInSeconds) << " s: " << _sectionStats.sectionInfo.name << std::endl;
|
||||
double dur = _sectionStats.durationInSeconds;
|
||||
if (shouldShowDuration(*m_config, dur)) {
|
||||
stream << getFormattedDuration(dur) << " s: " << _sectionStats.sectionInfo.name << std::endl;
|
||||
}
|
||||
if (m_headerPrinted) {
|
||||
m_headerPrinted = false;
|
||||
|
@@ -23,16 +23,17 @@ namespace Catch {
|
||||
|
||||
using StreamingReporterBase::StreamingReporterBase;
|
||||
|
||||
TAPReporter( ReporterConfig const& config ):
|
||||
StreamingReporterBase( config ) {
|
||||
m_reporterPrefs.shouldReportAllAssertions = true;
|
||||
}
|
||||
|
||||
~TAPReporter() override;
|
||||
|
||||
static std::string getDescription() {
|
||||
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 {
|
||||
stream << "# No test cases matched '" << spec << "'" << std::endl;
|
||||
}
|
||||
@@ -203,16 +204,15 @@ namespace Catch {
|
||||
return;
|
||||
}
|
||||
|
||||
// using messages.end() directly (or auto) yields compilation error:
|
||||
std::vector<MessageInfo>::const_iterator itEnd = messages.end();
|
||||
const std::size_t N = static_cast<std::size_t>( std::distance( itMessage, itEnd ) );
|
||||
const auto itEnd = messages.cend();
|
||||
const auto N = static_cast<std::size_t>( std::distance( itMessage, itEnd ) );
|
||||
|
||||
{
|
||||
Colour colourGuard( colour );
|
||||
stream << " with " << pluralise( N, "message" ) << ":";
|
||||
}
|
||||
|
||||
for(; itMessage != itEnd; ) {
|
||||
while( itMessage != itEnd ) {
|
||||
// If this assertion is a warning ignore any INFO messages
|
||||
if( printInfoMessages || itMessage->type != ResultWas::Info ) {
|
||||
stream << " '" << itMessage->message << "'";
|
||||
@@ -220,7 +220,9 @@ namespace Catch {
|
||||
Colour colourGuard( dimColour() );
|
||||
stream << " and";
|
||||
}
|
||||
continue;
|
||||
}
|
||||
++itMessage;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,10 +236,9 @@ namespace Catch {
|
||||
};
|
||||
|
||||
void printTotals( const Totals& totals ) const {
|
||||
stream << "1.." << totals.assertions.total();
|
||||
if( totals.testCases.total() == 0 ) {
|
||||
stream << "1..0 # Skipped: No tests ran.";
|
||||
} else {
|
||||
stream << "1.." << counter;
|
||||
stream << " # Skipped: No tests ran.";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@@ -207,6 +207,10 @@ namespace Catch {
|
||||
.writeAttribute( "successes", testGroupStats.totals.assertions.passed )
|
||||
.writeAttribute( "failures", testGroupStats.totals.assertions.failed )
|
||||
.writeAttribute( "expectedFailures", testGroupStats.totals.assertions.failedButOk );
|
||||
m_xml.scopedElement( "OverallResultsCases")
|
||||
.writeAttribute( "successes", testGroupStats.totals.testCases.passed )
|
||||
.writeAttribute( "failures", testGroupStats.totals.testCases.failed )
|
||||
.writeAttribute( "expectedFailures", testGroupStats.totals.testCases.failedButOk );
|
||||
m_xml.endElement();
|
||||
}
|
||||
|
||||
@@ -216,6 +220,10 @@ namespace Catch {
|
||||
.writeAttribute( "successes", testRunStats.totals.assertions.passed )
|
||||
.writeAttribute( "failures", testRunStats.totals.assertions.failed )
|
||||
.writeAttribute( "expectedFailures", testRunStats.totals.assertions.failedButOk );
|
||||
m_xml.scopedElement( "OverallResultsCases")
|
||||
.writeAttribute( "successes", testRunStats.totals.testCases.passed )
|
||||
.writeAttribute( "failures", testRunStats.totals.testCases.failed )
|
||||
.writeAttribute( "expectedFailures", testRunStats.totals.testCases.failedButOk );
|
||||
m_xml.endElement();
|
||||
}
|
||||
|
||||
|
@@ -27,6 +27,7 @@ set(TEST_SOURCES
|
||||
${SELF_TEST_DIR}/IntrospectiveTests/StringManip.tests.cpp
|
||||
${SELF_TEST_DIR}/IntrospectiveTests/Xml.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/BDD.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_compiler_capabilities.h
|
||||
${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_context.h
|
||||
${HEADER_DIR}/internal/catch_debug_console.h
|
||||
|
@@ -10,6 +10,40 @@ project( Catch2ExtraTests LANGUAGES CXX )
|
||||
|
||||
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:
|
||||
|
||||
set( TESTS_DIR ${CATCH_DIR}/projects/ExtraTests )
|
||||
|
@@ -30,6 +30,57 @@ CmdLine.tests.cpp:<line number>: passed: spec.matches(fakeTestCase(R"(spec {a} c
|
||||
CmdLine.tests.cpp:<line number>: passed: spec.matches(fakeTestCase(R"(spec [a] char)")) for: true
|
||||
CmdLine.tests.cpp:<line number>: passed: !(spec.matches(fakeTestCase("differs but has similar tag", "[a]"))) for: !false
|
||||
CmdLine.tests.cpp:<line number>: passed: spec.matches(fakeTestCase(R"(spec \ char)")) for: true
|
||||
Generators.tests.cpp:<line number>: passed: counter < 7 for: 3 < 7
|
||||
Generators.tests.cpp:<line number>: passed: counter < 7 for: 6 < 7
|
||||
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: 2 != 3
|
||||
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:
|
||||
Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'answer := 42' with 1 message: 'expected exception'
|
||||
Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'answer := 42'; expression was: thisThrows() with 1 message: 'expected exception'
|
||||
Exception.tests.cpp:<line number>: passed: thisThrows() with 1 message: 'answer := 42'
|
||||
@@ -326,6 +377,12 @@ Condition.tests.cpp:<line number>: passed: 6 == uc for: 6 == 6
|
||||
Condition.tests.cpp:<line number>: passed: (std::numeric_limits<uint32_t>::max)() > ul for: 4294967295 (0x<hex digits>) > 4
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching2(), !composed1 for: "some completely different text that contains one common word" not ( contains: "string" or contains: "random" )
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching2(), composed2 for: "some completely different text that contains one common word" ( contains: "string" or contains: "random" or contains: "different" )
|
||||
Matchers.tests.cpp:<line number>: passed: 1, !(first && second) for: 1 not ( CheckedTestingMatcher set to fail and CheckedTestingMatcher set to fail )
|
||||
Matchers.tests.cpp:<line number>: passed: first.matchCalled for: true
|
||||
Matchers.tests.cpp:<line number>: passed: !second.matchCalled for: true
|
||||
Matchers.tests.cpp:<line number>: passed: 1, first || second for: 1 ( CheckedTestingMatcher set to succeed or CheckedTestingMatcher set to fail )
|
||||
Matchers.tests.cpp:<line number>: passed: first.matchCalled for: true
|
||||
Matchers.tests.cpp:<line number>: passed: !second.matchCalled for: true
|
||||
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Contains("not there", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" contains: "not there" (case insensitive)
|
||||
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Contains("STRING") for: "this string contains 'abc' as a substring" contains: "STRING"
|
||||
Generators.tests.cpp:<line number>: passed: elem % 2 == 1 for: 1 == 1
|
||||
@@ -1146,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: 2 >= 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!
|
||||
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
|
||||
|
@@ -1380,6 +1380,6 @@ due to unexpected exception with message:
|
||||
Why would you throw a std::string?
|
||||
|
||||
===============================================================================
|
||||
test cases: 310 | 236 passed | 70 failed | 4 failed as expected
|
||||
assertions: 1701 | 1549 passed | 131 failed | 21 failed as expected
|
||||
test cases: 322 | 248 passed | 70 failed | 4 failed as expected
|
||||
assertions: 1759 | 1607 passed | 131 failed | 21 failed as expected
|
||||
|
||||
|
@@ -243,6 +243,514 @@ CmdLine.tests.cpp:<line number>: PASSED:
|
||||
with expansion:
|
||||
true
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#1913 - GENERATE inside a for loop should not keep recreating the generator
|
||||
-------------------------------------------------------------------------------
|
||||
Generators.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Generators.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( counter < 7 )
|
||||
with expansion:
|
||||
3 < 7
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#1913 - GENERATE inside a for loop should not keep recreating the generator
|
||||
-------------------------------------------------------------------------------
|
||||
Generators.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Generators.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( counter < 7 )
|
||||
with expansion:
|
||||
6 < 7
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#1913 - GENERATEs can share a line
|
||||
-------------------------------------------------------------------------------
|
||||
Generators.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Generators.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( i != j )
|
||||
with expansion:
|
||||
1 != 3
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#1913 - GENERATEs can share a line
|
||||
-------------------------------------------------------------------------------
|
||||
Generators.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Generators.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( i != j )
|
||||
with expansion:
|
||||
1 != 4
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#1913 - GENERATEs can share a line
|
||||
-------------------------------------------------------------------------------
|
||||
Generators.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Generators.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( i != j )
|
||||
with expansion:
|
||||
2 != 3
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#1913 - GENERATEs can share a line
|
||||
-------------------------------------------------------------------------------
|
||||
Generators.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Generators.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( i != j )
|
||||
with expansion:
|
||||
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
|
||||
-------------------------------------------------------------------------------
|
||||
Misc.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Misc.tests.cpp:<line number>: PASSED:
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0
|
||||
-------------------------------------------------------------------------------
|
||||
Misc.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Misc.tests.cpp:<line number>: PASSED:
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0
|
||||
-------------------------------------------------------------------------------
|
||||
Misc.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Misc.tests.cpp:<line number>: PASSED:
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#748 - captures with unexpected exceptions
|
||||
outside assertions
|
||||
@@ -2494,6 +3002,52 @@ with expansion:
|
||||
"some completely different text that contains one common word" ( contains:
|
||||
"string" or contains: "random" or contains: "different" )
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Composed matchers shortcircuit
|
||||
&&
|
||||
-------------------------------------------------------------------------------
|
||||
Matchers.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( 1, !(first && second) )
|
||||
with expansion:
|
||||
1 not ( CheckedTestingMatcher set to fail and CheckedTestingMatcher set to
|
||||
fail )
|
||||
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( first.matchCalled )
|
||||
with expansion:
|
||||
true
|
||||
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( !second.matchCalled )
|
||||
with expansion:
|
||||
true
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Composed matchers shortcircuit
|
||||
||
|
||||
-------------------------------------------------------------------------------
|
||||
Matchers.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( 1, first || second )
|
||||
with expansion:
|
||||
1 ( CheckedTestingMatcher set to succeed or CheckedTestingMatcher set to fail
|
||||
)
|
||||
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( first.matchCalled )
|
||||
with expansion:
|
||||
true
|
||||
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( !second.matchCalled )
|
||||
with expansion:
|
||||
true
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Contains string matcher
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -8341,6 +8895,17 @@ Misc.tests.cpp:<line number>: PASSED:
|
||||
with expansion:
|
||||
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
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -13573,6 +14138,6 @@ Misc.tests.cpp:<line number>
|
||||
Misc.tests.cpp:<line number>: PASSED:
|
||||
|
||||
===============================================================================
|
||||
test cases: 310 | 220 passed | 86 failed | 4 failed as expected
|
||||
assertions: 1718 | 1549 passed | 148 failed | 21 failed as expected
|
||||
test cases: 322 | 232 passed | 86 failed | 4 failed as expected
|
||||
assertions: 1776 | 1607 passed | 148 failed | 21 failed as expected
|
||||
|
||||
|
@@ -243,6 +243,514 @@ CmdLine.tests.cpp:<line number>: PASSED:
|
||||
with expansion:
|
||||
true
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#1913 - GENERATE inside a for loop should not keep recreating the generator
|
||||
-------------------------------------------------------------------------------
|
||||
Generators.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Generators.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( counter < 7 )
|
||||
with expansion:
|
||||
3 < 7
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#1913 - GENERATE inside a for loop should not keep recreating the generator
|
||||
-------------------------------------------------------------------------------
|
||||
Generators.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Generators.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( counter < 7 )
|
||||
with expansion:
|
||||
6 < 7
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#1913 - GENERATEs can share a line
|
||||
-------------------------------------------------------------------------------
|
||||
Generators.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Generators.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( i != j )
|
||||
with expansion:
|
||||
1 != 3
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#1913 - GENERATEs can share a line
|
||||
-------------------------------------------------------------------------------
|
||||
Generators.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Generators.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( i != j )
|
||||
with expansion:
|
||||
1 != 4
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#1913 - GENERATEs can share a line
|
||||
-------------------------------------------------------------------------------
|
||||
Generators.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Generators.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( i != j )
|
||||
with expansion:
|
||||
2 != 3
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#1913 - GENERATEs can share a line
|
||||
-------------------------------------------------------------------------------
|
||||
Generators.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Generators.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( i != j )
|
||||
with expansion:
|
||||
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
|
||||
-------------------------------------------------------------------------------
|
||||
Misc.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Misc.tests.cpp:<line number>: PASSED:
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0
|
||||
-------------------------------------------------------------------------------
|
||||
Misc.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Misc.tests.cpp:<line number>: PASSED:
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0
|
||||
-------------------------------------------------------------------------------
|
||||
Misc.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Misc.tests.cpp:<line number>: PASSED:
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#748 - captures with unexpected exceptions
|
||||
outside assertions
|
||||
@@ -423,6 +931,6 @@ Condition.tests.cpp:<line number>: FAILED:
|
||||
CHECK( true != true )
|
||||
|
||||
===============================================================================
|
||||
test cases: 21 | 16 passed | 3 failed | 2 failed as expected
|
||||
assertions: 49 | 42 passed | 4 failed | 3 failed as expected
|
||||
test cases: 31 | 26 passed | 3 failed | 2 failed as expected
|
||||
assertions: 100 | 93 passed | 4 failed | 3 failed as expected
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuitesloose text artifact
|
||||
>
|
||||
<testsuite name="<exe-name>" errors="17" failures="132" tests="1719" 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>
|
||||
<property name="filters" value="~[!nonportable]~[!benchmark]~[approvals]"/>
|
||||
<property name="random-seed" value="1"/>
|
||||
@@ -33,6 +33,20 @@ Nor would this
|
||||
<testcase classname="<exe-name>.global" name="#1905 -- test spec parser properly clears internal state between compound tests" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="#1912 -- test spec parser handles escaping/Various parentheses" 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 - 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 - 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="#748 - captures with unexpected exceptions/outside assertions" time="{duration}" status="run">
|
||||
<error type="TEST_CASE">
|
||||
FAILED:
|
||||
@@ -361,6 +375,8 @@ Exception.tests.cpp:<line number>
|
||||
<testcase classname="<exe-name>.global" name="Comparisons between unsigned ints and negative signed ints match c++ standard behaviour" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Comparisons with int literals don't warn when mixing signed/ unsigned" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Composed matchers are distinct" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Composed matchers shortcircuit/&&" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Composed matchers shortcircuit/||" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Contains string matcher" time="{duration}" status="run">
|
||||
<failure message="testStringForMatching(), Contains("not there", Catch::CaseSensitive::No)" type="CHECK_THAT">
|
||||
FAILED:
|
||||
@@ -1029,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>" 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">
|
||||
<failure message="truthy(false)" type="CHECK">
|
||||
FAILED:
|
||||
|
@@ -99,6 +99,15 @@
|
||||
<testCase name="Generators internals/Range/Negative manual step/Integer/Slightly under end" duration="{duration}"/>
|
||||
</file>
|
||||
<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/successfully close one section" duration="{duration}"/>
|
||||
<testCase name="Tracker/fail one section" duration="{duration}"/>
|
||||
@@ -153,6 +162,7 @@
|
||||
</file>
|
||||
<file path="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp">
|
||||
<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/One enum value" duration="{duration}"/>
|
||||
<testCase name="parseEnums/Multiple enum values" duration="{duration}"/>
|
||||
@@ -875,6 +885,8 @@ Exception.tests.cpp:<line number>
|
||||
</testCase>
|
||||
</file>
|
||||
<file path="projects/<exe-name>/UsageTests/Generators.tests.cpp">
|
||||
<testCase name="#1913 - GENERATE inside a for loop should not keep recreating the generator" duration="{duration}"/>
|
||||
<testCase name="#1913 - GENERATEs can share a line" duration="{duration}"/>
|
||||
<testCase name="3x3x3 ints" duration="{duration}"/>
|
||||
<testCase name="Copy and then generate a range/from var and iterators" duration="{duration}"/>
|
||||
<testCase name="Copy and then generate a range/From a temporary container" duration="{duration}"/>
|
||||
@@ -900,6 +912,8 @@ Exception.tests.cpp:<line number>
|
||||
<testCase name="Arbitrary predicate matcher/Function pointer" duration="{duration}"/>
|
||||
<testCase name="Arbitrary predicate matcher/Lambdas + different type" duration="{duration}"/>
|
||||
<testCase name="Composed matchers are distinct" duration="{duration}"/>
|
||||
<testCase name="Composed matchers shortcircuit/&&" duration="{duration}"/>
|
||||
<testCase name="Composed matchers shortcircuit/||" duration="{duration}"/>
|
||||
<testCase name="Contains string matcher" duration="{duration}">
|
||||
<failure message="CHECK_THAT(testStringForMatching(), Contains("not there", Catch::CaseSensitive::No))">
|
||||
FAILED:
|
||||
@@ -1350,6 +1364,9 @@ Message.tests.cpp:<line number>
|
||||
<file path="projects/<exe-name>/UsageTests/Misc.tests.cpp">
|
||||
<testCase name="# A test name that starts with a #" duration="{duration}"/>
|
||||
<testCase name="#1175 - Hidden Test" duration="{duration}"/>
|
||||
<testCase name="#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0" duration="{duration}"/>
|
||||
<testCase name="#1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0" duration="{duration}"/>
|
||||
<testCase name="#1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0" duration="{duration}"/>
|
||||
<testCase name="#835 -- errno should not be touched by Catch" duration="{duration}">
|
||||
<skipped message="CHECK(f() == 0)">
|
||||
FAILED:
|
||||
|
@@ -264,6 +264,405 @@ Nor would this
|
||||
</Section>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="#1913 - GENERATE inside a for loop should not keep recreating the generator" tags="[generators][regression]" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
|
||||
<Original>
|
||||
counter < 7
|
||||
</Original>
|
||||
<Expanded>
|
||||
3 < 7
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
|
||||
<Original>
|
||||
counter < 7
|
||||
</Original>
|
||||
<Expanded>
|
||||
6 < 7
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="#1913 - GENERATEs can share a line" tags="[generators][regression]" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
|
||||
<Original>
|
||||
i != j
|
||||
</Original>
|
||||
<Expanded>
|
||||
1 != 3
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
|
||||
<Original>
|
||||
i != j
|
||||
</Original>
|
||||
<Expanded>
|
||||
1 != 4
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
|
||||
<Original>
|
||||
i != j
|
||||
</Original>
|
||||
<Expanded>
|
||||
2 != 3
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Generators.tests.cpp" >
|
||||
<Original>
|
||||
i != j
|
||||
</Original>
|
||||
<Expanded>
|
||||
2 != 4
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResult success="true"/>
|
||||
</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" >
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="#1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0" tags="[!hide][.][compilation][regression]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="#1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0" tags="[!hide][.][compilation][regression]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="#748 - captures with unexpected exceptions" tags="[!hide][!shouldfail][!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
|
||||
<Section name="outside assertions" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
|
||||
<Info>
|
||||
@@ -2962,6 +3361,63 @@ Nor would this
|
||||
</Expression>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="Composed matchers shortcircuit" tags="[composed][matchers]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Section name="&&" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Original>
|
||||
1, !(first && second)
|
||||
</Original>
|
||||
<Expanded>
|
||||
1 not ( CheckedTestingMatcher set to fail and CheckedTestingMatcher set to fail )
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Original>
|
||||
first.matchCalled
|
||||
</Original>
|
||||
<Expanded>
|
||||
true
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Original>
|
||||
!second.matchCalled
|
||||
</Original>
|
||||
<Expanded>
|
||||
true
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="3" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Section name="||" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Original>
|
||||
1, first || second
|
||||
</Original>
|
||||
<Expanded>
|
||||
1 ( CheckedTestingMatcher set to succeed or CheckedTestingMatcher set to fail )
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Original>
|
||||
first.matchCalled
|
||||
</Original>
|
||||
<Expanded>
|
||||
true
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Original>
|
||||
!second.matchCalled
|
||||
</Original>
|
||||
<Expanded>
|
||||
true
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="3" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="Contains string matcher" tags="[!hide][.][failing][matchers]" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Expression success="false" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Original>
|
||||
@@ -10506,6 +10962,17 @@ Nor would this
|
||||
</Expression>
|
||||
<OverallResult success="true"/>
|
||||
</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" >
|
||||
<Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Decomposition.tests.cpp" >
|
||||
<Original>
|
||||
@@ -16255,7 +16722,9 @@ loose text artifact
|
||||
</Section>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<OverallResults successes="1549" failures="149" expectedFailures="21"/>
|
||||
<OverallResults successes="1607" failures="149" expectedFailures="21"/>
|
||||
<OverallResultsCases successes="232" failures="86" expectedFailures="4"/>
|
||||
</Group>
|
||||
<OverallResults successes="1549" failures="148" expectedFailures="21"/>
|
||||
<OverallResults successes="1607" failures="148" expectedFailures="21"/>
|
||||
<OverallResultsCases successes="232" failures="86" expectedFailures="4"/>
|
||||
</Catch>
|
||||
|
@@ -204,3 +204,50 @@ TEST_CASE("#1670 regression check", "[.approvals][tracker]") {
|
||||
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 };
|
||||
|
||||
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]" ) {
|
||||
using namespace Catch::Matchers;
|
||||
@@ -40,3 +47,7 @@ TEST_CASE( "Directly creating an EnumInfo" ) {
|
||||
CHECK( enumInfo->lookup(1) == "Value2" );
|
||||
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 );
|
||||
}
|
@@ -251,6 +251,23 @@ TEST_CASE("Copy and then generate a range", "[generators]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("#1913 - GENERATE inside a for loop should not keep recreating the generator", "[regression][generators]") {
|
||||
static int counter = 0;
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
int _ = GENERATE(1, 2);
|
||||
(void)_;
|
||||
++counter;
|
||||
}
|
||||
// There should be at most 6 (3 * 2) counter increments
|
||||
REQUIRE(counter < 7);
|
||||
}
|
||||
|
||||
TEST_CASE("#1913 - GENERATEs can share a line", "[regression][generators]") {
|
||||
int i = GENERATE(1, 2); int j = GENERATE(3, 4);
|
||||
REQUIRE(i != j);
|
||||
}
|
||||
|
||||
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
@@ -628,6 +628,45 @@ namespace { namespace MatchersTests {
|
||||
REQUIRE_THAT(testStringForMatching2(), composed2);
|
||||
}
|
||||
|
||||
struct CheckedTestingMatcher : Catch::MatcherBase<int> {
|
||||
mutable bool matchCalled = false;
|
||||
bool matchSucceeds = false;
|
||||
|
||||
bool match(int const&) const override {
|
||||
matchCalled = true;
|
||||
return matchSucceeds;
|
||||
}
|
||||
std::string describe() const override {
|
||||
return "CheckedTestingMatcher set to " + (matchSucceeds ? std::string("succeed") : std::string("fail"));
|
||||
}
|
||||
};
|
||||
|
||||
TEST_CASE("Composed matchers shortcircuit", "[matchers][composed]") {
|
||||
// Check that if first returns false, second is not touched
|
||||
CheckedTestingMatcher first, second;
|
||||
SECTION("&&") {
|
||||
first.matchSucceeds = false;
|
||||
// This assertion doesn't actually test anything, we just
|
||||
// want the composed matcher's `match` being called.
|
||||
CHECK_THAT(1, !(first && second));
|
||||
|
||||
// These two assertions are the important ones
|
||||
REQUIRE(first.matchCalled);
|
||||
REQUIRE(!second.matchCalled);
|
||||
}
|
||||
// Check that if first returns true, second is not touched
|
||||
SECTION("||") {
|
||||
first.matchSucceeds = true;
|
||||
// This assertion doesn't actually test anything, we just
|
||||
// want the composed matcher's `match` being called.
|
||||
CHECK_THAT(1, first || second);
|
||||
|
||||
// These two assertions are the important ones
|
||||
REQUIRE(first.matchCalled);
|
||||
REQUIRE(!second.matchCalled);
|
||||
}
|
||||
}
|
||||
|
||||
} } // namespace MatchersTests
|
||||
|
||||
#endif // CATCH_CONFIG_DISABLE_MATCHERS
|
||||
|
@@ -484,4 +484,10 @@ TEST_CASE( "#1175 - Hidden Test", "[.]" ) {
|
||||
SUCCEED();
|
||||
}
|
||||
|
||||
TEMPLATE_TEST_CASE_SIG("#1954 - 7 arg template test case sig compiles", "[regression][.compilation]",
|
||||
((int Tnx, int Tnu, int Tny, int Tph, int Tch, int Tineq, int Teq), Tnx, Tnu, Tny, Tph, Tch, Tineq, Teq),
|
||||
(1, 1, 1, 1, 1, 0, 0), (5, 1, 1, 1, 1, 0, 0), (5, 3, 1, 1, 1, 0, 0)) {
|
||||
SUCCEED();
|
||||
}
|
||||
|
||||
}} // namespace MiscTests
|
||||
|
@@ -15,9 +15,9 @@ import random
|
||||
def list_tests(self_test_exe, tags, rng_seed):
|
||||
cmd = [self_test_exe, '--list-test-names-only', '--order', 'rand',
|
||||
'--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:
|
||||
cmd.append(tags_arg + '~[.]')
|
||||
cmd.append(tags_arg)
|
||||
process = subprocess.Popen(
|
||||
cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
stdout, stderr = process.communicate()
|
||||
|
0
scripts/updateDocumentToC.py
Normal file → Executable file
0
scripts/updateDocumentToC.py
Normal file → Executable file
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Catch v2.12.2
|
||||
* Generated: 2020-05-25 15:09:23.791719
|
||||
* Catch v2.13.2
|
||||
* Generated: 2020-10-07 11:32:53.302017
|
||||
* ----------------------------------------------------------
|
||||
* This file has been merged from multiple headers. Please don't edit it directly
|
||||
* Copyright (c) 2020 Two Blue Cubes Ltd. All rights reserved.
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
|
||||
#define CATCH_VERSION_MAJOR 2
|
||||
#define CATCH_VERSION_MINOR 12
|
||||
#define CATCH_VERSION_MINOR 13
|
||||
#define CATCH_VERSION_PATCH 2
|
||||
|
||||
#ifdef __clang__
|
||||
@@ -132,13 +132,9 @@ namespace Catch {
|
||||
|
||||
#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
|
||||
// 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_STOP_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic pop" )
|
||||
|
||||
@@ -162,7 +158,7 @@ namespace Catch {
|
||||
// ```
|
||||
//
|
||||
// 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) */
|
||||
# endif
|
||||
|
||||
@@ -244,10 +240,6 @@ namespace Catch {
|
||||
# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION __pragma( warning(push) )
|
||||
# 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
|
||||
// Or console colours (or console at all...)
|
||||
# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
|
||||
@@ -330,7 +322,10 @@ namespace Catch {
|
||||
|
||||
// Check if byte is available and usable
|
||||
# if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
|
||||
# define CATCH_INTERNAL_CONFIG_CPP17_BYTE
|
||||
# include <cstddef>
|
||||
# if __cpp_lib_byte > 0
|
||||
# define CATCH_INTERNAL_CONFIG_CPP17_BYTE
|
||||
# endif
|
||||
# endif // __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
|
||||
|
||||
// Check if variant is available and usable
|
||||
@@ -373,10 +368,6 @@ namespace Catch {
|
||||
# define CATCH_CONFIG_CPP17_OPTIONAL
|
||||
#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)
|
||||
# define CATCH_CONFIG_CPP17_STRING_VIEW
|
||||
#endif
|
||||
@@ -775,7 +766,7 @@ constexpr auto operator "" _catch_sr( char const* rawChars, std::size_t size ) n
|
||||
#define INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_0, _1, _2, _3) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_1, _2, _3)
|
||||
#define INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_0, _1, _2, _3, _4) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_1, _2, _3, _4)
|
||||
#define INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_0, _1, _2, _3, _4, _5) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_1, _2, _3, _4, _5)
|
||||
#define INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_0, _1, _2, _3, _4, _5, _6) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_1, _2, _4, _5, _6)
|
||||
#define INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_0, _1, _2, _3, _4, _5, _6) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_1, _2, _3, _4, _5, _6)
|
||||
#define INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_0, _1, _2, _3, _4, _5, _6, _7) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_1, _2, _3, _4, _5, _6, _7)
|
||||
#define INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_1, _2, _3, _4, _5, _6, _7, _8)
|
||||
#define INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9)
|
||||
@@ -1105,7 +1096,7 @@ struct AutoReg : NonCopyable {
|
||||
int index = 0; \
|
||||
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
|
||||
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 ) = [](){\
|
||||
@@ -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* 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]);\
|
||||
(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 ) = [](){ \
|
||||
@@ -1195,7 +1186,7 @@ struct AutoReg : NonCopyable {
|
||||
void reg_tests() { \
|
||||
int index = 0; \
|
||||
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 ) = [](){ \
|
||||
@@ -1229,7 +1220,7 @@ struct AutoReg : NonCopyable {
|
||||
int index = 0; \
|
||||
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
|
||||
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 ) = [](){\
|
||||
@@ -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* 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]);\
|
||||
(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 ) = [](){\
|
||||
@@ -1325,7 +1316,7 @@ struct AutoReg : NonCopyable {
|
||||
void reg_tests(){\
|
||||
int index = 0;\
|
||||
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 ) = [](){\
|
||||
@@ -1829,8 +1820,8 @@ namespace Catch {
|
||||
#endif
|
||||
|
||||
namespace Detail {
|
||||
template<typename InputIterator>
|
||||
std::string rangeToString(InputIterator first, InputIterator last) {
|
||||
template<typename InputIterator, typename Sentinel = InputIterator>
|
||||
std::string rangeToString(InputIterator first, Sentinel last) {
|
||||
ReusableStringStream rss;
|
||||
rss << "{ ";
|
||||
if (first != last) {
|
||||
@@ -2468,7 +2459,7 @@ namespace Catch {
|
||||
virtual void sectionEnded( SectionEndInfo const& endInfo ) = 0;
|
||||
virtual void sectionEndedEarly( SectionEndInfo const& endInfo ) = 0;
|
||||
|
||||
virtual auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker& = 0;
|
||||
virtual auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& = 0;
|
||||
|
||||
#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
|
||||
virtual void benchmarkPreparing( std::string const& name ) = 0;
|
||||
@@ -4080,16 +4071,16 @@ namespace Generators {
|
||||
return makeGenerators( value( T( std::forward<U>( val ) ) ), std::forward<Gs>( moreGenerators )... );
|
||||
}
|
||||
|
||||
auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker&;
|
||||
auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker&;
|
||||
|
||||
template<typename L>
|
||||
// Note: The type after -> is weird, because VS2015 cannot parse
|
||||
// the expression used in the typedef inside, when it is in
|
||||
// return type. Yeah.
|
||||
auto generate( SourceLineInfo const& lineInfo, L const& generatorExpression ) -> decltype(std::declval<decltype(generatorExpression())>().get()) {
|
||||
auto generate( StringRef generatorName, SourceLineInfo const& lineInfo, L const& generatorExpression ) -> decltype(std::declval<decltype(generatorExpression())>().get()) {
|
||||
using UnderlyingType = typename decltype(generatorExpression())::type;
|
||||
|
||||
IGeneratorTracker& tracker = acquireGeneratorTracker( lineInfo );
|
||||
IGeneratorTracker& tracker = acquireGeneratorTracker( generatorName, lineInfo );
|
||||
if (!tracker.hasGenerator()) {
|
||||
tracker.setGenerator(pf::make_unique<Generators<UnderlyingType>>(generatorExpression()));
|
||||
}
|
||||
@@ -4102,11 +4093,17 @@ namespace Generators {
|
||||
} // namespace Catch
|
||||
|
||||
#define GENERATE( ... ) \
|
||||
Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [ ]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
|
||||
Catch::Generators::generate( INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_UNIQUE_NAME(generator)), \
|
||||
CATCH_INTERNAL_LINEINFO, \
|
||||
[ ]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
|
||||
#define GENERATE_COPY( ... ) \
|
||||
Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [=]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
|
||||
Catch::Generators::generate( INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_UNIQUE_NAME(generator)), \
|
||||
CATCH_INTERNAL_LINEINFO, \
|
||||
[=]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
|
||||
#define GENERATE_REF( ... ) \
|
||||
Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [&]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
|
||||
Catch::Generators::generate( INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_UNIQUE_NAME(generator)), \
|
||||
CATCH_INTERNAL_LINEINFO, \
|
||||
[&]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
|
||||
|
||||
// end catch_generators.hpp
|
||||
// start catch_generators_generic.hpp
|
||||
@@ -4516,6 +4513,7 @@ namespace Catch {
|
||||
virtual int abortAfter() const = 0;
|
||||
virtual bool showInvisibles() const = 0;
|
||||
virtual ShowDurations::OrNot showDurations() const = 0;
|
||||
virtual double minDuration() const = 0;
|
||||
virtual TestSpec const& testSpec() const = 0;
|
||||
virtual bool hasTestFilters() const = 0;
|
||||
virtual std::vector<std::string> const& getTestsOrTags() const = 0;
|
||||
@@ -5288,6 +5286,7 @@ namespace Catch {
|
||||
Verbosity verbosity = Verbosity::Normal;
|
||||
WarnAbout::What warnings = WarnAbout::Nothing;
|
||||
ShowDurations::OrNot showDurations = ShowDurations::DefaultForReporter;
|
||||
double minDuration = -1;
|
||||
RunTests::InWhatOrder runOrder = RunTests::InDeclarationOrder;
|
||||
UseColour::YesOrNo useColour = UseColour::Auto;
|
||||
WaitForKeypress::When waitForKeypress = WaitForKeypress::Never;
|
||||
@@ -5338,6 +5337,7 @@ namespace Catch {
|
||||
bool warnAboutMissingAssertions() const override;
|
||||
bool warnAboutNoTests() const override;
|
||||
ShowDurations::OrNot showDurations() const override;
|
||||
double minDuration() const override;
|
||||
RunTests::InWhatOrder runOrder() const override;
|
||||
unsigned int rngSeed() const override;
|
||||
UseColour::YesOrNo useColour() const override;
|
||||
@@ -5715,6 +5715,9 @@ namespace Catch {
|
||||
// Returns double formatted as %.3f (format expected on output)
|
||||
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 );
|
||||
|
||||
template<typename DerivedT>
|
||||
@@ -6108,8 +6111,6 @@ namespace Catch {
|
||||
|
||||
static std::string getDescription();
|
||||
|
||||
ReporterPreferences getPreferences() const override;
|
||||
|
||||
void noMatchingTestCases(std::string const& spec) override;
|
||||
|
||||
void assertionStarting(AssertionInfo const&) override;
|
||||
@@ -7463,23 +7464,37 @@ namespace TestCaseTracking {
|
||||
SourceLineInfo location;
|
||||
|
||||
NameAndLocation( std::string const& _name, SourceLineInfo const& _location );
|
||||
friend bool operator==(NameAndLocation const& lhs, NameAndLocation const& rhs) {
|
||||
return lhs.name == rhs.name
|
||||
&& lhs.location == rhs.location;
|
||||
}
|
||||
};
|
||||
|
||||
struct ITracker;
|
||||
class ITracker;
|
||||
|
||||
using ITrackerPtr = std::shared_ptr<ITracker>;
|
||||
|
||||
struct ITracker {
|
||||
virtual ~ITracker();
|
||||
class ITracker {
|
||||
NameAndLocation m_nameAndLocation;
|
||||
|
||||
public:
|
||||
ITracker(NameAndLocation const& nameAndLoc) :
|
||||
m_nameAndLocation(nameAndLoc)
|
||||
{}
|
||||
|
||||
// static queries
|
||||
virtual NameAndLocation const& nameAndLocation() const = 0;
|
||||
NameAndLocation const& nameAndLocation() const {
|
||||
return m_nameAndLocation;
|
||||
}
|
||||
|
||||
virtual ~ITracker();
|
||||
|
||||
// dynamic queries
|
||||
virtual bool isComplete() const = 0; // Successfully completed or failed
|
||||
virtual bool isSuccessfullyCompleted() const = 0;
|
||||
virtual bool isOpen() const = 0; // Started but not complete
|
||||
virtual bool hasChildren() const = 0;
|
||||
virtual bool hasStarted() const = 0;
|
||||
|
||||
virtual ITracker& parent() = 0;
|
||||
|
||||
@@ -7534,7 +7549,6 @@ namespace TestCaseTracking {
|
||||
};
|
||||
|
||||
using Children = std::vector<ITrackerPtr>;
|
||||
NameAndLocation m_nameAndLocation;
|
||||
TrackerContext& m_ctx;
|
||||
ITracker* m_parent;
|
||||
Children m_children;
|
||||
@@ -7543,11 +7557,13 @@ namespace TestCaseTracking {
|
||||
public:
|
||||
TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent );
|
||||
|
||||
NameAndLocation const& nameAndLocation() const override;
|
||||
bool isComplete() const override;
|
||||
bool isSuccessfullyCompleted() const override;
|
||||
bool isOpen() const override;
|
||||
bool hasChildren() const override;
|
||||
bool hasStarted() const override {
|
||||
return m_runState != NotStarted;
|
||||
}
|
||||
|
||||
void addChild( ITrackerPtr const& child ) override;
|
||||
|
||||
@@ -7910,7 +7926,11 @@ namespace Catch {
|
||||
|
||||
#ifdef CATCH_PLATFORM_MAC
|
||||
|
||||
#define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
#define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
|
||||
#elif defined(__aarch64__)
|
||||
#define CATCH_TRAP() __asm__(".inst 0xd4200000")
|
||||
#endif
|
||||
|
||||
#elif defined(CATCH_PLATFORM_IPHONE)
|
||||
|
||||
@@ -8095,7 +8115,7 @@ namespace Catch {
|
||||
void sectionEnded( SectionEndInfo const& endInfo ) override;
|
||||
void sectionEndedEarly( SectionEndInfo const& endInfo ) override;
|
||||
|
||||
auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker& override;
|
||||
auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& override;
|
||||
|
||||
#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
|
||||
void benchmarkPreparing( std::string const& name ) override;
|
||||
@@ -9071,7 +9091,7 @@ namespace detail {
|
||||
}
|
||||
inline auto convertInto( std::string const &source, bool &target ) -> ParserResult {
|
||||
std::string srcLC = source;
|
||||
std::transform( srcLC.begin(), srcLC.end(), srcLC.begin(), []( char c ) { return static_cast<char>( std::tolower(c) ); } );
|
||||
std::transform( srcLC.begin(), srcLC.end(), srcLC.begin(), []( unsigned char c ) { return static_cast<char>( std::tolower(c) ); } );
|
||||
if (srcLC == "y" || srcLC == "1" || srcLC == "true" || srcLC == "yes" || srcLC == "on")
|
||||
target = true;
|
||||
else if (srcLC == "n" || srcLC == "0" || srcLC == "false" || srcLC == "no" || srcLC == "off")
|
||||
@@ -9840,6 +9860,9 @@ namespace Catch {
|
||||
| Opt( [&]( bool flag ) { config.showDurations = flag ? ShowDurations::Always : ShowDurations::Never; }, "yes|no" )
|
||||
["-d"]["--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" )
|
||||
["-f"]["--input-file"]
|
||||
( "load test names to run from a file" )
|
||||
@@ -9987,6 +10010,7 @@ namespace Catch {
|
||||
bool Config::warnAboutMissingAssertions() const { return !!(m_data.warnings & WarnAbout::NoAssertions); }
|
||||
bool Config::warnAboutNoTests() const { return !!(m_data.warnings & WarnAbout::NoTests); }
|
||||
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; }
|
||||
unsigned int Config::rngSeed() const { return m_data.rngSeed; }
|
||||
UseColour::YesOrNo Config::useColour() const { return m_data.useColour; }
|
||||
@@ -10883,8 +10907,8 @@ namespace Generators {
|
||||
|
||||
GeneratorUntypedBase::~GeneratorUntypedBase() {}
|
||||
|
||||
auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker& {
|
||||
return getResultCapture().acquireGeneratorTracker( lineInfo );
|
||||
auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& {
|
||||
return getResultCapture().acquireGeneratorTracker( generatorName, lineInfo );
|
||||
}
|
||||
|
||||
} // namespace Generators
|
||||
@@ -12009,7 +12033,7 @@ namespace Catch {
|
||||
if (tmpnam_s(m_buffer)) {
|
||||
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];
|
||||
if (strerror_s(buffer, errno)) {
|
||||
CATCH_RUNTIME_ERROR("Could not translate errno to a string");
|
||||
@@ -12304,11 +12328,13 @@ namespace Catch {
|
||||
namespace Catch {
|
||||
|
||||
class StartupExceptionRegistry {
|
||||
#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
|
||||
public:
|
||||
void add(std::exception_ptr const& exception) noexcept;
|
||||
std::vector<std::exception_ptr> const& getExceptions() const noexcept;
|
||||
private:
|
||||
std::vector<std::exception_ptr> m_exceptions;
|
||||
#endif
|
||||
};
|
||||
|
||||
} // end namespace Catch
|
||||
@@ -12391,7 +12417,11 @@ namespace Catch {
|
||||
m_tagAliasRegistry.add( alias, tag, lineInfo );
|
||||
}
|
||||
void registerStartupException() noexcept override {
|
||||
#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
|
||||
m_exceptionRegistry.add(std::current_exception());
|
||||
#else
|
||||
CATCH_INTERNAL_ERROR("Attempted to register active exception under CATCH_CONFIG_DISABLE_EXCEPTIONS!");
|
||||
#endif
|
||||
}
|
||||
IMutableEnumValuesRegistry& getMutableEnumValuesRegistry() override {
|
||||
return m_enumValuesRegistry;
|
||||
@@ -12495,17 +12525,32 @@ namespace Catch {
|
||||
std::shared_ptr<GeneratorTracker> tracker;
|
||||
|
||||
ITracker& currentTracker = ctx.currentTracker();
|
||||
if( TestCaseTracking::ITrackerPtr childTracker = currentTracker.findChild( nameAndLocation ) ) {
|
||||
// Under specific circumstances, the generator we want
|
||||
// to acquire is also the current tracker. If this is
|
||||
// the case, we have to avoid looking through current
|
||||
// tracker's children, and instead return the current
|
||||
// tracker.
|
||||
// A case where this check is important is e.g.
|
||||
// for (int i = 0; i < 5; ++i) {
|
||||
// int n = GENERATE(1, 2);
|
||||
// }
|
||||
//
|
||||
// without it, the code above creates 5 nested generators.
|
||||
if (currentTracker.nameAndLocation() == nameAndLocation) {
|
||||
auto thisTracker = currentTracker.parent().findChild(nameAndLocation);
|
||||
assert(thisTracker);
|
||||
assert(thisTracker->isGeneratorTracker());
|
||||
tracker = std::static_pointer_cast<GeneratorTracker>(thisTracker);
|
||||
} else if ( TestCaseTracking::ITrackerPtr childTracker = currentTracker.findChild( nameAndLocation ) ) {
|
||||
assert( childTracker );
|
||||
assert( childTracker->isGeneratorTracker() );
|
||||
tracker = std::static_pointer_cast<GeneratorTracker>( childTracker );
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
tracker = std::make_shared<GeneratorTracker>( nameAndLocation, ctx, ¤tTracker );
|
||||
currentTracker.addChild( tracker );
|
||||
}
|
||||
|
||||
if( !ctx.completedCycle() && !tracker->isComplete() ) {
|
||||
if( !tracker->isComplete() ) {
|
||||
tracker->open();
|
||||
}
|
||||
|
||||
@@ -12519,8 +12564,28 @@ namespace Catch {
|
||||
}
|
||||
void close() override {
|
||||
TrackerBase::close();
|
||||
// Generator interface only finds out if it has another item on atual move
|
||||
if (m_runState == CompletedSuccessfully && m_generator->next()) {
|
||||
// If a generator has a child (it is followed by a section)
|
||||
// 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 =
|
||||
!m_children.empty() &&
|
||||
std::find_if( m_children.begin(),
|
||||
m_children.end(),
|
||||
[]( TestCaseTracking::ITrackerPtr tracker ) {
|
||||
return tracker->hasStarted();
|
||||
} ) == m_children.end();
|
||||
|
||||
// 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_runState = Executing;
|
||||
}
|
||||
@@ -12656,10 +12721,10 @@ namespace Catch {
|
||||
|
||||
return true;
|
||||
}
|
||||
auto RunContext::acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker& {
|
||||
auto RunContext::acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& {
|
||||
using namespace Generators;
|
||||
GeneratorTracker& tracker = GeneratorTracker::acquire( m_trackerContext, TestCaseTracking::NameAndLocation( "generator", lineInfo ) );
|
||||
assert( tracker.isOpen() );
|
||||
GeneratorTracker& tracker = GeneratorTracker::acquire(m_trackerContext,
|
||||
TestCaseTracking::NameAndLocation( static_cast<std::string>(generatorName), lineInfo ) );
|
||||
m_lastAssertionInfo.lineInfo = lineInfo;
|
||||
return tracker;
|
||||
}
|
||||
@@ -12702,17 +12767,17 @@ namespace Catch {
|
||||
|
||||
#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
|
||||
void RunContext::benchmarkPreparing(std::string const& name) {
|
||||
m_reporter->benchmarkPreparing(name);
|
||||
}
|
||||
m_reporter->benchmarkPreparing(name);
|
||||
}
|
||||
void RunContext::benchmarkStarting( BenchmarkInfo const& info ) {
|
||||
m_reporter->benchmarkStarting( info );
|
||||
}
|
||||
void RunContext::benchmarkEnded( BenchmarkStats<> const& stats ) {
|
||||
m_reporter->benchmarkEnded( stats );
|
||||
}
|
||||
void RunContext::benchmarkFailed(std::string const & error) {
|
||||
m_reporter->benchmarkFailed(error);
|
||||
}
|
||||
void RunContext::benchmarkFailed(std::string const & error) {
|
||||
m_reporter->benchmarkFailed(error);
|
||||
}
|
||||
#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
|
||||
|
||||
void RunContext::pushScopedMessage(MessageInfo const & message) {
|
||||
@@ -13433,6 +13498,7 @@ namespace Catch {
|
||||
// end catch_singletons.cpp
|
||||
// start catch_startup_exception_registry.cpp
|
||||
|
||||
#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
|
||||
namespace Catch {
|
||||
void StartupExceptionRegistry::add( std::exception_ptr const& exception ) noexcept {
|
||||
CATCH_TRY {
|
||||
@@ -13448,6 +13514,7 @@ void StartupExceptionRegistry::add( std::exception_ptr const& exception ) noexce
|
||||
}
|
||||
|
||||
} // end namespace Catch
|
||||
#endif
|
||||
// end catch_startup_exception_registry.cpp
|
||||
// start catch_stream.cpp
|
||||
|
||||
@@ -13632,7 +13699,7 @@ namespace Catch {
|
||||
|
||||
namespace {
|
||||
char toLowerCh(char c) {
|
||||
return static_cast<char>( std::tolower( c ) );
|
||||
return static_cast<char>( std::tolower( static_cast<unsigned char>(c) ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14015,10 +14082,10 @@ namespace Catch {
|
||||
|
||||
namespace {
|
||||
struct TestHasher {
|
||||
explicit TestHasher(Catch::SimplePcg32& rng) {
|
||||
basis = rng();
|
||||
explicit TestHasher(Catch::SimplePcg32& rng_instance) {
|
||||
basis = rng_instance();
|
||||
basis <<= 32;
|
||||
basis |= rng();
|
||||
basis |= rng_instance();
|
||||
}
|
||||
|
||||
uint64_t basis;
|
||||
@@ -14215,15 +14282,12 @@ namespace TestCaseTracking {
|
||||
m_currentTracker = tracker;
|
||||
}
|
||||
|
||||
TrackerBase::TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent )
|
||||
: m_nameAndLocation( nameAndLocation ),
|
||||
TrackerBase::TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent ):
|
||||
ITracker(nameAndLocation),
|
||||
m_ctx( ctx ),
|
||||
m_parent( parent )
|
||||
{}
|
||||
|
||||
NameAndLocation const& TrackerBase::nameAndLocation() const {
|
||||
return m_nameAndLocation;
|
||||
}
|
||||
bool TrackerBase::isComplete() const {
|
||||
return m_runState == CompletedSuccessfully || m_runState == Failed;
|
||||
}
|
||||
@@ -14339,7 +14403,8 @@ namespace TestCaseTracking {
|
||||
bool SectionTracker::isComplete() const {
|
||||
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()) {
|
||||
complete = TrackerBase::isComplete();
|
||||
}
|
||||
@@ -15118,11 +15183,48 @@ namespace Catch {
|
||||
// end catch_totals.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>
|
||||
|
||||
namespace Catch {
|
||||
bool uncaught_exceptions() {
|
||||
#if defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
|
||||
#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
|
||||
return false;
|
||||
#elif defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
|
||||
return std::uncaught_exceptions() > 0;
|
||||
#else
|
||||
return std::uncaught_exception();
|
||||
@@ -15162,7 +15264,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
Version const& libraryVersion() {
|
||||
static Version version( 2, 12, 2, "", 0 );
|
||||
static Version version( 2, 13, 2, "", 0 );
|
||||
return version;
|
||||
}
|
||||
|
||||
@@ -15564,6 +15666,17 @@ namespace Catch {
|
||||
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 ) {
|
||||
ReusableStringStream oss;
|
||||
bool first = true;
|
||||
@@ -15830,10 +15943,6 @@ private:
|
||||
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 ) {
|
||||
stream << "No test cases matched '" << spec << '\'' << std::endl;
|
||||
}
|
||||
@@ -15860,8 +15969,9 @@ private:
|
||||
}
|
||||
|
||||
void CompactReporter::sectionEnded(SectionStats const& _sectionStats) {
|
||||
if (m_config->showDurations() == ShowDurations::Always) {
|
||||
stream << getFormattedDuration(_sectionStats.durationInSeconds) << " s: " << _sectionStats.sectionInfo.name << std::endl;
|
||||
double dur = _sectionStats.durationInSeconds;
|
||||
if ( shouldShowDuration( *m_config, dur ) ) {
|
||||
stream << getFormattedDuration( dur ) << " s: " << _sectionStats.sectionInfo.name << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16281,8 +16391,9 @@ void ConsoleReporter::sectionEnded(SectionStats const& _sectionStats) {
|
||||
stream << "\nNo assertions in test case";
|
||||
stream << " '" << _sectionStats.sectionInfo.name << "'\n" << std::endl;
|
||||
}
|
||||
if (m_config->showDurations() == ShowDurations::Always) {
|
||||
stream << getFormattedDuration(_sectionStats.durationInSeconds) << " s: " << _sectionStats.sectionInfo.name << std::endl;
|
||||
double dur = _sectionStats.durationInSeconds;
|
||||
if (shouldShowDuration(*m_config, dur)) {
|
||||
stream << getFormattedDuration(dur) << " s: " << _sectionStats.sectionInfo.name << std::endl;
|
||||
}
|
||||
if (m_headerPrinted) {
|
||||
m_headerPrinted = false;
|
||||
@@ -17180,6 +17291,10 @@ namespace Catch {
|
||||
.writeAttribute( "successes", testGroupStats.totals.assertions.passed )
|
||||
.writeAttribute( "failures", testGroupStats.totals.assertions.failed )
|
||||
.writeAttribute( "expectedFailures", testGroupStats.totals.assertions.failedButOk );
|
||||
m_xml.scopedElement( "OverallResultsCases")
|
||||
.writeAttribute( "successes", testGroupStats.totals.testCases.passed )
|
||||
.writeAttribute( "failures", testGroupStats.totals.testCases.failed )
|
||||
.writeAttribute( "expectedFailures", testGroupStats.totals.testCases.failedButOk );
|
||||
m_xml.endElement();
|
||||
}
|
||||
|
||||
@@ -17189,6 +17304,10 @@ namespace Catch {
|
||||
.writeAttribute( "successes", testRunStats.totals.assertions.passed )
|
||||
.writeAttribute( "failures", testRunStats.totals.assertions.failed )
|
||||
.writeAttribute( "expectedFailures", testRunStats.totals.assertions.failedButOk );
|
||||
m_xml.scopedElement( "OverallResultsCases")
|
||||
.writeAttribute( "successes", testRunStats.totals.testCases.passed )
|
||||
.writeAttribute( "failures", testRunStats.totals.testCases.failed )
|
||||
.writeAttribute( "expectedFailures", testRunStats.totals.testCases.failedButOk );
|
||||
m_xml.endElement();
|
||||
}
|
||||
|
||||
|
@@ -23,16 +23,17 @@ namespace Catch {
|
||||
|
||||
using StreamingReporterBase::StreamingReporterBase;
|
||||
|
||||
TAPReporter( ReporterConfig const& config ):
|
||||
StreamingReporterBase( config ) {
|
||||
m_reporterPrefs.shouldReportAllAssertions = true;
|
||||
}
|
||||
|
||||
~TAPReporter() override;
|
||||
|
||||
static std::string getDescription() {
|
||||
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 {
|
||||
stream << "# No test cases matched '" << spec << "'" << std::endl;
|
||||
}
|
||||
@@ -203,16 +204,15 @@ namespace Catch {
|
||||
return;
|
||||
}
|
||||
|
||||
// using messages.end() directly (or auto) yields compilation error:
|
||||
std::vector<MessageInfo>::const_iterator itEnd = messages.end();
|
||||
const std::size_t N = static_cast<std::size_t>( std::distance( itMessage, itEnd ) );
|
||||
const auto itEnd = messages.cend();
|
||||
const auto N = static_cast<std::size_t>( std::distance( itMessage, itEnd ) );
|
||||
|
||||
{
|
||||
Colour colourGuard( colour );
|
||||
stream << " with " << pluralise( N, "message" ) << ":";
|
||||
}
|
||||
|
||||
for(; itMessage != itEnd; ) {
|
||||
while( itMessage != itEnd ) {
|
||||
// If this assertion is a warning ignore any INFO messages
|
||||
if( printInfoMessages || itMessage->type != ResultWas::Info ) {
|
||||
stream << " '" << itMessage->message << "'";
|
||||
@@ -220,7 +220,9 @@ namespace Catch {
|
||||
Colour colourGuard( dimColour() );
|
||||
stream << " and";
|
||||
}
|
||||
continue;
|
||||
}
|
||||
++itMessage;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,10 +236,9 @@ namespace Catch {
|
||||
};
|
||||
|
||||
void printTotals( const Totals& totals ) const {
|
||||
stream << "1.." << totals.assertions.total();
|
||||
if( totals.testCases.total() == 0 ) {
|
||||
stream << "1..0 # Skipped: No tests ran.";
|
||||
} else {
|
||||
stream << "1.." << counter;
|
||||
stream << " # Skipped: No tests ran.";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
2
third_party/clara.hpp
vendored
2
third_party/clara.hpp
vendored
@@ -667,7 +667,7 @@ namespace detail {
|
||||
}
|
||||
inline auto convertInto( std::string const &source, bool &target ) -> ParserResult {
|
||||
std::string srcLC = source;
|
||||
std::transform( srcLC.begin(), srcLC.end(), srcLC.begin(), []( char c ) { return static_cast<char>( ::tolower(c) ); } );
|
||||
std::transform( srcLC.begin(), srcLC.end(), srcLC.begin(), []( unsigned char c ) { return static_cast<char>( ::tolower( c ) ); } );
|
||||
if (srcLC == "y" || srcLC == "1" || srcLC == "true" || srcLC == "yes" || srcLC == "on")
|
||||
target = true;
|
||||
else if (srcLC == "n" || srcLC == "0" || srcLC == "false" || srcLC == "no" || srcLC == "off")
|
||||
|
Reference in New Issue
Block a user