Compare commits

..
11 Commits
Author SHA1 Message Date
Martin Hořeňovský 644821ce28 v3.9.1 2025-08-09 00:30:23 +02:00
Martin Hořeňovský 03c62cdf2e Add tests for comparing & stringifying volatile pointers 2025-08-08 00:02:33 +02:00
Martin Hořeňovský 9a3d68315b Refactor CATCH_TRAP selection logic to prefer compiler-specific impls
Primarily this means that with Clang we use `__builtin_debugtrap`
if available.
2025-08-08 00:01:38 +02:00
Andrew AuclairandMartin Hořeňovský bcd4116df7 Update generators.md
Break specific purpose generators into random and range generator sections.
2025-08-06 19:31:42 +02:00
Martin Hořeňovský 9b3f508a1b Cleanup WIP changes from last commit 2025-08-02 10:21:41 +02:00
Martin Hořeňovský c5e0ef4e67 Catch exceptions from StringMakers inside Detail::stringify
This stops tests failing falsely if the assertion passed, but the
stringification itself failed as the assertion was sent to the reporter.

I don't think that stringification should be fallible, but the
overhead in compilation ended up being small enough (<0.5% on `SelfTest`)
that it might be worth implementing, in case there is more users
with weird `StringMaker`s than just MongoDB.

Closes #2980
2025-08-02 10:11:52 +02:00
Martin Hořeňovský 17fe5eaa5c Fix StringMaker for time_point<system_clock> with non-default duration
Fixes #2685
2025-08-02 08:31:34 +02:00
Tim LyonandMartin Hořeňovský fbfd13501c Fix warning in catch_unique_ptr::bool() 2025-08-02 00:15:06 +02:00
Martin Hořeňovský ccabd4de89 Add enum types to what is captured by value by default
As it turns out, enums can be used to declare bitfields, and we
cannot form a reference to a bitfield in the cpature. Thus, we add
`std::is_enum` as a criteria to the default for `capture_by_value`,
so that enum-based bitfields are also captured by value and thus
decomposable.

Closes #3001
2025-07-30 20:20:38 +02:00
Martin Hořeňovský a1c7ee115f Don't follow __assume(false) with std::terminate in NDEBUG builds
Having `std::terminate` as the backstop after `__assume(false)`
would trigger W4702 (unreachable code) with MSVC. As we want to
keep `__assume(false)` for the optimization hint in NDEBUG builds,
we have to avoid mixing in `std::terminate` for those builds.

Fixes #3007
2025-07-28 11:03:46 +02:00
Martin Hořeňovský d547cae549 Fix bad error reporting for nested exceptions in default configuration
Bad handling of `TestFailureException` when translating unexpected
exceptions inside assertion macros led to the unexpected exceptions
handling erroring out through throwing the same exception again.

This was then backstopped by the machinery for handling uncaught
exceptions from assertions, which is normally used by the
`CATCH_CONFIG_FAST_COMPILE` machinery, where we assume that it can
only be invoked because the assertion macros are not configured to
catch assertions.

Closes #1292
2025-07-27 21:41:02 +02:00
40 changed files with 1311 additions and 85 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ if(CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
endif()
project(Catch2
VERSION 3.9.0 # CML version placeholder, don't delete
VERSION 3.9.1 # CML version placeholder, don't delete
LANGUAGES CXX
HOMEPAGE_URL "https://github.com/catchorg/Catch2"
DESCRIPTION "A modern, C++-native, unit test framework."
+4 -3
View File
@@ -114,11 +114,12 @@ a test case,
* `MapGenerator<T, U, Func>` -- returns the result of applying `Func`
on elements from a different generator
* `ChunkGenerator<T>` -- returns chunks (inside `std::vector`) of n elements from a generator
* 4 specific purpose generators (defined in `catch2/generators/catch_generators_random.hpp`)
* 2 random generators (defined in `catch2/generators/catch_generators_random.hpp`)
* `RandomIntegerGenerator<Integral>` -- generates random Integrals from range
* `RandomFloatGenerator<Float>` -- generates random Floats from range
* `RangeGenerator<T>(first, last)` -- generates all values inside a `[first, last)` arithmetic range (defined in `catch2/generators/catch_generators_range.hpp`)
* `IteratorGenerator<T>` -- copies and returns values from an iterator range (defined in `catch2/generators/catch_generators_range.hpp`)
* 2 range generators (defined in `catch2/generators/catch_generators_range.hpp`)
* `RangeGenerator<T>(first, last)` -- generates all values inside a `[first, last)` arithmetic range
* `IteratorGenerator<T>` -- copies and returns values from an iterator range
> `ChunkGenerator<T>`, `RandomIntegerGenerator<Integral>`, `RandomFloatGenerator<Float>` and `RangeGenerator<T>` were introduced in Catch2 2.7.0.
+14
View File
@@ -2,6 +2,7 @@
# Release notes
**Contents**<br>
[3.9.1](#391)<br>
[3.9.0](#390)<br>
[3.8.1](#381)<br>
[3.8.0](#380)<br>
@@ -68,6 +69,19 @@
[Even Older versions](#even-older-versions)<br>
## 3.9.1
### Fixes
* Fixed bad error reporting for multiple nested assertions (#1292)
* Fixed W4702 (unreachable code) in the polyfill for std::unreachable (#3007)
* Fixed decomposition of assertions comparing enum-backed bitfields (#3001)
* Fixed StringMaker specialization for `time_point<system_clock>` with non-default duration type (#2685)
### Improvements
* Exceptions thrown during stringification of decomposed expression no longer fail the assertion (#2980)
* The selection logic for `CATCH_TRAP` prefers `__builtin_debugtrap` on all platforms when Catch2 is compiled with Clang
## 3.9.0
### Improvements
+14
View File
@@ -52,6 +52,20 @@ TEST_CASE("failing test") {
}
```
Same applies for a `SKIP` nested inside an assertion:
```cpp
static bool do_skip() {
SKIP();
return true;
}
TEST_CASE("Another failing test") {
CHECK(do_skip());
}
```
### Interaction with Sections and Generators
Sections, nested sections as well as specific outputs from [generators](generators.md#top)
+12 -5
View File
@@ -6,8 +6,8 @@
// SPDX-License-Identifier: BSL-1.0
// Catch v3.9.0
// Generated: 2025-07-24 22:00:25.173359
// Catch v3.9.1
// Generated: 2025-08-09 00:29:21.552225
// ----------------------------------------------------------
// This file is an amalgamation of multiple different files.
// You probably shouldn't edit it directly.
@@ -2026,6 +2026,13 @@ namespace Detail {
rss << std::setw(2) << static_cast<unsigned>(bytes[i]);
return rss.str();
}
std::string makeExceptionHappenedString() {
return "{ stringification failed with an exception: \"" +
translateActiveException() + "\" }";
}
} // end Detail namespace
@@ -2271,7 +2278,7 @@ namespace Catch {
}
Version const& libraryVersion() {
static Version version( 3, 9, 0, "", 0 );
static Version version( 3, 9, 1, "", 0 );
return version;
}
@@ -3981,10 +3988,10 @@ namespace Catch {
// To avoid having to handle TFE explicitly everywhere, we just
// rethrow it so that it goes back up the caller.
catch( TestFailureException& ) {
std::rethrow_exception(std::current_exception());
return "{ nested assertion failed }";
}
catch( TestSkipException& ) {
std::rethrow_exception(std::current_exception());
return "{ nested SKIP() called }";
}
catch( std::exception const& ex ) {
return ex.what();
+58 -27
View File
@@ -6,8 +6,8 @@
// SPDX-License-Identifier: BSL-1.0
// Catch v3.9.0
// Generated: 2025-07-24 22:00:24.654688
// Catch v3.9.1
// Generated: 2025-08-09 00:29:20.303175
// ----------------------------------------------------------
// This file is an amalgamation of multiple different files.
// You probably shouldn't edit it directly.
@@ -958,7 +958,7 @@ namespace Detail {
}
explicit operator bool() const {
return m_ptr;
return m_ptr != nullptr;
}
friend void swap(unique_ptr& lhs, unique_ptr& rhs) {
@@ -2151,9 +2151,7 @@ namespace Catch {
auto analysis = Detail::analyse(*cfg, samples.data(), samples.data() + samples.size());
BenchmarkStats<> stats{ CATCH_MOVE(info), CATCH_MOVE(analysis.samples), analysis.mean, analysis.standard_deviation, analysis.outliers, analysis.outlier_variance };
getResultCapture().benchmarkEnded(stats);
} CATCH_CATCH_ANON (TestFailureException const&) {
getResultCapture().benchmarkFailed("Benchmark failed due to failed assertion"_sr);
} CATCH_CATCH_ALL{
} CATCH_CATCH_ALL {
getResultCapture().benchmarkFailed(translateActiveException());
// We let the exception go further up so that the
// test case is marked as failed.
@@ -2566,11 +2564,17 @@ namespace Catch {
namespace Detail {
std::string makeExceptionHappenedString();
// This function dispatches all stringification requests inside of Catch.
// Should be preferably called fully qualified, like ::Catch::Detail::stringify
template <typename T>
std::string stringify(const T& e) {
return ::Catch::StringMaker<std::remove_cv_t<std::remove_reference_t<T>>>::convert(e);
std::string stringify( const T& e ) {
CATCH_TRY {
return ::Catch::StringMaker<
std::remove_cv_t<std::remove_reference_t<T>>>::convert( e );
}
CATCH_CATCH_ALL { return makeExceptionHappenedString(); }
}
template<typename E>
@@ -3053,17 +3057,19 @@ struct ratio_string<std::milli> {
template<typename Duration>
struct StringMaker<std::chrono::time_point<std::chrono::system_clock, Duration>> {
static std::string convert(std::chrono::time_point<std::chrono::system_clock, Duration> const& time_point) {
auto converted = std::chrono::system_clock::to_time_t(time_point);
const auto systemish = std::chrono::time_point_cast<
std::chrono::system_clock::duration>( time_point );
const auto as_time_t = std::chrono::system_clock::to_time_t( systemish );
#ifdef _MSC_VER
std::tm timeInfo = {};
const auto err = gmtime_s(&timeInfo, &converted);
const auto err = gmtime_s( &timeInfo, &as_time_t );
if ( err ) {
return "gmtime from provided timepoint has failed. This "
"happens e.g. with pre-1970 dates using Microsoft libc";
}
#else
std::tm* timeInfo = std::gmtime(&converted);
std::tm* timeInfo = std::gmtime( &as_time_t );
#endif
auto const timeStampSize = sizeof("2017-01-16T17:06:45Z");
@@ -5238,10 +5244,11 @@ namespace Detail {
*
* 3) If a type has no linkage, we also cannot capture it by reference.
* The solution is once again to capture them by value. We handle
* the common cases by using `std::is_arithmetic` as the default
* for `Catch::capture_by_value`, but that is only a some-effort
* heuristic. But as with 2), users can specialize `capture_by_value`
* for their own types as needed.
* the common cases by using `std::is_arithmetic` and `std::is_enum`
* as the default for `Catch::capture_by_value`, but that is only a
* some-effort heuristic. These combine to capture all possible bitfield
* bases, and also some trait-like types. As with 2), users can
* specialize `capture_by_value` for their own types as needed.
*
* 4) To support C++20 and make the SFINAE on our decomposing operators
* work, the SFINAE has to happen in return type, rather than in
@@ -5293,13 +5300,22 @@ namespace Catch {
using RemoveCVRef_t = std::remove_cv_t<std::remove_reference_t<T>>;
}
// Note: There is nothing that stops us from extending this,
// e.g. to `std::is_scalar`, but the more encompassing
// traits are usually also more expensive. For now we
// keep this as it used to be and it can be changed later.
// Note: This is about as much as we can currently reasonably support.
// In an ideal world, we could capture by value small trivially
// copyable types, but the actual `std::is_trivially_copyable`
// trait is a huge mess with standard-violating results on
// GCC and Clang, which are unlikely to be fixed soon due to ABI
// concerns.
// `std::is_scalar` also causes issues due to the `is_pointer`
// component, which causes ambiguity issues with (references-to)
// function pointer. If those are resolved, we still need to
// disambiguate the overload set for arrays, through explicit
// overload for references to sized arrays.
template <typename T>
struct capture_by_value
: std::integral_constant<bool, std::is_arithmetic<T>{}> {};
: std::integral_constant<bool,
std::is_arithmetic<T>::value ||
std::is_enum<T>::value> {};
#if defined( CATCH_CONFIG_CPP20_COMPARE_OVERLOADS )
template <>
@@ -6241,9 +6257,13 @@ namespace Catch {
__assume( false );
# elif defined( __GNUC__ )
__builtin_unreachable();
# endif
# endif // ^^ NDEBUG
# else // vv platform without known optimization hint
std::terminate();
# endif
# else // ^^ NDEBUG
// For non-release builds, we prefer termination on bug over UB
std::terminate();
# endif //
}
} // namespace Detail
@@ -7447,7 +7467,7 @@ namespace Catch {
#define CATCH_VERSION_MAJOR 3
#define CATCH_VERSION_MINOR 9
#define CATCH_VERSION_PATCH 0
#define CATCH_VERSION_PATCH 1
#endif // CATCH_VERSION_MACROS_HPP_INCLUDED
@@ -9500,6 +9520,17 @@ namespace Catch {
bool isDebuggerActive();
}
#if !defined( CATCH_TRAP ) && defined( __clang__ ) && defined( __has_builtin )
# if __has_builtin( __builtin_debugtrap )
# define CATCH_TRAP() __builtin_debugtrap()
# endif
#endif
#if !defined( CATCH_TRAP ) && defined( _MSC_VER )
# define CATCH_TRAP() __debugbreak()
#endif
#if !defined(CATCH_TRAP) // If we couldn't use compiler-specific impl from above, we get into platform-specific options
#ifdef CATCH_PLATFORM_MAC
#if defined(__i386__) || defined(__x86_64__)
@@ -9535,15 +9566,15 @@ namespace Catch {
#define CATCH_TRAP() raise(SIGTRAP)
#endif
#elif defined(_MSC_VER)
#define CATCH_TRAP() __debugbreak()
#elif defined(__MINGW32__)
extern "C" __declspec(dllimport) void __stdcall DebugBreak();
#define CATCH_TRAP() DebugBreak()
#endif
#endif // ^^ CATCH_TRAP is not defined yet, so we define it
#ifndef CATCH_BREAK_INTO_DEBUGGER
#ifdef CATCH_TRAP
#if !defined(CATCH_BREAK_INTO_DEBUGGER)
#if defined(CATCH_TRAP)
#define CATCH_BREAK_INTO_DEBUGGER() []{ if( Catch::isDebuggerActive() ) { CATCH_TRAP(); } }()
#else
#define CATCH_BREAK_INTO_DEBUGGER() []{}()
+1 -1
View File
@@ -8,7 +8,7 @@
project(
'catch2',
'cpp',
version: '3.9.0', # CML version placeholder, don't delete
version: '3.9.1', # CML version placeholder, don't delete
license: 'BSL-1.0',
meson_version: '>=0.54.1',
)
+1 -3
View File
@@ -86,9 +86,7 @@ namespace Catch {
auto analysis = Detail::analyse(*cfg, samples.data(), samples.data() + samples.size());
BenchmarkStats<> stats{ CATCH_MOVE(info), CATCH_MOVE(analysis.samples), analysis.mean, analysis.standard_deviation, analysis.outliers, analysis.outlier_variance };
getResultCapture().benchmarkEnded(stats);
} CATCH_CATCH_ANON (TestFailureException const&) {
getResultCapture().benchmarkFailed("Benchmark failed due to failed assertion"_sr);
} CATCH_CATCH_ALL{
} CATCH_CATCH_ALL {
getResultCapture().benchmarkFailed(translateActiveException());
// We let the exception go further up so that the
// test case is marked as failed.
+8
View File
@@ -8,6 +8,7 @@
#include <catch2/catch_tostring.hpp>
#include <catch2/interfaces/catch_interfaces_config.hpp>
#include <catch2/interfaces/catch_interfaces_registry_hub.hpp>
#include <catch2/internal/catch_context.hpp>
#include <catch2/internal/catch_polyfills.hpp>
@@ -113,6 +114,13 @@ namespace Detail {
rss << std::setw(2) << static_cast<unsigned>(bytes[i]);
return rss.str();
}
std::string makeExceptionHappenedString() {
return "{ stringification failed with an exception: \"" +
translateActiveException() + "\" }";
}
} // end Detail namespace
+13 -5
View File
@@ -139,11 +139,17 @@ namespace Catch {
namespace Detail {
std::string makeExceptionHappenedString();
// This function dispatches all stringification requests inside of Catch.
// Should be preferably called fully qualified, like ::Catch::Detail::stringify
template <typename T>
std::string stringify(const T& e) {
return ::Catch::StringMaker<std::remove_cv_t<std::remove_reference_t<T>>>::convert(e);
std::string stringify( const T& e ) {
CATCH_TRY {
return ::Catch::StringMaker<
std::remove_cv_t<std::remove_reference_t<T>>>::convert( e );
}
CATCH_CATCH_ALL { return makeExceptionHappenedString(); }
}
template<typename E>
@@ -626,17 +632,19 @@ struct ratio_string<std::milli> {
template<typename Duration>
struct StringMaker<std::chrono::time_point<std::chrono::system_clock, Duration>> {
static std::string convert(std::chrono::time_point<std::chrono::system_clock, Duration> const& time_point) {
auto converted = std::chrono::system_clock::to_time_t(time_point);
const auto systemish = std::chrono::time_point_cast<
std::chrono::system_clock::duration>( time_point );
const auto as_time_t = std::chrono::system_clock::to_time_t( systemish );
#ifdef _MSC_VER
std::tm timeInfo = {};
const auto err = gmtime_s(&timeInfo, &converted);
const auto err = gmtime_s( &timeInfo, &as_time_t );
if ( err ) {
return "gmtime from provided timepoint has failed. This "
"happens e.g. with pre-1970 dates using Microsoft libc";
}
#else
std::tm* timeInfo = std::gmtime(&converted);
std::tm* timeInfo = std::gmtime( &as_time_t );
#endif
auto const timeStampSize = sizeof("2017-01-16T17:06:45Z");
+1 -1
View File
@@ -36,7 +36,7 @@ namespace Catch {
}
Version const& libraryVersion() {
static Version version( 3, 9, 0, "", 0 );
static Version version( 3, 9, 1, "", 0 );
return version;
}
+1 -1
View File
@@ -10,6 +10,6 @@
#define CATCH_VERSION_MAJOR 3
#define CATCH_VERSION_MINOR 9
#define CATCH_VERSION_PATCH 0
#define CATCH_VERSION_PATCH 1
#endif // CATCH_VERSION_MACROS_HPP_INCLUDED
+15 -4
View File
@@ -14,6 +14,17 @@ namespace Catch {
bool isDebuggerActive();
}
#if !defined( CATCH_TRAP ) && defined( __clang__ ) && defined( __has_builtin )
# if __has_builtin( __builtin_debugtrap )
# define CATCH_TRAP() __builtin_debugtrap()
# endif
#endif
#if !defined( CATCH_TRAP ) && defined( _MSC_VER )
# define CATCH_TRAP() __debugbreak()
#endif
#if !defined(CATCH_TRAP) // If we couldn't use compiler-specific impl from above, we get into platform-specific options
#ifdef CATCH_PLATFORM_MAC
#if defined(__i386__) || defined(__x86_64__)
@@ -49,15 +60,15 @@ namespace Catch {
#define CATCH_TRAP() raise(SIGTRAP)
#endif
#elif defined(_MSC_VER)
#define CATCH_TRAP() __debugbreak()
#elif defined(__MINGW32__)
extern "C" __declspec(dllimport) void __stdcall DebugBreak();
#define CATCH_TRAP() DebugBreak()
#endif
#endif // ^^ CATCH_TRAP is not defined yet, so we define it
#ifndef CATCH_BREAK_INTO_DEBUGGER
#ifdef CATCH_TRAP
#if !defined(CATCH_BREAK_INTO_DEBUGGER)
#if defined(CATCH_TRAP)
#define CATCH_BREAK_INTO_DEBUGGER() []{ if( Catch::isDebuggerActive() ) { CATCH_TRAP(); } }()
#else
#define CATCH_BREAK_INTO_DEBUGGER() []{}()
+19 -9
View File
@@ -78,10 +78,11 @@
*
* 3) If a type has no linkage, we also cannot capture it by reference.
* The solution is once again to capture them by value. We handle
* the common cases by using `std::is_arithmetic` as the default
* for `Catch::capture_by_value`, but that is only a some-effort
* heuristic. But as with 2), users can specialize `capture_by_value`
* for their own types as needed.
* the common cases by using `std::is_arithmetic` and `std::is_enum`
* as the default for `Catch::capture_by_value`, but that is only a
* some-effort heuristic. These combine to capture all possible bitfield
* bases, and also some trait-like types. As with 2), users can
* specialize `capture_by_value` for their own types as needed.
*
* 4) To support C++20 and make the SFINAE on our decomposing operators
* work, the SFINAE has to happen in return type, rather than in
@@ -133,13 +134,22 @@ namespace Catch {
using RemoveCVRef_t = std::remove_cv_t<std::remove_reference_t<T>>;
}
// Note: There is nothing that stops us from extending this,
// e.g. to `std::is_scalar`, but the more encompassing
// traits are usually also more expensive. For now we
// keep this as it used to be and it can be changed later.
// Note: This is about as much as we can currently reasonably support.
// In an ideal world, we could capture by value small trivially
// copyable types, but the actual `std::is_trivially_copyable`
// trait is a huge mess with standard-violating results on
// GCC and Clang, which are unlikely to be fixed soon due to ABI
// concerns.
// `std::is_scalar` also causes issues due to the `is_pointer`
// component, which causes ambiguity issues with (references-to)
// function pointer. If those are resolved, we still need to
// disambiguate the overload set for arrays, through explicit
// overload for references to sized arrays.
template <typename T>
struct capture_by_value
: std::integral_constant<bool, std::is_arithmetic<T>{}> {};
: std::integral_constant<bool,
std::is_arithmetic<T>::value ||
std::is_enum<T>::value> {};
#if defined( CATCH_CONFIG_CPP20_COMPARE_OVERLOADS )
template <>
@@ -59,10 +59,10 @@ namespace Catch {
// To avoid having to handle TFE explicitly everywhere, we just
// rethrow it so that it goes back up the caller.
catch( TestFailureException& ) {
std::rethrow_exception(std::current_exception());
return "{ nested assertion failed }";
}
catch( TestSkipException& ) {
std::rethrow_exception(std::current_exception());
return "{ nested SKIP() called }";
}
catch( std::exception const& ex ) {
return ex.what();
+1 -1
View File
@@ -92,7 +92,7 @@ namespace Detail {
}
explicit operator bool() const {
return m_ptr;
return m_ptr != nullptr;
}
friend void swap(unique_ptr& lhs, unique_ptr& rhs) {
+6 -2
View File
@@ -39,9 +39,13 @@ namespace Catch {
__assume( false );
# elif defined( __GNUC__ )
__builtin_unreachable();
# endif
# endif // ^^ NDEBUG
# else // vv platform without known optimization hint
std::terminate();
# endif
# else // ^^ NDEBUG
// For non-release builds, we prefer termination on bug over UB
std::terminate();
# endif //
}
} // namespace Detail
@@ -26,6 +26,7 @@ Nor would this
:test-result: PASS #2152 - ULP checks between differently signed values were wrong - double
:test-result: PASS #2152 - ULP checks between differently signed values were wrong - float
:test-result: XFAIL #2615 - Throwing in constructor generator fails test case but does not abort
:test-result: PASS #3001: Enum-based bitfields can be captured
:test-result: XFAIL #748 - captures with unexpected exceptions
:test-result: PASS #809
:test-result: PASS #833
@@ -95,6 +96,8 @@ Nor would this
:test-result: PASS Approximate comparisons with mixed numeric types
:test-result: PASS Arbitrary predicate matcher
:test-result: PASS Assertion macros support bit operators and bool conversions
:test-result: XFAIL Assertions can be nested - CHECK
:test-result: XFAIL Assertions can be nested - REQUIRE
:test-result: PASS Assertions then sections
:test-result: PASS Basic use of the Contains range matcher
:test-result: PASS Basic use of the Empty range matcher
@@ -119,6 +122,7 @@ Nor would this
:test-result: PASS Combining templated and concrete matchers
:test-result: PASS Combining templated matchers
:test-result: PASS Commas in various macros are allowed
:test-result: PASS Comparing (and stringifying) volatile pointers works
:test-result: PASS Comparing function pointers
:test-result: PASS Comparison ops
:test-result: PASS Comparison with explicitly convertible types
@@ -150,9 +154,11 @@ Nor would this
:test-result: PASS Exception matchers that succeed
:test-result: PASS Exception message can be matched
:test-result: PASS Exception messages can be tested for
:test-result: PASS Exception thrown inside stringify does not fail the test
:test-result: PASS Exceptions matchers
:test-result: FAIL Expected exceptions that don't throw or unexpected exceptions fail the test
:test-result: FAIL FAIL aborts the test
:test-result: XFAIL FAIL can be nested in assertion
:test-result: FAIL FAIL does not require an argument
:test-result: FAIL FAIL_CHECK does not abort the test
:test-result: PASS Factorials are computed
@@ -408,6 +414,7 @@ b1!
:test-result: PASS stringify( vectors<has_maker_and_operator> )
:test-result: PASS stringify( vectors<has_operator> )
:test-result: PASS strlen3
:test-result: PASS system_clock timepoint with non-default duration
:test-result: PASS tables
:test-result: PASS tags with dots in later positions are not parsed as hidden
:test-result: SKIP tests can be skipped dynamically at runtime
@@ -24,6 +24,7 @@
:test-result: PASS #2152 - ULP checks between differently signed values were wrong - double
:test-result: PASS #2152 - ULP checks between differently signed values were wrong - float
:test-result: XFAIL #2615 - Throwing in constructor generator fails test case but does not abort
:test-result: PASS #3001: Enum-based bitfields can be captured
:test-result: XFAIL #748 - captures with unexpected exceptions
:test-result: PASS #809
:test-result: PASS #833
@@ -93,6 +94,8 @@
:test-result: PASS Approximate comparisons with mixed numeric types
:test-result: PASS Arbitrary predicate matcher
:test-result: PASS Assertion macros support bit operators and bool conversions
:test-result: XFAIL Assertions can be nested - CHECK
:test-result: XFAIL Assertions can be nested - REQUIRE
:test-result: PASS Assertions then sections
:test-result: PASS Basic use of the Contains range matcher
:test-result: PASS Basic use of the Empty range matcher
@@ -117,6 +120,7 @@
:test-result: PASS Combining templated and concrete matchers
:test-result: PASS Combining templated matchers
:test-result: PASS Commas in various macros are allowed
:test-result: PASS Comparing (and stringifying) volatile pointers works
:test-result: PASS Comparing function pointers
:test-result: PASS Comparison ops
:test-result: PASS Comparison with explicitly convertible types
@@ -148,9 +152,11 @@
:test-result: PASS Exception matchers that succeed
:test-result: PASS Exception message can be matched
:test-result: PASS Exception messages can be tested for
:test-result: PASS Exception thrown inside stringify does not fail the test
:test-result: PASS Exceptions matchers
:test-result: FAIL Expected exceptions that don't throw or unexpected exceptions fail the test
:test-result: FAIL FAIL aborts the test
:test-result: XFAIL FAIL can be nested in assertion
:test-result: FAIL FAIL does not require an argument
:test-result: FAIL FAIL_CHECK does not abort the test
:test-result: PASS Factorials are computed
@@ -397,6 +403,7 @@
:test-result: PASS stringify( vectors<has_maker_and_operator> )
:test-result: PASS stringify( vectors<has_operator> )
:test-result: PASS strlen3
:test-result: PASS system_clock timepoint with non-default duration
:test-result: PASS tables
:test-result: PASS tags with dots in later positions are not parsed as hidden
:test-result: SKIP tests can be skipped dynamically at runtime
@@ -85,6 +85,8 @@ Matchers.tests.cpp:<line number>: passed: smallest_non_zero, !WithinULP( -smalle
Matchers.tests.cpp:<line number>: passed: smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) for: 0.0f is within 2 ULPs of -1.40129846e-45f ([-4.20389539e-45, 1.40129846e-45])
Matchers.tests.cpp:<line number>: passed: smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) for: 0.0f not is within 1 ULPs of -1.40129846e-45f ([-2.80259693e-45, -0.00000000e+00])
Generators.tests.cpp:<line number>: failed: unexpected exception with message: 'failure to init'; expression was: {Unknown expression after the reported line}
Compilation.tests.cpp:<line number>: passed: bf.e == 1 for: 1 == 1
Compilation.tests.cpp:<line number>: passed: 1 == bf.e for: 1 == 1
Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'expected exception'; expression was: {Unknown expression after the reported line}
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'
@@ -332,6 +334,11 @@ Compilation.tests.cpp:<line number>: passed: !(lhs & rhs) for: !(Val: 1 & Val: 2
Compilation.tests.cpp:<line number>: passed: HasBitOperators{ 1 } & HasBitOperators{ 1 } for: Val: 1 & Val: 1
Compilation.tests.cpp:<line number>: passed: lhs ^ rhs for: Val: 1 ^ Val: 2
Compilation.tests.cpp:<line number>: passed: !(lhs ^ lhs) for: !(Val: 1 ^ Val: 1)
AssertionHandler.tests.cpp:<line number>: failed: i > 10 for: 2 > 10
AssertionHandler.tests.cpp:<line number>: failed: unexpected exception with message: '{ nested assertion failed }'; expression was: foo( 2 ) == 2
AssertionHandler.tests.cpp:<line number>: passed: true
AssertionHandler.tests.cpp:<line number>: failed: i > 10 for: 2 > 10
AssertionHandler.tests.cpp:<line number>: failed: unexpected exception with message: '{ nested assertion failed }'; expression was: foo( 2 ) == 2
Tricky.tests.cpp:<line number>: passed: true
Tricky.tests.cpp:<line number>: passed: true
Tricky.tests.cpp:<line number>: passed: true
@@ -476,6 +483,13 @@ Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2} == std::vector<in
Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 }
Tricky.tests.cpp:<line number>: passed: true
Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 }
Misc.tests.cpp:<line number>: passed: !(ptr) for: !0
Misc.tests.cpp:<line number>: passed: ptr == ptr for: 0 == 0
Misc.tests.cpp:<line number>: passed: !(ptr != ptr) for: !(0 != 0)
Misc.tests.cpp:<line number>: passed: !(ptr < ptr) for: !(0 < 0)
Misc.tests.cpp:<line number>: passed: ptr <= ptr for: 0 <= 0
Misc.tests.cpp:<line number>: passed: !(ptr > ptr) for: !(0 > 0)
Misc.tests.cpp:<line number>: passed: ptr >= ptr for: 0 >= 0
Tricky.tests.cpp:<line number>: passed: a for: 0x<hex digits>
Tricky.tests.cpp:<line number>: passed: a == &foo for: 0x<hex digits> == 0x<hex digits>
RandomNumberGeneration.tests.cpp:<line number>: passed: SimplePcg32{} == SimplePcg32{} for: {?} == {?}
@@ -628,6 +642,9 @@ Exception.tests.cpp:<line number>: passed: thisThrows(), StartsWith( "expected"
Exception.tests.cpp:<line number>: passed: thisThrows(), EndsWith( "exception" ) for: "expected exception" ends with: "exception"
Exception.tests.cpp:<line number>: passed: thisThrows(), ContainsSubstring( "except" ) for: "expected exception" contains: "except"
Exception.tests.cpp:<line number>: passed: thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) for: "expected exception" contains: "except" (case insensitive)
ToString.tests.cpp:<line number>: passed: tos == tos for: { stringification failed with an exception: "Invalid" }
==
{ stringification failed with an exception: "Invalid" }
Matchers.tests.cpp:<line number>: passed: throwsDerivedException(), DerivedException, Message( "DerivedException::what" ) for: DerivedException::what exception message matches "DerivedException::what"
Matchers.tests.cpp:<line number>: passed: throwsDerivedException(), DerivedException, !Message( "derivedexception::what" ) for: DerivedException::what not exception message matches "derivedexception::what"
Matchers.tests.cpp:<line number>: passed: throwsSpecialException( 2 ), SpecialException, !Message( "DerivedException::what" ) for: SpecialException::what not exception message matches "DerivedException::what"
@@ -636,6 +653,8 @@ Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'e
Exception.tests.cpp:<line number>: failed: expected exception, got none; expression was: thisDoesntThrow(), std::domain_error
Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'expected exception'; expression was: thisThrows()
Message.tests.cpp:<line number>: failed: explicitly with 1 message: 'This is a failure'
AssertionHandler.tests.cpp:<line number>: failed: explicitly with 1 message: 'Throw a Catch::TestFailureException'
AssertionHandler.tests.cpp:<line number>: failed: unexpected exception with message: '{ nested assertion failed }'; expression was: do_fail()
Message.tests.cpp:<line number>: failed: explicitly
Message.tests.cpp:<line number>: failed: explicitly with 1 message: 'This is a failure'
Message.tests.cpp:<line number>: warning: 'This message appears in the output'
@@ -2757,6 +2776,9 @@ Generators.tests.cpp:<line number>: passed: data.str.size() == data.len for: 3 =
Generators.tests.cpp:<line number>: passed: data.str.size() == data.len for: 3 == 3
Generators.tests.cpp:<line number>: passed: data.str.size() == data.len for: 5 == 5
Generators.tests.cpp:<line number>: passed: data.str.size() == data.len for: 4 == 4
ToStringChrono.tests.cpp:<line number>: passed: tp1 == tp2 for: {iso8601-timestamp}
==
{iso8601-timestamp}
Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 5 == 5
Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 6 == 6
Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 5 == 5
@@ -2862,7 +2884,7 @@ InternalBenchmark.tests.cpp:<line number>: passed: med == 18. for: 18.0 == 18.0
InternalBenchmark.tests.cpp:<line number>: passed: q3 == 23. for: 23.0 == 23.0
Misc.tests.cpp:<line number>: passed:
Misc.tests.cpp:<line number>: passed:
test cases: 428 | 313 passed | 95 failed | 6 skipped | 14 failed as expected
assertions: 2281 | 2089 passed | 157 failed | 35 failed as expected
test cases: 435 | 317 passed | 95 failed | 6 skipped | 17 failed as expected
assertions: 2299 | 2101 passed | 157 failed | 41 failed as expected
@@ -83,6 +83,8 @@ Matchers.tests.cpp:<line number>: passed: smallest_non_zero, !WithinULP( -smalle
Matchers.tests.cpp:<line number>: passed: smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) for: 0.0f is within 2 ULPs of -1.40129846e-45f ([-4.20389539e-45, 1.40129846e-45])
Matchers.tests.cpp:<line number>: passed: smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) for: 0.0f not is within 1 ULPs of -1.40129846e-45f ([-2.80259693e-45, -0.00000000e+00])
Generators.tests.cpp:<line number>: failed: unexpected exception with message: 'failure to init'; expression was: {Unknown expression after the reported line}
Compilation.tests.cpp:<line number>: passed: bf.e == 1 for: 1 == 1
Compilation.tests.cpp:<line number>: passed: 1 == bf.e for: 1 == 1
Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'expected exception'; expression was: {Unknown expression after the reported line}
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'
@@ -330,6 +332,11 @@ Compilation.tests.cpp:<line number>: passed: !(lhs & rhs) for: !(Val: 1 & Val: 2
Compilation.tests.cpp:<line number>: passed: HasBitOperators{ 1 } & HasBitOperators{ 1 } for: Val: 1 & Val: 1
Compilation.tests.cpp:<line number>: passed: lhs ^ rhs for: Val: 1 ^ Val: 2
Compilation.tests.cpp:<line number>: passed: !(lhs ^ lhs) for: !(Val: 1 ^ Val: 1)
AssertionHandler.tests.cpp:<line number>: failed: i > 10 for: 2 > 10
AssertionHandler.tests.cpp:<line number>: failed: unexpected exception with message: '{ nested assertion failed }'; expression was: foo( 2 ) == 2
AssertionHandler.tests.cpp:<line number>: passed: true
AssertionHandler.tests.cpp:<line number>: failed: i > 10 for: 2 > 10
AssertionHandler.tests.cpp:<line number>: failed: unexpected exception with message: '{ nested assertion failed }'; expression was: foo( 2 ) == 2
Tricky.tests.cpp:<line number>: passed: true
Tricky.tests.cpp:<line number>: passed: true
Tricky.tests.cpp:<line number>: passed: true
@@ -474,6 +481,13 @@ Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2} == std::vector<in
Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 }
Tricky.tests.cpp:<line number>: passed: true
Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 }
Misc.tests.cpp:<line number>: passed: !(ptr) for: !0
Misc.tests.cpp:<line number>: passed: ptr == ptr for: 0 == 0
Misc.tests.cpp:<line number>: passed: !(ptr != ptr) for: !(0 != 0)
Misc.tests.cpp:<line number>: passed: !(ptr < ptr) for: !(0 < 0)
Misc.tests.cpp:<line number>: passed: ptr <= ptr for: 0 <= 0
Misc.tests.cpp:<line number>: passed: !(ptr > ptr) for: !(0 > 0)
Misc.tests.cpp:<line number>: passed: ptr >= ptr for: 0 >= 0
Tricky.tests.cpp:<line number>: passed: a for: 0x<hex digits>
Tricky.tests.cpp:<line number>: passed: a == &foo for: 0x<hex digits> == 0x<hex digits>
RandomNumberGeneration.tests.cpp:<line number>: passed: SimplePcg32{} == SimplePcg32{} for: {?} == {?}
@@ -626,6 +640,9 @@ Exception.tests.cpp:<line number>: passed: thisThrows(), StartsWith( "expected"
Exception.tests.cpp:<line number>: passed: thisThrows(), EndsWith( "exception" ) for: "expected exception" ends with: "exception"
Exception.tests.cpp:<line number>: passed: thisThrows(), ContainsSubstring( "except" ) for: "expected exception" contains: "except"
Exception.tests.cpp:<line number>: passed: thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) for: "expected exception" contains: "except" (case insensitive)
ToString.tests.cpp:<line number>: passed: tos == tos for: { stringification failed with an exception: "Invalid" }
==
{ stringification failed with an exception: "Invalid" }
Matchers.tests.cpp:<line number>: passed: throwsDerivedException(), DerivedException, Message( "DerivedException::what" ) for: DerivedException::what exception message matches "DerivedException::what"
Matchers.tests.cpp:<line number>: passed: throwsDerivedException(), DerivedException, !Message( "derivedexception::what" ) for: DerivedException::what not exception message matches "derivedexception::what"
Matchers.tests.cpp:<line number>: passed: throwsSpecialException( 2 ), SpecialException, !Message( "DerivedException::what" ) for: SpecialException::what not exception message matches "DerivedException::what"
@@ -634,6 +651,8 @@ Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'e
Exception.tests.cpp:<line number>: failed: expected exception, got none; expression was: thisDoesntThrow(), std::domain_error
Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'expected exception'; expression was: thisThrows()
Message.tests.cpp:<line number>: failed: explicitly with 1 message: 'This is a failure'
AssertionHandler.tests.cpp:<line number>: failed: explicitly with 1 message: 'Throw a Catch::TestFailureException'
AssertionHandler.tests.cpp:<line number>: failed: unexpected exception with message: '{ nested assertion failed }'; expression was: do_fail()
Message.tests.cpp:<line number>: failed: explicitly
Message.tests.cpp:<line number>: failed: explicitly with 1 message: 'This is a failure'
Message.tests.cpp:<line number>: warning: 'This message appears in the output'
@@ -2746,6 +2765,9 @@ Generators.tests.cpp:<line number>: passed: data.str.size() == data.len for: 3 =
Generators.tests.cpp:<line number>: passed: data.str.size() == data.len for: 3 == 3
Generators.tests.cpp:<line number>: passed: data.str.size() == data.len for: 5 == 5
Generators.tests.cpp:<line number>: passed: data.str.size() == data.len for: 4 == 4
ToStringChrono.tests.cpp:<line number>: passed: tp1 == tp2 for: {iso8601-timestamp}
==
{iso8601-timestamp}
Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 5 == 5
Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 6 == 6
Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 5 == 5
@@ -2851,7 +2873,7 @@ InternalBenchmark.tests.cpp:<line number>: passed: med == 18. for: 18.0 == 18.0
InternalBenchmark.tests.cpp:<line number>: passed: q3 == 23. for: 23.0 == 23.0
Misc.tests.cpp:<line number>: passed:
Misc.tests.cpp:<line number>: passed:
test cases: 428 | 313 passed | 95 failed | 6 skipped | 14 failed as expected
assertions: 2281 | 2089 passed | 157 failed | 35 failed as expected
test cases: 435 | 317 passed | 95 failed | 6 skipped | 17 failed as expected
assertions: 2299 | 2101 passed | 157 failed | 41 failed as expected
@@ -347,6 +347,38 @@ Exception.tests.cpp:<line number>: FAILED:
due to unexpected exception with message:
unexpected exception
-------------------------------------------------------------------------------
Assertions can be nested - CHECK
-------------------------------------------------------------------------------
AssertionHandler.tests.cpp:<line number>
...............................................................................
AssertionHandler.tests.cpp:<line number>: FAILED:
REQUIRE( i > 10 )
with expansion:
2 > 10
AssertionHandler.tests.cpp:<line number>: FAILED:
CHECK( foo( 2 ) == 2 )
due to unexpected exception with message:
{ nested assertion failed }
-------------------------------------------------------------------------------
Assertions can be nested - REQUIRE
-------------------------------------------------------------------------------
AssertionHandler.tests.cpp:<line number>
...............................................................................
AssertionHandler.tests.cpp:<line number>: FAILED:
REQUIRE( i > 10 )
with expansion:
2 > 10
AssertionHandler.tests.cpp:<line number>: FAILED:
REQUIRE( foo( 2 ) == 2 )
due to unexpected exception with message:
{ nested assertion failed }
-------------------------------------------------------------------------------
Captures do not leave block with an exception
-------------------------------------------------------------------------------
@@ -619,6 +651,21 @@ Message.tests.cpp:<line number>: FAILED:
explicitly with message:
This is a failure
-------------------------------------------------------------------------------
FAIL can be nested in assertion
-------------------------------------------------------------------------------
AssertionHandler.tests.cpp:<line number>
...............................................................................
AssertionHandler.tests.cpp:<line number>: FAILED:
explicitly with message:
Throw a Catch::TestFailureException
AssertionHandler.tests.cpp:<line number>: FAILED:
CHECK_NOTHROW( do_fail() )
due to unexpected exception with message:
{ nested assertion failed }
-------------------------------------------------------------------------------
FAIL does not require an argument
-------------------------------------------------------------------------------
@@ -1672,6 +1719,6 @@ due to unexpected exception with message:
Why would you throw a std::string?
===============================================================================
test cases: 428 | 331 passed | 76 failed | 7 skipped | 14 failed as expected
assertions: 2260 | 2089 passed | 136 failed | 35 failed as expected
test cases: 435 | 335 passed | 76 failed | 7 skipped | 17 failed as expected
assertions: 2278 | 2101 passed | 136 failed | 41 failed as expected
@@ -772,6 +772,22 @@ Generators.tests.cpp:<line number>: FAILED:
due to unexpected exception with message:
failure to init
-------------------------------------------------------------------------------
#3001: Enum-based bitfields can be captured
-------------------------------------------------------------------------------
Compilation.tests.cpp:<line number>
...............................................................................
Compilation.tests.cpp:<line number>: PASSED:
REQUIRE( bf.e == 1 )
with expansion:
1 == 1
Compilation.tests.cpp:<line number>: PASSED:
REQUIRE( 1 == bf.e )
with expansion:
1 == 1
-------------------------------------------------------------------------------
#748 - captures with unexpected exceptions
outside assertions
@@ -2566,6 +2582,41 @@ Compilation.tests.cpp:<line number>: PASSED:
with expansion:
!(Val: 1 ^ Val: 1)
-------------------------------------------------------------------------------
Assertions can be nested - CHECK
-------------------------------------------------------------------------------
AssertionHandler.tests.cpp:<line number>
...............................................................................
AssertionHandler.tests.cpp:<line number>: FAILED:
REQUIRE( i > 10 )
with expansion:
2 > 10
AssertionHandler.tests.cpp:<line number>: FAILED:
CHECK( foo( 2 ) == 2 )
due to unexpected exception with message:
{ nested assertion failed }
AssertionHandler.tests.cpp:<line number>: PASSED:
CHECK( true )
-------------------------------------------------------------------------------
Assertions can be nested - REQUIRE
-------------------------------------------------------------------------------
AssertionHandler.tests.cpp:<line number>
...............................................................................
AssertionHandler.tests.cpp:<line number>: FAILED:
REQUIRE( i > 10 )
with expansion:
2 > 10
AssertionHandler.tests.cpp:<line number>: FAILED:
REQUIRE( foo( 2 ) == 2 )
due to unexpected exception with message:
{ nested assertion failed }
-------------------------------------------------------------------------------
Assertions then sections
-------------------------------------------------------------------------------
@@ -3504,6 +3555,47 @@ Tricky.tests.cpp:<line number>: PASSED:
with expansion:
{ 1, 2 } == { 1, 2 }
-------------------------------------------------------------------------------
Comparing (and stringifying) volatile pointers works
-------------------------------------------------------------------------------
Misc.tests.cpp:<line number>
...............................................................................
Misc.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( ptr )
with expansion:
!0
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( ptr == ptr )
with expansion:
0 == 0
Misc.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( ptr != ptr )
with expansion:
!(0 != 0)
Misc.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( ptr < ptr )
with expansion:
!(0 < 0)
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( ptr <= ptr )
with expansion:
0 <= 0
Misc.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( ptr > ptr )
with expansion:
!(0 > 0)
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( ptr >= ptr )
with expansion:
0 >= 0
-------------------------------------------------------------------------------
Comparing function pointers
-------------------------------------------------------------------------------
@@ -4505,6 +4597,19 @@ Exception.tests.cpp:<line number>: PASSED:
with expansion:
"expected exception" contains: "except" (case insensitive)
-------------------------------------------------------------------------------
Exception thrown inside stringify does not fail the test
-------------------------------------------------------------------------------
ToString.tests.cpp:<line number>
...............................................................................
ToString.tests.cpp:<line number>: PASSED:
CHECK( tos == tos )
with expansion:
{ stringification failed with an exception: "Invalid" }
==
{ stringification failed with an exception: "Invalid" }
-------------------------------------------------------------------------------
Exceptions matchers
-------------------------------------------------------------------------------
@@ -4561,6 +4666,21 @@ Message.tests.cpp:<line number>: FAILED:
explicitly with message:
This is a failure
-------------------------------------------------------------------------------
FAIL can be nested in assertion
-------------------------------------------------------------------------------
AssertionHandler.tests.cpp:<line number>
...............................................................................
AssertionHandler.tests.cpp:<line number>: FAILED:
explicitly with message:
Throw a Catch::TestFailureException
AssertionHandler.tests.cpp:<line number>: FAILED:
CHECK_NOTHROW( do_fail() )
due to unexpected exception with message:
{ nested assertion failed }
-------------------------------------------------------------------------------
FAIL does not require an argument
-------------------------------------------------------------------------------
@@ -18343,6 +18463,19 @@ Generators.tests.cpp:<line number>: PASSED:
with expansion:
4 == 4
-------------------------------------------------------------------------------
system_clock timepoint with non-default duration
-------------------------------------------------------------------------------
ToStringChrono.tests.cpp:<line number>
...............................................................................
ToStringChrono.tests.cpp:<line number>: PASSED:
CHECK( tp1 == tp2 )
with expansion:
{iso8601-timestamp}
==
{iso8601-timestamp}
-------------------------------------------------------------------------------
tables
-------------------------------------------------------------------------------
@@ -19134,6 +19267,6 @@ Misc.tests.cpp:<line number>
Misc.tests.cpp:<line number>: PASSED:
===============================================================================
test cases: 428 | 313 passed | 95 failed | 6 skipped | 14 failed as expected
assertions: 2281 | 2089 passed | 157 failed | 35 failed as expected
test cases: 435 | 317 passed | 95 failed | 6 skipped | 17 failed as expected
assertions: 2299 | 2101 passed | 157 failed | 41 failed as expected
@@ -770,6 +770,22 @@ Generators.tests.cpp:<line number>: FAILED:
due to unexpected exception with message:
failure to init
-------------------------------------------------------------------------------
#3001: Enum-based bitfields can be captured
-------------------------------------------------------------------------------
Compilation.tests.cpp:<line number>
...............................................................................
Compilation.tests.cpp:<line number>: PASSED:
REQUIRE( bf.e == 1 )
with expansion:
1 == 1
Compilation.tests.cpp:<line number>: PASSED:
REQUIRE( 1 == bf.e )
with expansion:
1 == 1
-------------------------------------------------------------------------------
#748 - captures with unexpected exceptions
outside assertions
@@ -2564,6 +2580,41 @@ Compilation.tests.cpp:<line number>: PASSED:
with expansion:
!(Val: 1 ^ Val: 1)
-------------------------------------------------------------------------------
Assertions can be nested - CHECK
-------------------------------------------------------------------------------
AssertionHandler.tests.cpp:<line number>
...............................................................................
AssertionHandler.tests.cpp:<line number>: FAILED:
REQUIRE( i > 10 )
with expansion:
2 > 10
AssertionHandler.tests.cpp:<line number>: FAILED:
CHECK( foo( 2 ) == 2 )
due to unexpected exception with message:
{ nested assertion failed }
AssertionHandler.tests.cpp:<line number>: PASSED:
CHECK( true )
-------------------------------------------------------------------------------
Assertions can be nested - REQUIRE
-------------------------------------------------------------------------------
AssertionHandler.tests.cpp:<line number>
...............................................................................
AssertionHandler.tests.cpp:<line number>: FAILED:
REQUIRE( i > 10 )
with expansion:
2 > 10
AssertionHandler.tests.cpp:<line number>: FAILED:
REQUIRE( foo( 2 ) == 2 )
due to unexpected exception with message:
{ nested assertion failed }
-------------------------------------------------------------------------------
Assertions then sections
-------------------------------------------------------------------------------
@@ -3502,6 +3553,47 @@ Tricky.tests.cpp:<line number>: PASSED:
with expansion:
{ 1, 2 } == { 1, 2 }
-------------------------------------------------------------------------------
Comparing (and stringifying) volatile pointers works
-------------------------------------------------------------------------------
Misc.tests.cpp:<line number>
...............................................................................
Misc.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( ptr )
with expansion:
!0
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( ptr == ptr )
with expansion:
0 == 0
Misc.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( ptr != ptr )
with expansion:
!(0 != 0)
Misc.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( ptr < ptr )
with expansion:
!(0 < 0)
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( ptr <= ptr )
with expansion:
0 <= 0
Misc.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( ptr > ptr )
with expansion:
!(0 > 0)
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( ptr >= ptr )
with expansion:
0 >= 0
-------------------------------------------------------------------------------
Comparing function pointers
-------------------------------------------------------------------------------
@@ -4503,6 +4595,19 @@ Exception.tests.cpp:<line number>: PASSED:
with expansion:
"expected exception" contains: "except" (case insensitive)
-------------------------------------------------------------------------------
Exception thrown inside stringify does not fail the test
-------------------------------------------------------------------------------
ToString.tests.cpp:<line number>
...............................................................................
ToString.tests.cpp:<line number>: PASSED:
CHECK( tos == tos )
with expansion:
{ stringification failed with an exception: "Invalid" }
==
{ stringification failed with an exception: "Invalid" }
-------------------------------------------------------------------------------
Exceptions matchers
-------------------------------------------------------------------------------
@@ -4559,6 +4664,21 @@ Message.tests.cpp:<line number>: FAILED:
explicitly with message:
This is a failure
-------------------------------------------------------------------------------
FAIL can be nested in assertion
-------------------------------------------------------------------------------
AssertionHandler.tests.cpp:<line number>
...............................................................................
AssertionHandler.tests.cpp:<line number>: FAILED:
explicitly with message:
Throw a Catch::TestFailureException
AssertionHandler.tests.cpp:<line number>: FAILED:
CHECK_NOTHROW( do_fail() )
due to unexpected exception with message:
{ nested assertion failed }
-------------------------------------------------------------------------------
FAIL does not require an argument
-------------------------------------------------------------------------------
@@ -18332,6 +18452,19 @@ Generators.tests.cpp:<line number>: PASSED:
with expansion:
4 == 4
-------------------------------------------------------------------------------
system_clock timepoint with non-default duration
-------------------------------------------------------------------------------
ToStringChrono.tests.cpp:<line number>
...............................................................................
ToStringChrono.tests.cpp:<line number>: PASSED:
CHECK( tp1 == tp2 )
with expansion:
{iso8601-timestamp}
==
{iso8601-timestamp}
-------------------------------------------------------------------------------
tables
-------------------------------------------------------------------------------
@@ -19123,6 +19256,6 @@ Misc.tests.cpp:<line number>
Misc.tests.cpp:<line number>: PASSED:
===============================================================================
test cases: 428 | 313 passed | 95 failed | 6 skipped | 14 failed as expected
assertions: 2281 | 2089 passed | 157 failed | 35 failed as expected
test cases: 435 | 317 passed | 95 failed | 6 skipped | 17 failed as expected
assertions: 2299 | 2101 passed | 157 failed | 41 failed as expected
@@ -772,6 +772,22 @@ Generators.tests.cpp:<line number>: FAILED:
due to unexpected exception with message:
failure to init
-------------------------------------------------------------------------------
#3001: Enum-based bitfields can be captured
-------------------------------------------------------------------------------
Compilation.tests.cpp:<line number>
...............................................................................
Compilation.tests.cpp:<line number>: PASSED:
REQUIRE( bf.e == 1 )
with expansion:
1 == 1
Compilation.tests.cpp:<line number>: PASSED:
REQUIRE( 1 == bf.e )
with expansion:
1 == 1
-------------------------------------------------------------------------------
#748 - captures with unexpected exceptions
outside assertions
@@ -952,6 +968,6 @@ Condition.tests.cpp:<line number>: FAILED:
CHECK( true != true )
===============================================================================
test cases: 33 | 27 passed | 3 failed | 3 failed as expected
assertions: 102 | 94 passed | 4 failed | 4 failed as expected
test cases: 34 | 28 passed | 3 failed | 3 failed as expected
assertions: 104 | 96 passed | 4 failed | 4 failed as expected
+51 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuitesloose text artifact
>
<testsuite name="<exe-name>" errors="17" failures="140" skipped="12" tests="2293" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<testsuite name="<exe-name>" errors="17" failures="140" skipped="12" tests="2311" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<properties>
<property name="random-seed" value="1"/>
<property name="filters" value="&quot;*&quot; ~[!nonportable] ~[!benchmark] ~[approvals]"/>
@@ -60,6 +60,7 @@ failure to init
at Generators.tests.cpp:<line number>
</error>
</testcase>
<testcase classname="<exe-name>.global" name="#3001: Enum-based bitfields can be captured" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="#748 - captures with unexpected exceptions" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="#748 - captures with unexpected exceptions/outside assertions" time="{duration}" status="run">
<skipped message="TEST_CASE tagged with !mayfail"/>
@@ -390,6 +391,38 @@ at Exception.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Arbitrary predicate matcher/Function pointer" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Arbitrary predicate matcher/Lambdas + different type" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Assertion macros support bit operators and bool conversions" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Assertions can be nested - CHECK" time="{duration}" status="run">
<skipped message="TEST_CASE tagged with !mayfail"/>
<failure message="i > 10" type="REQUIRE">
FAILED:
REQUIRE( i > 10 )
with expansion:
2 > 10
at AssertionHandler.tests.cpp:<line number>
</failure>
<error message="foo( 2 ) == 2" type="CHECK">
FAILED:
CHECK( foo( 2 ) == 2 )
{ nested assertion failed }
at AssertionHandler.tests.cpp:<line number>
</error>
</testcase>
<testcase classname="<exe-name>.global" name="Assertions can be nested - REQUIRE" time="{duration}" status="run">
<skipped message="TEST_CASE tagged with !mayfail"/>
<failure message="i > 10" type="REQUIRE">
FAILED:
REQUIRE( i > 10 )
with expansion:
2 > 10
at AssertionHandler.tests.cpp:<line number>
</failure>
<error message="foo( 2 ) == 2" type="REQUIRE">
FAILED:
REQUIRE( foo( 2 ) == 2 )
{ nested assertion failed }
at AssertionHandler.tests.cpp:<line number>
</error>
</testcase>
<testcase classname="<exe-name>.global" name="Assertions then sections" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Assertions then sections/A section" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Assertions then sections/A section/Another section" time="{duration}" status="run"/>
@@ -455,6 +488,7 @@ at Message.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Combining templated and concrete matchers" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Combining templated matchers" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Commas in various macros are allowed" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Comparing (and stringifying) volatile pointers works" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Comparing function pointers" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Comparison ops" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Comparison with explicitly convertible types" time="{duration}" status="run"/>
@@ -711,6 +745,7 @@ at Matchers.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Exception messages can be tested for/exact match" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Exception messages can be tested for/different case" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Exception messages can be tested for/wildcarded" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Exception thrown inside stringify does not fail the test" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Exceptions matchers" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Expected exceptions that don't throw or unexpected exceptions fail the test" time="{duration}" status="run">
<error message="thisThrows(), std::string" type="CHECK_THROWS_AS">
@@ -738,6 +773,20 @@ This is a failure
at Message.tests.cpp:<line number>
</failure>
</testcase>
<testcase classname="<exe-name>.global" name="FAIL can be nested in assertion" time="{duration}" status="run">
<skipped message="TEST_CASE tagged with !mayfail"/>
<failure type="FAIL">
FAILED:
Throw a Catch::TestFailureException
at AssertionHandler.tests.cpp:<line number>
</failure>
<error message="do_fail()" type="CHECK_NOTHROW">
FAILED:
CHECK_NOTHROW( do_fail() )
{ nested assertion failed }
at AssertionHandler.tests.cpp:<line number>
</error>
</testcase>
<testcase classname="<exe-name>.global" name="FAIL does not require an argument" time="{duration}" status="run">
<failure type="FAIL">
FAILED:
@@ -2286,6 +2335,7 @@ at Message.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="stringify( vectors&lt;has_maker_and_operator> )" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="stringify( vectors&lt;has_operator> )" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="strlen3" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="system_clock timepoint with non-default duration" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="tables" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="tags with dots in later positions are not parsed as hidden" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="tests can be skipped dynamically at runtime" time="{duration}" status="run">
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="<exe-name>" errors="17" failures="140" skipped="12" tests="2293" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<testsuite name="<exe-name>" errors="17" failures="140" skipped="12" tests="2311" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<properties>
<property name="random-seed" value="1"/>
<property name="filters" value="&quot;*&quot; ~[!nonportable] ~[!benchmark] ~[approvals]"/>
@@ -59,6 +59,7 @@ failure to init
at Generators.tests.cpp:<line number>
</error>
</testcase>
<testcase classname="<exe-name>.global" name="#3001: Enum-based bitfields can be captured" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="#748 - captures with unexpected exceptions" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="#748 - captures with unexpected exceptions/outside assertions" time="{duration}" status="run">
<skipped message="TEST_CASE tagged with !mayfail"/>
@@ -389,6 +390,38 @@ at Exception.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Arbitrary predicate matcher/Function pointer" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Arbitrary predicate matcher/Lambdas + different type" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Assertion macros support bit operators and bool conversions" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Assertions can be nested - CHECK" time="{duration}" status="run">
<skipped message="TEST_CASE tagged with !mayfail"/>
<failure message="i > 10" type="REQUIRE">
FAILED:
REQUIRE( i > 10 )
with expansion:
2 > 10
at AssertionHandler.tests.cpp:<line number>
</failure>
<error message="foo( 2 ) == 2" type="CHECK">
FAILED:
CHECK( foo( 2 ) == 2 )
{ nested assertion failed }
at AssertionHandler.tests.cpp:<line number>
</error>
</testcase>
<testcase classname="<exe-name>.global" name="Assertions can be nested - REQUIRE" time="{duration}" status="run">
<skipped message="TEST_CASE tagged with !mayfail"/>
<failure message="i > 10" type="REQUIRE">
FAILED:
REQUIRE( i > 10 )
with expansion:
2 > 10
at AssertionHandler.tests.cpp:<line number>
</failure>
<error message="foo( 2 ) == 2" type="REQUIRE">
FAILED:
REQUIRE( foo( 2 ) == 2 )
{ nested assertion failed }
at AssertionHandler.tests.cpp:<line number>
</error>
</testcase>
<testcase classname="<exe-name>.global" name="Assertions then sections" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Assertions then sections/A section" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Assertions then sections/A section/Another section" time="{duration}" status="run"/>
@@ -454,6 +487,7 @@ at Message.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Combining templated and concrete matchers" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Combining templated matchers" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Commas in various macros are allowed" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Comparing (and stringifying) volatile pointers works" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Comparing function pointers" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Comparison ops" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Comparison with explicitly convertible types" time="{duration}" status="run"/>
@@ -710,6 +744,7 @@ at Matchers.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Exception messages can be tested for/exact match" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Exception messages can be tested for/different case" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Exception messages can be tested for/wildcarded" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Exception thrown inside stringify does not fail the test" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Exceptions matchers" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Expected exceptions that don't throw or unexpected exceptions fail the test" time="{duration}" status="run">
<error message="thisThrows(), std::string" type="CHECK_THROWS_AS">
@@ -737,6 +772,20 @@ This is a failure
at Message.tests.cpp:<line number>
</failure>
</testcase>
<testcase classname="<exe-name>.global" name="FAIL can be nested in assertion" time="{duration}" status="run">
<skipped message="TEST_CASE tagged with !mayfail"/>
<failure type="FAIL">
FAILED:
Throw a Catch::TestFailureException
at AssertionHandler.tests.cpp:<line number>
</failure>
<error message="do_fail()" type="CHECK_NOTHROW">
FAILED:
CHECK_NOTHROW( do_fail() )
{ nested assertion failed }
at AssertionHandler.tests.cpp:<line number>
</error>
</testcase>
<testcase classname="<exe-name>.global" name="FAIL does not require an argument" time="{duration}" status="run">
<failure type="FAIL">
FAILED:
@@ -2285,6 +2334,7 @@ at Message.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="stringify( vectors&lt;has_maker_and_operator> )" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="stringify( vectors&lt;has_operator> )" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="strlen3" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="system_clock timepoint with non-default duration" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="tables" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="tags with dots in later positions are not parsed as hidden" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="tests can be skipped dynamically at runtime" time="{duration}" status="run">
@@ -3,6 +3,49 @@
<testExecutions version="1"loose text artifact
>
<file path="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp">
<testCase name="Assertions can be nested - CHECK" duration="{duration}">
<skipped message="REQUIRE(i > 10)">
FAILED:
REQUIRE( i > 10 )
with expansion:
2 > 10
at AssertionHandler.tests.cpp:<line number>
</skipped>
<skipped message="CHECK(foo( 2 ) == 2)">
FAILED:
CHECK( foo( 2 ) == 2 )
{ nested assertion failed }
at AssertionHandler.tests.cpp:<line number>
</skipped>
</testCase>
<testCase name="Assertions can be nested - REQUIRE" duration="{duration}">
<skipped message="REQUIRE(i > 10)">
FAILED:
REQUIRE( i > 10 )
with expansion:
2 > 10
at AssertionHandler.tests.cpp:<line number>
</skipped>
<skipped message="REQUIRE(foo( 2 ) == 2)">
FAILED:
REQUIRE( foo( 2 ) == 2 )
{ nested assertion failed }
at AssertionHandler.tests.cpp:<line number>
</skipped>
</testCase>
<testCase name="FAIL can be nested in assertion" duration="{duration}">
<skipped message="FAIL()">
FAILED:
Throw a Catch::TestFailureException
at AssertionHandler.tests.cpp:<line number>
</skipped>
<skipped message="CHECK_NOTHROW(do_fail())">
FAILED:
CHECK_NOTHROW( do_fail() )
{ nested assertion failed }
at AssertionHandler.tests.cpp:<line number>
</skipped>
</testCase>
<testCase name="Incomplete AssertionHandler" duration="{duration}">
<skipped message="REQUIRE(Dummy)">
FAILED:
@@ -344,6 +387,7 @@ at AssertionHandler.tests.cpp:<line number>
</file>
<file path="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp">
<testCase name="Directly creating an EnumInfo" duration="{duration}"/>
<testCase name="Exception thrown inside stringify does not fail the test" duration="{duration}"/>
<testCase name="Range type with sentinel" duration="{duration}"/>
<testCase name="Stringifying char arrays with statically known sizes - char" duration="{duration}"/>
<testCase name="Stringifying char arrays with statically known sizes - signed char" duration="{duration}"/>
@@ -612,6 +656,7 @@ at Class.tests.cpp:<line number>
<testCase name="#1319: Sections can have description (even if it is not saved/SectionName" duration="{duration}"/>
<testCase name="#1403" duration="{duration}"/>
<testCase name="#1548" duration="{duration}"/>
<testCase name="#3001: Enum-based bitfields can be captured" duration="{duration}"/>
<testCase name="#809" duration="{duration}"/>
<testCase name="#833" duration="{duration}"/>
<testCase name="#872" duration="{duration}"/>
@@ -1889,6 +1934,7 @@ at Misc.tests.cpp:<line number>
<testCase name="A couple of nested sections followed by a failure/Outer" duration="{duration}"/>
<testCase name="A couple of nested sections followed by a failure/Outer/Inner" duration="{duration}"/>
<testCase name="An empty test with no assertions" duration="{duration}"/>
<testCase name="Comparing (and stringifying) volatile pointers works" duration="{duration}"/>
<testCase name="Factorials are computed" duration="{duration}"/>
<testCase name="ManuallyRegistered" duration="{duration}"/>
<testCase name="Nice descriptive name" duration="{duration}"/>
@@ -2254,6 +2300,7 @@ at Skip.tests.cpp:<line number>
<testCase name="Stringifying std::chrono::duration helpers" duration="{duration}"/>
<testCase name="Stringifying std::chrono::duration with weird ratios" duration="{duration}"/>
<testCase name="Stringifying std::chrono::time_point&lt;system_clock>" duration="{duration}"/>
<testCase name="system_clock timepoint with non-default duration" duration="{duration}"/>
</file>
<file path="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp">
<testCase name="Capture and info messages" duration="{duration}"/>
@@ -2,6 +2,49 @@
<!-- filters='"*" ~[!nonportable] ~[!benchmark] ~[approvals]' rng-seed=1 -->
<testExecutions version="1">
<file path="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp">
<testCase name="Assertions can be nested - CHECK" duration="{duration}">
<skipped message="REQUIRE(i > 10)">
FAILED:
REQUIRE( i > 10 )
with expansion:
2 > 10
at AssertionHandler.tests.cpp:<line number>
</skipped>
<skipped message="CHECK(foo( 2 ) == 2)">
FAILED:
CHECK( foo( 2 ) == 2 )
{ nested assertion failed }
at AssertionHandler.tests.cpp:<line number>
</skipped>
</testCase>
<testCase name="Assertions can be nested - REQUIRE" duration="{duration}">
<skipped message="REQUIRE(i > 10)">
FAILED:
REQUIRE( i > 10 )
with expansion:
2 > 10
at AssertionHandler.tests.cpp:<line number>
</skipped>
<skipped message="REQUIRE(foo( 2 ) == 2)">
FAILED:
REQUIRE( foo( 2 ) == 2 )
{ nested assertion failed }
at AssertionHandler.tests.cpp:<line number>
</skipped>
</testCase>
<testCase name="FAIL can be nested in assertion" duration="{duration}">
<skipped message="FAIL()">
FAILED:
Throw a Catch::TestFailureException
at AssertionHandler.tests.cpp:<line number>
</skipped>
<skipped message="CHECK_NOTHROW(do_fail())">
FAILED:
CHECK_NOTHROW( do_fail() )
{ nested assertion failed }
at AssertionHandler.tests.cpp:<line number>
</skipped>
</testCase>
<testCase name="Incomplete AssertionHandler" duration="{duration}">
<skipped message="REQUIRE(Dummy)">
FAILED:
@@ -343,6 +386,7 @@ at AssertionHandler.tests.cpp:<line number>
</file>
<file path="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp">
<testCase name="Directly creating an EnumInfo" duration="{duration}"/>
<testCase name="Exception thrown inside stringify does not fail the test" duration="{duration}"/>
<testCase name="Range type with sentinel" duration="{duration}"/>
<testCase name="Stringifying char arrays with statically known sizes - char" duration="{duration}"/>
<testCase name="Stringifying char arrays with statically known sizes - signed char" duration="{duration}"/>
@@ -611,6 +655,7 @@ at Class.tests.cpp:<line number>
<testCase name="#1319: Sections can have description (even if it is not saved/SectionName" duration="{duration}"/>
<testCase name="#1403" duration="{duration}"/>
<testCase name="#1548" duration="{duration}"/>
<testCase name="#3001: Enum-based bitfields can be captured" duration="{duration}"/>
<testCase name="#809" duration="{duration}"/>
<testCase name="#833" duration="{duration}"/>
<testCase name="#872" duration="{duration}"/>
@@ -1888,6 +1933,7 @@ at Misc.tests.cpp:<line number>
<testCase name="A couple of nested sections followed by a failure/Outer" duration="{duration}"/>
<testCase name="A couple of nested sections followed by a failure/Outer/Inner" duration="{duration}"/>
<testCase name="An empty test with no assertions" duration="{duration}"/>
<testCase name="Comparing (and stringifying) volatile pointers works" duration="{duration}"/>
<testCase name="Factorials are computed" duration="{duration}"/>
<testCase name="ManuallyRegistered" duration="{duration}"/>
<testCase name="Nice descriptive name" duration="{duration}"/>
@@ -2253,6 +2299,7 @@ at Skip.tests.cpp:<line number>
<testCase name="Stringifying std::chrono::duration helpers" duration="{duration}"/>
<testCase name="Stringifying std::chrono::duration with weird ratios" duration="{duration}"/>
<testCase name="Stringifying std::chrono::time_point&lt;system_clock>" duration="{duration}"/>
<testCase name="system_clock timepoint with non-default duration" duration="{duration}"/>
</file>
<file path="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp">
<testCase name="Capture and info messages" duration="{duration}"/>
+37 -1
View File
@@ -166,6 +166,10 @@ ok {test-number} - smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) for: 0.
ok {test-number} - smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) for: 0.0f not is within 1 ULPs of -1.40129846e-45f ([-2.80259693e-45, -0.00000000e+00])
# #2615 - Throwing in constructor generator fails test case but does not abort
not ok {test-number} - unexpected exception with message: 'failure to init'; expression was: {Unknown expression after the reported line}
# #3001: Enum-based bitfields can be captured
ok {test-number} - bf.e == 1 for: 1 == 1
# #3001: Enum-based bitfields can be captured
ok {test-number} - 1 == bf.e for: 1 == 1
# #748 - captures with unexpected exceptions
not ok {test-number} - unexpected exception with message: 'expected exception'; expression was: {Unknown expression after the reported line}
# #748 - captures with unexpected exceptions
@@ -612,6 +616,16 @@ ok {test-number} - HasBitOperators{ 1 } & HasBitOperators{ 1 } for: Val: 1 & Val
ok {test-number} - lhs ^ rhs for: Val: 1 ^ Val: 2
# Assertion macros support bit operators and bool conversions
ok {test-number} - !(lhs ^ lhs) for: !(Val: 1 ^ Val: 1)
# Assertions can be nested - CHECK
not ok {test-number} - i > 10 for: 2 > 10
# Assertions can be nested - CHECK
not ok {test-number} - unexpected exception with message: '{ nested assertion failed }'; expression was: foo( 2 ) == 2
# Assertions can be nested - CHECK
ok {test-number} - true
# Assertions can be nested - REQUIRE
not ok {test-number} - i > 10 for: 2 > 10
# Assertions can be nested - REQUIRE
not ok {test-number} - unexpected exception with message: '{ nested assertion failed }'; expression was: foo( 2 ) == 2
# Assertions then sections
ok {test-number} - true
# Assertions then sections
@@ -852,6 +866,20 @@ ok {test-number} - std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2
ok {test-number} - true
# Commas in various macros are allowed
ok {test-number} - std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 }
# Comparing (and stringifying) volatile pointers works
ok {test-number} - !(ptr) for: !0
# Comparing (and stringifying) volatile pointers works
ok {test-number} - ptr == ptr for: 0 == 0
# Comparing (and stringifying) volatile pointers works
ok {test-number} - !(ptr != ptr) for: !(0 != 0)
# Comparing (and stringifying) volatile pointers works
ok {test-number} - !(ptr < ptr) for: !(0 < 0)
# Comparing (and stringifying) volatile pointers works
ok {test-number} - ptr <= ptr for: 0 <= 0
# Comparing (and stringifying) volatile pointers works
ok {test-number} - !(ptr > ptr) for: !(0 > 0)
# Comparing (and stringifying) volatile pointers works
ok {test-number} - ptr >= ptr for: 0 >= 0
# Comparing function pointers
ok {test-number} - a for: 0x<hex digits>
# Comparing function pointers
@@ -1116,6 +1144,8 @@ ok {test-number} - thisThrows(), EndsWith( "exception" ) for: "expected exceptio
ok {test-number} - thisThrows(), ContainsSubstring( "except" ) for: "expected exception" contains: "except"
# Exception messages can be tested for
ok {test-number} - thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) for: "expected exception" contains: "except" (case insensitive)
# Exception thrown inside stringify does not fail the test
ok {test-number} - tos == tos for: { stringification failed with an exception: "Invalid" } == { stringification failed with an exception: "Invalid" }
# Exceptions matchers
ok {test-number} - throwsDerivedException(), DerivedException, Message( "DerivedException::what" ) for: DerivedException::what exception message matches "DerivedException::what"
# Exceptions matchers
@@ -1132,6 +1162,10 @@ not ok {test-number} - expected exception, got none; expression was: thisDoesntT
not ok {test-number} - unexpected exception with message: 'expected exception'; expression was: thisThrows()
# FAIL aborts the test
not ok {test-number} - explicitly with 1 message: 'This is a failure'
# FAIL can be nested in assertion
not ok {test-number} - explicitly with 1 message: 'Throw a Catch::TestFailureException'
# FAIL can be nested in assertion
not ok {test-number} - unexpected exception with message: '{ nested assertion failed }'; expression was: do_fail()
# FAIL does not require an argument
not ok {test-number} - explicitly
# FAIL_CHECK does not abort the test
@@ -4393,6 +4427,8 @@ ok {test-number} - data.str.size() == data.len for: 3 == 3
ok {test-number} - data.str.size() == data.len for: 5 == 5
# strlen3
ok {test-number} - data.str.size() == data.len for: 4 == 4
# system_clock timepoint with non-default duration
ok {test-number} - tp1 == tp2 for: {iso8601-timestamp} == {iso8601-timestamp}
# tables
ok {test-number} - strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 5 == 5
# tables
@@ -4583,5 +4619,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0
ok {test-number} -
# xmlentitycheck
ok {test-number} -
1..2293
1..2311
@@ -164,6 +164,10 @@ ok {test-number} - smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) for: 0.
ok {test-number} - smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) for: 0.0f not is within 1 ULPs of -1.40129846e-45f ([-2.80259693e-45, -0.00000000e+00])
# #2615 - Throwing in constructor generator fails test case but does not abort
not ok {test-number} - unexpected exception with message: 'failure to init'; expression was: {Unknown expression after the reported line}
# #3001: Enum-based bitfields can be captured
ok {test-number} - bf.e == 1 for: 1 == 1
# #3001: Enum-based bitfields can be captured
ok {test-number} - 1 == bf.e for: 1 == 1
# #748 - captures with unexpected exceptions
not ok {test-number} - unexpected exception with message: 'expected exception'; expression was: {Unknown expression after the reported line}
# #748 - captures with unexpected exceptions
@@ -610,6 +614,16 @@ ok {test-number} - HasBitOperators{ 1 } & HasBitOperators{ 1 } for: Val: 1 & Val
ok {test-number} - lhs ^ rhs for: Val: 1 ^ Val: 2
# Assertion macros support bit operators and bool conversions
ok {test-number} - !(lhs ^ lhs) for: !(Val: 1 ^ Val: 1)
# Assertions can be nested - CHECK
not ok {test-number} - i > 10 for: 2 > 10
# Assertions can be nested - CHECK
not ok {test-number} - unexpected exception with message: '{ nested assertion failed }'; expression was: foo( 2 ) == 2
# Assertions can be nested - CHECK
ok {test-number} - true
# Assertions can be nested - REQUIRE
not ok {test-number} - i > 10 for: 2 > 10
# Assertions can be nested - REQUIRE
not ok {test-number} - unexpected exception with message: '{ nested assertion failed }'; expression was: foo( 2 ) == 2
# Assertions then sections
ok {test-number} - true
# Assertions then sections
@@ -850,6 +864,20 @@ ok {test-number} - std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2
ok {test-number} - true
# Commas in various macros are allowed
ok {test-number} - std::vector<int>{1, 2} == std::vector<int>{1, 2} for: { 1, 2 } == { 1, 2 }
# Comparing (and stringifying) volatile pointers works
ok {test-number} - !(ptr) for: !0
# Comparing (and stringifying) volatile pointers works
ok {test-number} - ptr == ptr for: 0 == 0
# Comparing (and stringifying) volatile pointers works
ok {test-number} - !(ptr != ptr) for: !(0 != 0)
# Comparing (and stringifying) volatile pointers works
ok {test-number} - !(ptr < ptr) for: !(0 < 0)
# Comparing (and stringifying) volatile pointers works
ok {test-number} - ptr <= ptr for: 0 <= 0
# Comparing (and stringifying) volatile pointers works
ok {test-number} - !(ptr > ptr) for: !(0 > 0)
# Comparing (and stringifying) volatile pointers works
ok {test-number} - ptr >= ptr for: 0 >= 0
# Comparing function pointers
ok {test-number} - a for: 0x<hex digits>
# Comparing function pointers
@@ -1114,6 +1142,8 @@ ok {test-number} - thisThrows(), EndsWith( "exception" ) for: "expected exceptio
ok {test-number} - thisThrows(), ContainsSubstring( "except" ) for: "expected exception" contains: "except"
# Exception messages can be tested for
ok {test-number} - thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) for: "expected exception" contains: "except" (case insensitive)
# Exception thrown inside stringify does not fail the test
ok {test-number} - tos == tos for: { stringification failed with an exception: "Invalid" } == { stringification failed with an exception: "Invalid" }
# Exceptions matchers
ok {test-number} - throwsDerivedException(), DerivedException, Message( "DerivedException::what" ) for: DerivedException::what exception message matches "DerivedException::what"
# Exceptions matchers
@@ -1130,6 +1160,10 @@ not ok {test-number} - expected exception, got none; expression was: thisDoesntT
not ok {test-number} - unexpected exception with message: 'expected exception'; expression was: thisThrows()
# FAIL aborts the test
not ok {test-number} - explicitly with 1 message: 'This is a failure'
# FAIL can be nested in assertion
not ok {test-number} - explicitly with 1 message: 'Throw a Catch::TestFailureException'
# FAIL can be nested in assertion
not ok {test-number} - unexpected exception with message: '{ nested assertion failed }'; expression was: do_fail()
# FAIL does not require an argument
not ok {test-number} - explicitly
# FAIL_CHECK does not abort the test
@@ -4382,6 +4416,8 @@ ok {test-number} - data.str.size() == data.len for: 3 == 3
ok {test-number} - data.str.size() == data.len for: 5 == 5
# strlen3
ok {test-number} - data.str.size() == data.len for: 4 == 4
# system_clock timepoint with non-default duration
ok {test-number} - tp1 == tp2 for: {iso8601-timestamp} == {iso8601-timestamp}
# tables
ok {test-number} - strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 5 == 5
# tables
@@ -4572,5 +4608,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0
ok {test-number} -
# xmlentitycheck
ok {test-number} -
1..2293
1..2311
@@ -55,6 +55,8 @@
##teamcity[testStarted name='#2615 - Throwing in constructor generator fails test case but does not abort']
##teamcity[testIgnored name='#2615 - Throwing in constructor generator fails test case but does not abort' message='Generators.tests.cpp:<line number>|n...............................................................................|n|nGenerators.tests.cpp:<line number>|nunexpected exception with message:|n "failure to init"|n {Unknown expression after the reported line}|nwith expansion:|n {Unknown expression after the reported line}|n- failure ignore as test marked as |'ok to fail|'|n']
##teamcity[testFinished name='#2615 - Throwing in constructor generator fails test case but does not abort' duration="{duration}"]
##teamcity[testStarted name='#3001: Enum-based bitfields can be captured']
##teamcity[testFinished name='#3001: Enum-based bitfields can be captured' duration="{duration}"]
##teamcity[testStarted name='#748 - captures with unexpected exceptions']
##teamcity[testIgnored name='#748 - captures with unexpected exceptions' message='-------------------------------------------------------------------------------|noutside assertions|n-------------------------------------------------------------------------------|nException.tests.cpp:<line number>|n...............................................................................|n|nException.tests.cpp:<line number>|nunexpected exception with message:|n "expected exception"|n {Unknown expression after the reported line}|nwith expansion:|n {Unknown expression after the reported line}|n- failure ignore as test marked as |'ok to fail|'|n']
##teamcity[testIgnored name='#748 - captures with unexpected exceptions' message='-------------------------------------------------------------------------------|ninside REQUIRE_NOTHROW|n-------------------------------------------------------------------------------|nException.tests.cpp:<line number>|n...............................................................................|n|nException.tests.cpp:<line number>|nunexpected exception with messages:|n "answer := 42"|n "expected exception"|n REQUIRE_NOTHROW( thisThrows() )|nwith expansion:|n thisThrows()|n- failure ignore as test marked as |'ok to fail|'|n']
@@ -225,6 +227,14 @@
##teamcity[testFinished name='Arbitrary predicate matcher' duration="{duration}"]
##teamcity[testStarted name='Assertion macros support bit operators and bool conversions']
##teamcity[testFinished name='Assertion macros support bit operators and bool conversions' duration="{duration}"]
##teamcity[testStarted name='Assertions can be nested - CHECK']
##teamcity[testIgnored name='Assertions can be nested - CHECK' message='AssertionHandler.tests.cpp:<line number>|n...............................................................................|n|nAssertionHandler.tests.cpp:<line number>|nexpression failed|n REQUIRE( i > 10 )|nwith expansion:|n 2 > 10|n- failure ignore as test marked as |'ok to fail|'|n']
##teamcity[testIgnored name='Assertions can be nested - CHECK' message='AssertionHandler.tests.cpp:<line number>|nunexpected exception with message:|n "{ nested assertion failed }"|n CHECK( foo( 2 ) == 2 )|nwith expansion:|n foo( 2 ) == 2|n- failure ignore as test marked as |'ok to fail|'|n']
##teamcity[testFinished name='Assertions can be nested - CHECK' duration="{duration}"]
##teamcity[testStarted name='Assertions can be nested - REQUIRE']
##teamcity[testIgnored name='Assertions can be nested - REQUIRE' message='AssertionHandler.tests.cpp:<line number>|n...............................................................................|n|nAssertionHandler.tests.cpp:<line number>|nexpression failed|n REQUIRE( i > 10 )|nwith expansion:|n 2 > 10|n- failure ignore as test marked as |'ok to fail|'|n']
##teamcity[testIgnored name='Assertions can be nested - REQUIRE' message='AssertionHandler.tests.cpp:<line number>|nunexpected exception with message:|n "{ nested assertion failed }"|n REQUIRE( foo( 2 ) == 2 )|nwith expansion:|n foo( 2 ) == 2|n- failure ignore as test marked as |'ok to fail|'|n']
##teamcity[testFinished name='Assertions can be nested - REQUIRE' duration="{duration}"]
##teamcity[testStarted name='Assertions then sections']
##teamcity[testFinished name='Assertions then sections' duration="{duration}"]
##teamcity[testStarted name='Basic use of the Contains range matcher']
@@ -275,6 +285,8 @@
##teamcity[testFinished name='Combining templated matchers' duration="{duration}"]
##teamcity[testStarted name='Commas in various macros are allowed']
##teamcity[testFinished name='Commas in various macros are allowed' duration="{duration}"]
##teamcity[testStarted name='Comparing (and stringifying) volatile pointers works']
##teamcity[testFinished name='Comparing (and stringifying) volatile pointers works' duration="{duration}"]
##teamcity[testStarted name='Comparing function pointers']
##teamcity[testFinished name='Comparing function pointers' duration="{duration}"]
##teamcity[testStarted name='Comparison ops']
@@ -366,6 +378,8 @@
##teamcity[testFinished name='Exception message can be matched' duration="{duration}"]
##teamcity[testStarted name='Exception messages can be tested for']
##teamcity[testFinished name='Exception messages can be tested for' duration="{duration}"]
##teamcity[testStarted name='Exception thrown inside stringify does not fail the test']
##teamcity[testFinished name='Exception thrown inside stringify does not fail the test' duration="{duration}"]
##teamcity[testStarted name='Exceptions matchers']
##teamcity[testFinished name='Exceptions matchers' duration="{duration}"]
##teamcity[testStarted name='Expected exceptions that don|'t throw or unexpected exceptions fail the test']
@@ -376,6 +390,10 @@
##teamcity[testStarted name='FAIL aborts the test']
##teamcity[testFailed name='FAIL aborts the test' message='Message.tests.cpp:<line number>|n...............................................................................|n|nMessage.tests.cpp:<line number>|nexplicit failure with message:|n "This is a failure"']
##teamcity[testFinished name='FAIL aborts the test' duration="{duration}"]
##teamcity[testStarted name='FAIL can be nested in assertion']
##teamcity[testIgnored name='FAIL can be nested in assertion' message='AssertionHandler.tests.cpp:<line number>|n...............................................................................|n|nAssertionHandler.tests.cpp:<line number>|nexplicit failure with message:|n "Throw a Catch::TestFailureException"- failure ignore as test marked as |'ok to fail|'|n']
##teamcity[testIgnored name='FAIL can be nested in assertion' message='AssertionHandler.tests.cpp:<line number>|nunexpected exception with message:|n "{ nested assertion failed }"|n CHECK_NOTHROW( do_fail() )|nwith expansion:|n do_fail()|n- failure ignore as test marked as |'ok to fail|'|n']
##teamcity[testFinished name='FAIL can be nested in assertion' duration="{duration}"]
##teamcity[testStarted name='FAIL does not require an argument']
##teamcity[testFailed name='FAIL does not require an argument' message='Message.tests.cpp:<line number>|n...............................................................................|n|nMessage.tests.cpp:<line number>|nexplicit failure']
##teamcity[testFinished name='FAIL does not require an argument' duration="{duration}"]
@@ -985,6 +1003,8 @@ loose text artifact
##teamcity[testFinished name='stringify( vectors<has_operator> )' duration="{duration}"]
##teamcity[testStarted name='strlen3']
##teamcity[testFinished name='strlen3' duration="{duration}"]
##teamcity[testStarted name='system_clock timepoint with non-default duration']
##teamcity[testFinished name='system_clock timepoint with non-default duration' duration="{duration}"]
##teamcity[testStarted name='tables']
##teamcity[testFinished name='tables' duration="{duration}"]
##teamcity[testStarted name='tags with dots in later positions are not parsed as hidden']
@@ -55,6 +55,8 @@
##teamcity[testStarted name='#2615 - Throwing in constructor generator fails test case but does not abort']
##teamcity[testIgnored name='#2615 - Throwing in constructor generator fails test case but does not abort' message='Generators.tests.cpp:<line number>|n...............................................................................|n|nGenerators.tests.cpp:<line number>|nunexpected exception with message:|n "failure to init"|n {Unknown expression after the reported line}|nwith expansion:|n {Unknown expression after the reported line}|n- failure ignore as test marked as |'ok to fail|'|n']
##teamcity[testFinished name='#2615 - Throwing in constructor generator fails test case but does not abort' duration="{duration}"]
##teamcity[testStarted name='#3001: Enum-based bitfields can be captured']
##teamcity[testFinished name='#3001: Enum-based bitfields can be captured' duration="{duration}"]
##teamcity[testStarted name='#748 - captures with unexpected exceptions']
##teamcity[testIgnored name='#748 - captures with unexpected exceptions' message='-------------------------------------------------------------------------------|noutside assertions|n-------------------------------------------------------------------------------|nException.tests.cpp:<line number>|n...............................................................................|n|nException.tests.cpp:<line number>|nunexpected exception with message:|n "expected exception"|n {Unknown expression after the reported line}|nwith expansion:|n {Unknown expression after the reported line}|n- failure ignore as test marked as |'ok to fail|'|n']
##teamcity[testIgnored name='#748 - captures with unexpected exceptions' message='-------------------------------------------------------------------------------|ninside REQUIRE_NOTHROW|n-------------------------------------------------------------------------------|nException.tests.cpp:<line number>|n...............................................................................|n|nException.tests.cpp:<line number>|nunexpected exception with messages:|n "answer := 42"|n "expected exception"|n REQUIRE_NOTHROW( thisThrows() )|nwith expansion:|n thisThrows()|n- failure ignore as test marked as |'ok to fail|'|n']
@@ -225,6 +227,14 @@
##teamcity[testFinished name='Arbitrary predicate matcher' duration="{duration}"]
##teamcity[testStarted name='Assertion macros support bit operators and bool conversions']
##teamcity[testFinished name='Assertion macros support bit operators and bool conversions' duration="{duration}"]
##teamcity[testStarted name='Assertions can be nested - CHECK']
##teamcity[testIgnored name='Assertions can be nested - CHECK' message='AssertionHandler.tests.cpp:<line number>|n...............................................................................|n|nAssertionHandler.tests.cpp:<line number>|nexpression failed|n REQUIRE( i > 10 )|nwith expansion:|n 2 > 10|n- failure ignore as test marked as |'ok to fail|'|n']
##teamcity[testIgnored name='Assertions can be nested - CHECK' message='AssertionHandler.tests.cpp:<line number>|nunexpected exception with message:|n "{ nested assertion failed }"|n CHECK( foo( 2 ) == 2 )|nwith expansion:|n foo( 2 ) == 2|n- failure ignore as test marked as |'ok to fail|'|n']
##teamcity[testFinished name='Assertions can be nested - CHECK' duration="{duration}"]
##teamcity[testStarted name='Assertions can be nested - REQUIRE']
##teamcity[testIgnored name='Assertions can be nested - REQUIRE' message='AssertionHandler.tests.cpp:<line number>|n...............................................................................|n|nAssertionHandler.tests.cpp:<line number>|nexpression failed|n REQUIRE( i > 10 )|nwith expansion:|n 2 > 10|n- failure ignore as test marked as |'ok to fail|'|n']
##teamcity[testIgnored name='Assertions can be nested - REQUIRE' message='AssertionHandler.tests.cpp:<line number>|nunexpected exception with message:|n "{ nested assertion failed }"|n REQUIRE( foo( 2 ) == 2 )|nwith expansion:|n foo( 2 ) == 2|n- failure ignore as test marked as |'ok to fail|'|n']
##teamcity[testFinished name='Assertions can be nested - REQUIRE' duration="{duration}"]
##teamcity[testStarted name='Assertions then sections']
##teamcity[testFinished name='Assertions then sections' duration="{duration}"]
##teamcity[testStarted name='Basic use of the Contains range matcher']
@@ -275,6 +285,8 @@
##teamcity[testFinished name='Combining templated matchers' duration="{duration}"]
##teamcity[testStarted name='Commas in various macros are allowed']
##teamcity[testFinished name='Commas in various macros are allowed' duration="{duration}"]
##teamcity[testStarted name='Comparing (and stringifying) volatile pointers works']
##teamcity[testFinished name='Comparing (and stringifying) volatile pointers works' duration="{duration}"]
##teamcity[testStarted name='Comparing function pointers']
##teamcity[testFinished name='Comparing function pointers' duration="{duration}"]
##teamcity[testStarted name='Comparison ops']
@@ -366,6 +378,8 @@
##teamcity[testFinished name='Exception message can be matched' duration="{duration}"]
##teamcity[testStarted name='Exception messages can be tested for']
##teamcity[testFinished name='Exception messages can be tested for' duration="{duration}"]
##teamcity[testStarted name='Exception thrown inside stringify does not fail the test']
##teamcity[testFinished name='Exception thrown inside stringify does not fail the test' duration="{duration}"]
##teamcity[testStarted name='Exceptions matchers']
##teamcity[testFinished name='Exceptions matchers' duration="{duration}"]
##teamcity[testStarted name='Expected exceptions that don|'t throw or unexpected exceptions fail the test']
@@ -376,6 +390,10 @@
##teamcity[testStarted name='FAIL aborts the test']
##teamcity[testFailed name='FAIL aborts the test' message='Message.tests.cpp:<line number>|n...............................................................................|n|nMessage.tests.cpp:<line number>|nexplicit failure with message:|n "This is a failure"']
##teamcity[testFinished name='FAIL aborts the test' duration="{duration}"]
##teamcity[testStarted name='FAIL can be nested in assertion']
##teamcity[testIgnored name='FAIL can be nested in assertion' message='AssertionHandler.tests.cpp:<line number>|n...............................................................................|n|nAssertionHandler.tests.cpp:<line number>|nexplicit failure with message:|n "Throw a Catch::TestFailureException"- failure ignore as test marked as |'ok to fail|'|n']
##teamcity[testIgnored name='FAIL can be nested in assertion' message='AssertionHandler.tests.cpp:<line number>|nunexpected exception with message:|n "{ nested assertion failed }"|n CHECK_NOTHROW( do_fail() )|nwith expansion:|n do_fail()|n- failure ignore as test marked as |'ok to fail|'|n']
##teamcity[testFinished name='FAIL can be nested in assertion' duration="{duration}"]
##teamcity[testStarted name='FAIL does not require an argument']
##teamcity[testFailed name='FAIL does not require an argument' message='Message.tests.cpp:<line number>|n...............................................................................|n|nMessage.tests.cpp:<line number>|nexplicit failure']
##teamcity[testFinished name='FAIL does not require an argument' duration="{duration}"]
@@ -984,6 +1002,8 @@
##teamcity[testFinished name='stringify( vectors<has_operator> )' duration="{duration}"]
##teamcity[testStarted name='strlen3']
##teamcity[testFinished name='strlen3' duration="{duration}"]
##teamcity[testStarted name='system_clock timepoint with non-default duration']
##teamcity[testFinished name='system_clock timepoint with non-default duration' duration="{duration}"]
##teamcity[testStarted name='tables']
##teamcity[testFinished name='tables' duration="{duration}"]
##teamcity[testStarted name='tags with dots in later positions are not parsed as hidden']
+175 -2
View File
@@ -681,6 +681,25 @@ Nor would this
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="#3001: Enum-based bitfields can be captured" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" >
<Original>
bf.e == 1
</Original>
<Expanded>
1 == 1
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" >
<Original>
1 == bf.e
</Original>
<Expanded>
1 == 1
</Expanded>
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="#748 - captures with unexpected exceptions" tags="[!shouldfail][!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" >
<Section name="outside assertions" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" >
<Expression success="false" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" >
@@ -2716,6 +2735,58 @@ Approx( 1.23399996757507324 )
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="Assertions can be nested - CHECK" tags="[!shouldfail][assertions]" filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
<Expression success="false" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
<Original>
i > 10
</Original>
<Expanded>
2 > 10
</Expanded>
</Expression>
<Expression success="false" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
<Original>
foo( 2 ) == 2
</Original>
<Expanded>
foo( 2 ) == 2
</Expanded>
<Exception filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
{ nested assertion failed }
</Exception>
</Expression>
<Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
<Original>
true
</Original>
<Expanded>
true
</Expanded>
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="Assertions can be nested - REQUIRE" tags="[!shouldfail][assertions]" filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
<Expression success="false" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
<Original>
i > 10
</Original>
<Expanded>
2 > 10
</Expanded>
</Expression>
<Expression success="false" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
<Original>
foo( 2 ) == 2
</Original>
<Expanded>
foo( 2 ) == 2
</Expanded>
<Exception filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
{ nested assertion failed }
</Exception>
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="Assertions then sections" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" >
<Original>
@@ -3810,6 +3881,65 @@ C
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="Comparing (and stringifying) volatile pointers works" tags="[volatile]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
!(ptr)
</Original>
<Expanded>
!0
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
ptr == ptr
</Original>
<Expanded>
0 == 0
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
!(ptr != ptr)
</Original>
<Expanded>
!(0 != 0)
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
!(ptr &lt; ptr)
</Original>
<Expanded>
!(0 &lt; 0)
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
ptr &lt;= ptr
</Original>
<Expanded>
0 &lt;= 0
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
!(ptr > ptr)
</Original>
<Expanded>
!(0 > 0)
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
ptr >= ptr
</Original>
<Expanded>
0 >= 0
</Expanded>
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="Comparing function pointers" tags="[function pointer][Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" >
<Original>
@@ -5050,6 +5180,19 @@ Approx( 1.30000000000000004 )
</Section>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="Exception thrown inside stringify does not fail the test" tags="[toString]" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
<Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
<Original>
tos == tos
</Original>
<Expanded>
{ stringification failed with an exception: "Invalid" }
==
{ stringification failed with an exception: "Invalid" }
</Expanded>
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="Exceptions matchers" tags="[!throws][exceptions][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Expression success="true" type="REQUIRE_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Original>
@@ -5124,6 +5267,23 @@ Approx( 1.30000000000000004 )
</Failure>
<OverallResult success="false" skips="0"/>
</TestCase>
<TestCase name="FAIL can be nested in assertion" tags="[!shouldfail][assertions]" filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
<Failure filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
Throw a Catch::TestFailureException
</Failure>
<Expression success="false" type="CHECK_NOTHROW" filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
<Original>
do_fail()
</Original>
<Expanded>
do_fail()
</Expanded>
<Exception filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
{ nested assertion failed }
</Exception>
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="FAIL does not require an argument" tags="[.][failing][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" >
<Failure filename="tests/<exe-name>/UsageTests/Message.tests.cpp" />
<OverallResult success="false" skips="0"/>
@@ -21236,6 +21396,19 @@ Approx( -1.95996398454005449 )
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="system_clock timepoint with non-default duration" tags="[chrono][toString]" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" >
<Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" >
<Original>
tp1 == tp2
</Original>
<Expanded>
{iso8601-timestamp}
==
{iso8601-timestamp}
</Expanded>
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="tables" tags="[generators]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" >
<Original>
@@ -22113,6 +22286,6 @@ Approx( -1.95996398454005449 )
</Section>
<OverallResult success="true" skips="0"/>
</TestCase>
<OverallResults successes="2089" failures="157" expectedFailures="35" skips="12"/>
<OverallResultsCases successes="313" failures="95" expectedFailures="14" skips="6"/>
<OverallResults successes="2101" failures="157" expectedFailures="41" skips="12"/>
<OverallResultsCases successes="317" failures="95" expectedFailures="17" skips="6"/>
</Catch2TestRun>
@@ -681,6 +681,25 @@ Nor would this
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="#3001: Enum-based bitfields can be captured" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" >
<Original>
bf.e == 1
</Original>
<Expanded>
1 == 1
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" >
<Original>
1 == bf.e
</Original>
<Expanded>
1 == 1
</Expanded>
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="#748 - captures with unexpected exceptions" tags="[!shouldfail][!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" >
<Section name="outside assertions" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" >
<Expression success="false" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" >
@@ -2716,6 +2735,58 @@ Approx( 1.23399996757507324 )
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="Assertions can be nested - CHECK" tags="[!shouldfail][assertions]" filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
<Expression success="false" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
<Original>
i > 10
</Original>
<Expanded>
2 > 10
</Expanded>
</Expression>
<Expression success="false" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
<Original>
foo( 2 ) == 2
</Original>
<Expanded>
foo( 2 ) == 2
</Expanded>
<Exception filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
{ nested assertion failed }
</Exception>
</Expression>
<Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
<Original>
true
</Original>
<Expanded>
true
</Expanded>
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="Assertions can be nested - REQUIRE" tags="[!shouldfail][assertions]" filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
<Expression success="false" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
<Original>
i > 10
</Original>
<Expanded>
2 > 10
</Expanded>
</Expression>
<Expression success="false" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
<Original>
foo( 2 ) == 2
</Original>
<Expanded>
foo( 2 ) == 2
</Expanded>
<Exception filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
{ nested assertion failed }
</Exception>
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="Assertions then sections" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" >
<Original>
@@ -3810,6 +3881,65 @@ C
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="Comparing (and stringifying) volatile pointers works" tags="[volatile]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
!(ptr)
</Original>
<Expanded>
!0
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
ptr == ptr
</Original>
<Expanded>
0 == 0
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
!(ptr != ptr)
</Original>
<Expanded>
!(0 != 0)
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
!(ptr &lt; ptr)
</Original>
<Expanded>
!(0 &lt; 0)
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
ptr &lt;= ptr
</Original>
<Expanded>
0 &lt;= 0
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
!(ptr > ptr)
</Original>
<Expanded>
!(0 > 0)
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
ptr >= ptr
</Original>
<Expanded>
0 >= 0
</Expanded>
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="Comparing function pointers" tags="[function pointer][Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" >
<Original>
@@ -5050,6 +5180,19 @@ Approx( 1.30000000000000004 )
</Section>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="Exception thrown inside stringify does not fail the test" tags="[toString]" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
<Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
<Original>
tos == tos
</Original>
<Expanded>
{ stringification failed with an exception: "Invalid" }
==
{ stringification failed with an exception: "Invalid" }
</Expanded>
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="Exceptions matchers" tags="[!throws][exceptions][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Expression success="true" type="REQUIRE_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Original>
@@ -5124,6 +5267,23 @@ Approx( 1.30000000000000004 )
</Failure>
<OverallResult success="false" skips="0"/>
</TestCase>
<TestCase name="FAIL can be nested in assertion" tags="[!shouldfail][assertions]" filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
<Failure filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
Throw a Catch::TestFailureException
</Failure>
<Expression success="false" type="CHECK_NOTHROW" filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
<Original>
do_fail()
</Original>
<Expanded>
do_fail()
</Expanded>
<Exception filename="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp" >
{ nested assertion failed }
</Exception>
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="FAIL does not require an argument" tags="[.][failing][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" >
<Failure filename="tests/<exe-name>/UsageTests/Message.tests.cpp" />
<OverallResult success="false" skips="0"/>
@@ -21235,6 +21395,19 @@ Approx( -1.95996398454005449 )
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="system_clock timepoint with non-default duration" tags="[chrono][toString]" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" >
<Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" >
<Original>
tp1 == tp2
</Original>
<Expanded>
{iso8601-timestamp}
==
{iso8601-timestamp}
</Expanded>
</Expression>
<OverallResult success="true" skips="0"/>
</TestCase>
<TestCase name="tables" tags="[generators]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" >
<Original>
@@ -22112,6 +22285,6 @@ Approx( -1.95996398454005449 )
</Section>
<OverallResult success="true" skips="0"/>
</TestCase>
<OverallResults successes="2089" failures="157" expectedFailures="35" skips="12"/>
<OverallResultsCases successes="313" failures="95" expectedFailures="14" skips="6"/>
<OverallResults successes="2101" failures="157" expectedFailures="41" skips="12"/>
<OverallResultsCases successes="317" failures="95" expectedFailures="17" skips="6"/>
</Catch2TestRun>
@@ -15,3 +15,28 @@ TEST_CASE( "Incomplete AssertionHandler", "[assertion-handler][!shouldfail]" ) {
"Dummy",
Catch::ResultDisposition::Normal );
}
static int foo( int i ) {
REQUIRE( i > 10 );
return 42;
}
TEST_CASE( "Assertions can be nested - CHECK", "[assertions][!shouldfail]" ) {
CHECK( foo( 2 ) == 2 );
// We should hit this, because CHECK continues on failure
CHECK( true );
}
TEST_CASE( "Assertions can be nested - REQUIRE", "[assertions][!shouldfail]" ) {
REQUIRE( foo( 2 ) == 2 );
// We should not hit this, because REQUIRE does not continue on failure
CHECK( true );
}
static void do_fail() { FAIL( "Throw a Catch::TestFailureException" ); }
TEST_CASE( "FAIL can be nested in assertion", "[assertions][!shouldfail]" ) {
// Fails, but the error message makes sense.
CHECK_NOTHROW( do_fail() );
}
@@ -118,3 +118,24 @@ TEST_CASE( "#2944 - Stringifying dates before 1970 should not crash", "[.approva
Equals( "gmtime from provided timepoint has failed. This "
"happens e.g. with pre-1970 dates using Microsoft libc" ) );
}
namespace {
struct ThrowsOnStringification {
friend bool operator==( ThrowsOnStringification,
ThrowsOnStringification ) {
return true;
}
};
}
template <>
struct Catch::StringMaker<ThrowsOnStringification> {
static std::string convert(ThrowsOnStringification) {
throw std::runtime_error( "Invalid" );
}
};
TEST_CASE( "Exception thrown inside stringify does not fail the test", "[toString]" ) {
ThrowsOnStringification tos;
CHECK( tos == tos );
}
@@ -144,6 +144,23 @@ TEST_CASE("#1027: Bitfields can be captured") {
REQUIRE(0 == y.v);
}
TEST_CASE( "#3001: Enum-based bitfields can be captured" ) {
enum E {
ZERO = 0,
ONE = 1,
TWO = 2,
};
struct BF {
E e : 2;
};
BF bf{};
bf.e = ONE;
REQUIRE( bf.e == 1 );
REQUIRE( 1 == bf.e );
}
// Comparison operators can return non-booleans.
// This is unusual, but should be supported.
TEST_CASE("#1147") {
+12
View File
@@ -562,3 +562,15 @@ TEST_CASE("Validate SEH behavior - no crash for stack unwinding", "[approvals][!
}
#endif // _MSC_VER
TEST_CASE( "Comparing (and stringifying) volatile pointers works",
"[volatile]" ) {
volatile int* ptr = nullptr;
REQUIRE_FALSE( ptr );
REQUIRE( ptr == ptr );
REQUIRE_FALSE( ptr != ptr );
REQUIRE_FALSE( ptr < ptr );
REQUIRE( ptr <= ptr );
REQUIRE_FALSE( ptr > ptr );
REQUIRE( ptr >= ptr );
}
@@ -49,3 +49,9 @@ TEST_CASE("Stringifying std::chrono::time_point<Clock>", "[toString][chrono][!no
auto later2 = now2 + std::chrono::minutes(2);
REQUIRE(now2 != later2);
}
TEST_CASE( "system_clock timepoint with non-default duration", "[toString][chrono]" ) {
std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>
tp1, tp2;
CHECK( tp1 == tp2 );
}