mirror of
https://github.com/catchorg/Catch2.git
synced 2026-05-21 16:14:49 +02:00
Compare commits
39 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6ee0826dca | |||
| 47ea57d74f | |||
| d838f88b9c | |||
| c267b6eb4d | |||
| 3cdae5faf0 | |||
| 651247c7f4 | |||
| 15b9393f0f | |||
| a18badd10f | |||
| 54af40652a | |||
| 5f47160bb2 | |||
| e83528c6eb | |||
| fd31a62547 | |||
| 4df8fee92d | |||
| 300c5d3eed | |||
| 11a96e186a | |||
| 10f62484bf | |||
| be2dfb45cc | |||
| 47200ddbee | |||
| e51dcdcc59 | |||
| 77eae8bd2a | |||
| 3ab0d7cef3 | |||
| e83218c2df | |||
| 548e14a8c8 | |||
| b670de4fe1 | |||
| 465e63dad7 | |||
| 34f4f81947 | |||
| 57f738b380 | |||
| 1df10d28ae | |||
| 9f1b48a94f | |||
| f4e83daa18 | |||
| 572f96b8fe | |||
| 8492fd444e | |||
| fe2a20ab55 | |||
| 51b0532d1f | |||
| 2ec64d12b1 | |||
| ccc49ba664 | |||
| 6f036244e9 | |||
| 50e9dbfc4e | |||
| a404f37cec |
@@ -32,6 +32,7 @@ Checks: >-
|
||||
-modernize-deprecated-headers,
|
||||
,# There's a lot of these and most of them are probably not useful,
|
||||
-modernize-pass-by-value,
|
||||
-modernize-use-string-view, # We support C++14,
|
||||
|
||||
performance-*,
|
||||
performance-enum-size,
|
||||
@@ -58,6 +59,8 @@ Checks: >-
|
||||
-readability-uppercase-literal-suffix,
|
||||
-readability-use-anyofallof,
|
||||
-readability-avoid-return-with-void-value,
|
||||
,# We prefer if defined(FOO) form because it is easier to extend later,
|
||||
-readability-use-concise-preprocessor-directives,
|
||||
|
||||
,# time hogs,
|
||||
-bugprone-throw-keyword-missing,
|
||||
|
||||
@@ -16,10 +16,10 @@ jobs:
|
||||
compilation_mode: [fastbuild, dbg, opt]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Mount Bazel cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: "/home/runner/.cache/bazel"
|
||||
key: bazel-ubuntu22-gcc11
|
||||
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
other_pkgs: clang-11
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Prepare environment
|
||||
run: |
|
||||
|
||||
@@ -75,7 +75,7 @@ jobs:
|
||||
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Prepare environment
|
||||
run: |
|
||||
@@ -100,7 +100,7 @@ jobs:
|
||||
name: clang-tidy
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Prepare environment
|
||||
run: |
|
||||
|
||||
@@ -83,7 +83,7 @@ jobs:
|
||||
other_pkgs: g++-11
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Add repositories for older compilers
|
||||
run: |
|
||||
|
||||
@@ -17,7 +17,7 @@ jobs:
|
||||
std: [14, 17]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
|
||||
@@ -25,7 +25,7 @@ jobs:
|
||||
filter:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Configure
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
profile_generate: 'false'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Install conan
|
||||
run: pip install conan==${{matrix.conan_version}}
|
||||
|
||||
@@ -9,10 +9,10 @@ jobs:
|
||||
steps:
|
||||
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Dependencies
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.7'
|
||||
- name: Install checkguard
|
||||
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
build_type: [Debug, Release]
|
||||
std: [14, 17]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Configure build
|
||||
run: |
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ if(CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||
endif()
|
||||
|
||||
project(Catch2
|
||||
VERSION 3.13.0 # CML version placeholder, don't delete
|
||||
VERSION 3.15.0 # CML version placeholder, don't delete
|
||||
LANGUAGES CXX
|
||||
HOMEPAGE_URL "https://github.com/catchorg/Catch2"
|
||||
DESCRIPTION "A modern, C++-native, unit test framework."
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
module(name = "catch2")
|
||||
|
||||
bazel_dep(name = "bazel_skylib", version = "1.7.1")
|
||||
bazel_dep(name = "rules_cc", version = "0.1.1")
|
||||
bazel_dep(name = "bazel_skylib", version = "1.9.0")
|
||||
bazel_dep(name = "rules_cc", version = "0.2.16")
|
||||
bazel_dep(name = "rules_license", version = "1.0.0")
|
||||
|
||||
@@ -9,8 +9,13 @@ add_executable(AssertionsSlowPath
|
||||
assertion_listener.cpp
|
||||
)
|
||||
|
||||
add_executable(EmptyExecutable
|
||||
only_include.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(AssertionsFastPath PRIVATE Catch2::Catch2WithMain)
|
||||
target_link_libraries(AssertionsSlowPath PRIVATE Catch2::Catch2WithMain)
|
||||
target_link_libraries(EmptyExecutable PRIVATE Catch2::Catch2WithMain)
|
||||
|
||||
list(APPEND CATCH_TEST_TARGETS AssertionsFastPath AssertionsSlowPath)
|
||||
list(APPEND CATCH_TEST_TARGETS AssertionsFastPath AssertionsSlowPath EmptyExecutable)
|
||||
set(CATCH_TEST_TARGETS ${CATCH_TEST_TARGETS} PARENT_SCOPE)
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
// Copyright Catch2 Authors
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE.txt or copy at
|
||||
// https://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
|
||||
/**\file
|
||||
* "empty" include of catch_test_macros.hpp
|
||||
*
|
||||
* This file does only one thing: include `catch2/catch_test_macros.hpp`,
|
||||
* so that we can measure the compilation cost of the header.
|
||||
*/
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
@@ -0,0 +1,81 @@
|
||||
<a id="top"></a>
|
||||
|
||||
# Benchmarks of Catch2
|
||||
|
||||
This folder holds benchmarks for Catch2. It should not be built for the
|
||||
small(er) test sets, as it is only relevant for running (mainly runtime)
|
||||
benchmarks.
|
||||
|
||||
Below you will find some practical examples using
|
||||
[hyperfine](https://github.com/sharkdp/hyperfine) to determine the
|
||||
performance of various scenarios. They assume two parallel checkouts, one
|
||||
named `Catch2-old` and the other `Catch2-new`. You will need to change
|
||||
the paths to work on your own machine.
|
||||
|
||||
|
||||
## Runtime benchmarks
|
||||
|
||||
The runtime benchmarks currently consist of few different `TEST_CASE`s,
|
||||
each with a simple loop over different assertion type. They are compiled
|
||||
into two binaries, one for assertion slow path and one for assertion fast
|
||||
path.
|
||||
|
||||
|
||||
### Assumptions and notes about real-world usage
|
||||
|
||||
The basic assertion macro, `REQUIRE` (and `CHECK`) is the most common one,
|
||||
by far. Thus, it is the most important one to run quickly. It is probably
|
||||
followed by the matcher macro, `REQUIRE_THAT`.
|
||||
|
||||
The most common result of an assertion is that it passes. Even if it is
|
||||
stringified and reported, that is most likely due to some listener/reporter
|
||||
that wants the string representation, not because it failed.
|
||||
|
||||
The performance of both Debug and Release builds are important; users
|
||||
will run tests in both. LTO runtime performance is not too important,
|
||||
but compile time perf is.
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
**Compare performance of `REQUIRE` in slow path, debug build**
|
||||
```text
|
||||
hyperfine --warmup 2 --shell none --parameter-list version old,new '/home/xarn/benches/Catch2-{version}/build-debug/benchmarks/AssertionsSlowPath -o /dev/null "REQUIRE"'
|
||||
```
|
||||
|
||||
**Compare performance of `REQUIRE_THAT` in fast path, release build**
|
||||
```text
|
||||
hyperfine --warmup 2 --shell none --parameter-list version old,new '/home/xarn/benches/Catch2-{version}/build-release/benchmarks/AssertionsFastPath -o /dev/null "REQUIRE_THAT"'
|
||||
```
|
||||
|
||||
**Compare performance of `REQUIRE` with stringification enabled, release build**
|
||||
```text
|
||||
hyperfine --warmup 2 --shell none --parameter-list version old,new '/home/xarn/benches/Catch2-{version}/build-release/benchmarks/AssertionsFastPath -s -o /dev/null "REQUIRE"'
|
||||
```
|
||||
_Note that we redirect the output to `/dev/null` to reduce the overhead of the actual output printing, to see just the impact of stringification._
|
||||
|
||||
TODO:
|
||||
* Start empty binary (set up cost base)
|
||||
* Start binary with X (100/1k/10k) tests (test registration cost)
|
||||
* Section tracking
|
||||
|
||||
## Compilation benchmarks
|
||||
|
||||
As tests are often iterated upon and relinked, the compilation cost of
|
||||
Catch2 is also important.
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
**Compare overhead of including `catch_test_macros.hpp`**
|
||||
```text
|
||||
hyperfine --warmup 2 --shell none --parameter-list version old,new '/usr/bin/c++ -I/home/xarn/benches/Catch2-{version}/src/catch2/.. -I/home/xarn/benches/Catch2-{version}/build-debug/generated-includes -g -o /dev/null -c /home/xarn/benches/Catch2-{version}/benchmarks/only_include.cpp'
|
||||
```
|
||||
|
||||
**Compare build time of Catch2's `SelfTest` test suite, Debug build**
|
||||
```text
|
||||
hyperfine --warmup 2 --parameter-list version old,vas --prepare 'find ~/benches/Catch2-{version}/tests/SelfTest -type f -name "*.cpp" -exec touch {} +' 'ninja -j 1 -C ~/benches/Catch2-{version}/build-debug'
|
||||
```
|
||||
|
||||
TODO:
|
||||
* Link-only recipe
|
||||
@@ -7,21 +7,48 @@
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <catch2/matchers/catch_matchers_templated.hpp>
|
||||
|
||||
TEST_CASE("Simple REQUIRE - 10M") {
|
||||
for (size_t i = 0; i < 10'000'000; ++i) {
|
||||
REQUIRE(true);
|
||||
namespace {
|
||||
|
||||
class MatchAllMatcher final : public Catch::Matchers::MatcherGenericBase {
|
||||
public:
|
||||
template <typename Any>
|
||||
bool match( Any&& ) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string describe() const override {
|
||||
using namespace std::string_literals;
|
||||
return "Long string that does not fit into SSO"s;
|
||||
}
|
||||
};
|
||||
|
||||
MatchAllMatcher MatchAll() { return MatchAllMatcher(); }
|
||||
|
||||
|
||||
TEST_CASE( "REQUIRE", "[assertions]" ) {
|
||||
for ( size_t i = 0; i < 10'000'000; ++i ) {
|
||||
REQUIRE( true );
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("Simple NOTHROW - 10M") {
|
||||
for (size_t i = 0; i < 10'000'000; ++i) {
|
||||
REQUIRE_NOTHROW([](){}());
|
||||
TEST_CASE( "REQUIRE_THAT", "[assertions][matchers]" ) {
|
||||
for ( size_t i = 0; i < 10'000'000; ++i ) {
|
||||
REQUIRE_THAT( 1, MatchAll() );
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("Simple THROWS - 10M") {
|
||||
for (size_t i = 0; i < 10'000'000; ++i) {
|
||||
REQUIRE_THROWS([]() { throw 1; }());
|
||||
TEST_CASE( "REQUIRE_NOTHROW", "[assertions][exceptions]" ) {
|
||||
for ( size_t i = 0; i < 10'000'000; ++i ) {
|
||||
REQUIRE_NOTHROW( []() {}() );
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE( "REQUIRE_THROWS", "[assertions][exceptions]" ) {
|
||||
for ( size_t i = 0; i < 10'000'000; ++i ) {
|
||||
REQUIRE_THROWS( []() { throw 1; }() );
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -289,9 +289,10 @@ as follows:
|
||||
| Option | `normal` (default) | `quiet` | `high` |
|
||||
|--------------------|---------------------------------|---------------------|-----------------------------------------|
|
||||
| `--list-tests` | Test names and tags | Test names only | Same as `normal`, plus source code line |
|
||||
| `--list-tags` | Tags and counts | Same as `normal` | Same as `normal` |
|
||||
| `--list-tags` | Tags and counts | Tags only | Same as `normal` |
|
||||
| `--list-reporters` | Reporter names and descriptions | Reporter names only | Same as `normal` |
|
||||
| `--list-listeners` | Listener names and descriptions | Same as `normal` | Same as `normal` |
|
||||
| `--list-listeners` | Listener names and descriptions | Listener names only | Same as `normal` |
|
||||
|
||||
|
||||
<a id="sending-output-to-a-file"></a>
|
||||
## Sending output to a file
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
[Built-in matchers](#built-in-matchers)<br>
|
||||
[Writing custom matchers (old style)](#writing-custom-matchers-old-style)<br>
|
||||
[Writing custom matchers (new style)](#writing-custom-matchers-new-style)<br>
|
||||
[Constexpr matchers](#constexpr-matchers)<br>
|
||||
|
||||
Matchers, as popularized by the [Hamcrest](https://en.wikipedia.org/wiki/Hamcrest)
|
||||
framework are an alternative way to write assertions, useful for tests
|
||||
@@ -471,6 +472,42 @@ and new style matchers arbitrarily.
|
||||
> `MatcherGenericBase` lives in `catch2/matchers/catch_matchers_templated.hpp`
|
||||
|
||||
|
||||
## Constexpr matchers
|
||||
|
||||
> Support for constexpr matchers was introduced in Catch2 3.15.0
|
||||
|
||||
When compiled for C++20, the new-style matchers (can) support `constexpr`
|
||||
matching, albeit not `constexpr` stringification. The matcher combinators
|
||||
require C++26 (or at least P2738) to be `constexpr` compatible.
|
||||
|
||||
This can be used together with the `STATIC_REQUIRE_THAT` macro to write
|
||||
matcher-based static assertions like this:
|
||||
|
||||
```cpp
|
||||
TEST_CASE("Constexpr support for matchers", "[constexpr][matchers]") {
|
||||
STATIC_REQUIRE_THAT( 1, MatchAll() );
|
||||
STATIC_REQUIRE_THAT( 1, MatchAll() || MatchAll() );
|
||||
STATIC_REQUIRE_THAT( 1, !!MatchAll() );
|
||||
}
|
||||
```
|
||||
|
||||
### First party constexpr matchers
|
||||
|
||||
Some (but not all) of Catch2's generic matchers support `constexpr`
|
||||
matching. Currently, this includes:
|
||||
|
||||
* `IsEmpty()`
|
||||
* `SizeIs(size_t target_size)`, `SizeIs(Matcher size_matcher)`
|
||||
* `AllMatch(Matcher element_matcher)`
|
||||
* `AnyMatch(Matcher element_matcher)`
|
||||
* `NoneMatch(Matcher element_matcher)`
|
||||
* `AllTrue()`, `AnyTrue()`, `NoneTrue()`
|
||||
* `Contains(T&& target_element, Comparator = std::equal_to<>{})`
|
||||
* `Contains(Matcher element_matcher)`
|
||||
* `RangeEquals(TargetRangeLike&&, Comparator = std::equal_to<>{})`
|
||||
* `UnorderedRangeEquals(TargetRangeLike&&, Comparator = std::equal_to<>{})`
|
||||
|
||||
|
||||
---
|
||||
|
||||
[Home](Readme.md#top)
|
||||
|
||||
@@ -91,6 +91,30 @@ TEST_CASE("STATIC_CHECK showcase", "[traits]") {
|
||||
}
|
||||
```
|
||||
|
||||
* `STATIC_REQUIRE_THAT` and `STATIC_CHECK_THAT`
|
||||
|
||||
> `STATIC_REQUIRE_THAT` and `STATIC_CHECK_THAT` was introduced in Catch2 3.15.0
|
||||
|
||||
`STATIC_{REQUIRE,CHECK}_THAT` are analogous to `STATIC_{REQUIRE,CHECK}`,
|
||||
but for matchers. They are always defined, even if the current compiler
|
||||
does not support `constexpr` matchers, but in that case the compilation
|
||||
will always fail.
|
||||
|
||||
Just like `STATIC_{REQUIRE,CHECK}`, `STATIC_{REQUIRE,CHECK}_THAT` can be
|
||||
delayed into runtime through the `CATCH_CONFIG_RUNTIME_STATIC_REQUIRE`
|
||||
configuration option.
|
||||
|
||||
Example:
|
||||
```cpp
|
||||
TEST_CASE("Constexpr support for matchers", "[constexpr][matchers]") {
|
||||
STATIC_REQUIRE_THAT( 1, MatchAll() );
|
||||
STATIC_REQUIRE_THAT( 1, MatchAll() && MatchAll() );
|
||||
STATIC_REQUIRE_THAT( 1, MatchAll() || MatchAll() );
|
||||
STATIC_REQUIRE_THAT( 1, !!MatchAll() );
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Test case related macros
|
||||
|
||||
* `REGISTER_TEST_CASE`
|
||||
|
||||
+34
-1
@@ -2,6 +2,8 @@
|
||||
|
||||
# Release notes
|
||||
**Contents**<br>
|
||||
[3.15.0](#3150)<br>
|
||||
[3.14.0](#3140)<br>
|
||||
[3.13.0](#3130)<br>
|
||||
[3.12.0](#3120)<br>
|
||||
[3.11.0](#3110)<br>
|
||||
@@ -73,6 +75,38 @@
|
||||
[Even Older versions](#even-older-versions)<br>
|
||||
|
||||
|
||||
## 3.15.0
|
||||
|
||||
### Fixes
|
||||
* Fixed ambiguous overload issue with `std::optional<T>` in C++26. (#3095)
|
||||
* Since `std::optional` was turned into a range, the partial specialization of `StringMaker` for range-like types and for `std::optional<T>` were in conflict.
|
||||
|
||||
### Improvements
|
||||
* Simplified `CATCH_REGISTER_ENUM` internals for faster compilation and retrieval.
|
||||
* Successful assertion are slightly (1-2%) faster.
|
||||
* Generic (new-style) matchers support constexpr matching in C++20.
|
||||
* Combining matchers requires C++26.
|
||||
* Catch2-provided generic matchers are all constexpr enabled.
|
||||
* Added `STATIC_REQUIRE_THAT` for compile-time matcher assertions.
|
||||
* This requires the compiler to support enough `constexpr` for matchers, see above.
|
||||
|
||||
|
||||
## 3.14.0
|
||||
|
||||
### Fixes
|
||||
* Added missing `<cstdint>` includes. (#3078)
|
||||
* Fixed suppression of empty variadic macro arguments warning on Clang <19. (#3085)
|
||||
* Fixed `catch_discover_tests` failing during `PRE_TEST` discovery if a target does not have discoverable tests. (#3075)
|
||||
* Fixed build of the main library failing with `CATCH_CONFIG_PREFIX_ALL` defined. (#3087)
|
||||
* JUnit reporter outputs single failed (errored/skipped) assertion per test case. (#1919)
|
||||
|
||||
### Improvements
|
||||
* The default implementation of `--list-tags` and `--list-listeners` has a quiet variant.
|
||||
* Suppressed the new Clang warning about `__COUNTER__` usage. (#3076)
|
||||
* Line-wrapping counts utf-8 codepoints instead of bytes. (#1022, #3086)
|
||||
* Combining character sequences are still miscounted, but Catch2 does not aim to fully support Unicode.
|
||||
|
||||
|
||||
## 3.13.0
|
||||
|
||||
### Fixes
|
||||
@@ -80,7 +114,6 @@
|
||||
* The CLI validation fails instead.
|
||||
* Fixed warning suppression macros being doubly defined when using Clang on Windows (#3060)
|
||||
|
||||
|
||||
### Improvements
|
||||
* Suppressed static analysis 26426 diagnostic for MSVC (#3057)
|
||||
* Renamed the internal deprecation macro from `DEPRECATED` to `CATCH_DEPRECATED` to avoid conflicts (#3058)
|
||||
|
||||
@@ -146,6 +146,7 @@ function(catch_discover_tests_impl)
|
||||
|
||||
# Exit early if no tests are detected
|
||||
if(num_tests STREQUAL "0")
|
||||
file(WRITE "${_CTEST_FILE}" "")
|
||||
return()
|
||||
endif()
|
||||
|
||||
|
||||
+198
-165
@@ -6,8 +6,8 @@
|
||||
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
|
||||
// Catch v3.13.0
|
||||
// Generated: 2026-02-15 22:55:00.269529
|
||||
// Catch v3.15.0
|
||||
// Generated: 2026-05-12 13:08:21.086523
|
||||
// ----------------------------------------------------------
|
||||
// This file is an amalgamation of multiple different files.
|
||||
// You probably shouldn't edit it directly.
|
||||
@@ -74,11 +74,11 @@ namespace Catch {
|
||||
samples.data(), samples.data() + samples.size() );
|
||||
|
||||
auto wrap_estimate = [](Estimate<double> e) {
|
||||
return Estimate<FDuration> {
|
||||
FDuration(e.point),
|
||||
FDuration(e.lower_bound),
|
||||
FDuration(e.upper_bound),
|
||||
e.confidence_interval,
|
||||
return Estimate<FDuration>{
|
||||
FDuration( e.point ),
|
||||
FDuration( e.lower_bound ),
|
||||
FDuration( e.upper_bound ),
|
||||
e.confidence_interval,
|
||||
};
|
||||
};
|
||||
std::vector<FDuration> samples2;
|
||||
@@ -147,7 +147,7 @@ namespace Catch {
|
||||
namespace Catch {
|
||||
namespace Benchmark {
|
||||
namespace Detail {
|
||||
struct optimized_away_error : std::exception {
|
||||
struct optimized_away_error final : std::exception {
|
||||
const char* what() const noexcept override;
|
||||
};
|
||||
|
||||
@@ -995,6 +995,7 @@ namespace Catch {
|
||||
|
||||
|
||||
|
||||
|
||||
#include <cassert>
|
||||
#include <stack>
|
||||
|
||||
@@ -1007,7 +1008,7 @@ namespace Catch {
|
||||
m_messageId( builder.m_info.sequence ) {
|
||||
MessageInfo info( CATCH_MOVE( builder.m_info ) );
|
||||
info.message = builder.m_stream.str();
|
||||
IResultCapture::pushScopedMessage( CATCH_MOVE( info ) );
|
||||
Detail::pushScopedMessage( CATCH_MOVE( info ) );
|
||||
}
|
||||
|
||||
ScopedMessage::ScopedMessage( ScopedMessage&& old ) noexcept:
|
||||
@@ -1016,7 +1017,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
ScopedMessage::~ScopedMessage() {
|
||||
if ( !m_moved ) { IResultCapture::popScopedMessage( m_messageId ); }
|
||||
if ( !m_moved ) { Detail::popScopedMessage( m_messageId ); }
|
||||
}
|
||||
|
||||
|
||||
@@ -1088,7 +1089,7 @@ namespace Catch {
|
||||
assert( m_captured == m_messages.size() );
|
||||
if ( m_isScoped ) {
|
||||
for ( auto const& message : m_messages ) {
|
||||
IResultCapture::popScopedMessage( message.sequence );
|
||||
Detail::popScopedMessage( message.sequence );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1097,9 +1098,9 @@ namespace Catch {
|
||||
assert( index < m_messages.size() );
|
||||
m_messages[index].message += value;
|
||||
if ( m_isScoped ) {
|
||||
IResultCapture::pushScopedMessage( CATCH_MOVE( m_messages[index] ) );
|
||||
Detail::pushScopedMessage( CATCH_MOVE( m_messages[index] ) );
|
||||
} else {
|
||||
IResultCapture::addUnscopedMessage( CATCH_MOVE( m_messages[index] ) );
|
||||
Detail::addUnscopedMessage( CATCH_MOVE( m_messages[index] ) );
|
||||
}
|
||||
m_captured++;
|
||||
}
|
||||
@@ -1160,9 +1161,6 @@ namespace Catch {
|
||||
CATCH_INTERNAL_ERROR("Attempted to register active exception under CATCH_CONFIG_DISABLE_EXCEPTIONS!");
|
||||
#endif
|
||||
}
|
||||
IMutableEnumValuesRegistry& getMutableEnumValuesRegistry() override {
|
||||
return m_enumValuesRegistry;
|
||||
}
|
||||
|
||||
private:
|
||||
TestRegistry m_testCaseRegistry;
|
||||
@@ -1170,7 +1168,6 @@ namespace Catch {
|
||||
ExceptionTranslatorRegistry m_exceptionTranslatorRegistry;
|
||||
TagAliasRegistry m_tagAliasRegistry;
|
||||
StartupExceptionRegistry m_exceptionRegistry;
|
||||
Detail::EnumValuesRegistry m_enumValuesRegistry;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2397,7 +2394,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
Version const& libraryVersion() {
|
||||
static Version version( 3, 13, 0, "", 0 );
|
||||
static Version version( 3, 15, 0, "", 0 );
|
||||
return version;
|
||||
}
|
||||
|
||||
@@ -2686,13 +2683,17 @@ namespace Catch {
|
||||
|
||||
namespace Catch {
|
||||
|
||||
void AssertionHandler::finishIncomplete() {
|
||||
m_resultCapture.handleIncomplete( m_assertionInfo );
|
||||
}
|
||||
|
||||
AssertionHandler::AssertionHandler
|
||||
( StringRef macroName,
|
||||
SourceLineInfo const& lineInfo,
|
||||
StringRef capturedExpression,
|
||||
ResultDisposition::Flags resultDisposition )
|
||||
: m_assertionInfo{ macroName, lineInfo, capturedExpression, resultDisposition },
|
||||
m_resultCapture( getResultCapture() )
|
||||
m_resultCapture( static_cast<RunContext&>(getResultCapture()) )
|
||||
{
|
||||
m_resultCapture.notifyAssertionStarted( m_assertionInfo );
|
||||
}
|
||||
@@ -4088,12 +4089,11 @@ namespace Catch {
|
||||
|
||||
|
||||
|
||||
|
||||
#include <cassert>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
IMutableEnumValuesRegistry::~IMutableEnumValuesRegistry() = default;
|
||||
|
||||
namespace Detail {
|
||||
|
||||
namespace {
|
||||
@@ -4119,9 +4119,7 @@ namespace Catch {
|
||||
return parsed;
|
||||
}
|
||||
|
||||
EnumInfo::~EnumInfo() = default;
|
||||
|
||||
StringRef EnumInfo::lookup( int value ) const {
|
||||
StringRef EnumInfo::lookup( int64_t value ) const {
|
||||
for( auto const& valueToName : m_values ) {
|
||||
if( valueToName.first == value )
|
||||
return valueToName.second;
|
||||
@@ -4129,25 +4127,20 @@ namespace Catch {
|
||||
return "{** unexpected enum value **}"_sr;
|
||||
}
|
||||
|
||||
Catch::Detail::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName, StringRef allValueNames, std::vector<int> const& values ) {
|
||||
auto enumInfo = Catch::Detail::make_unique<EnumInfo>();
|
||||
enumInfo->m_name = enumName;
|
||||
enumInfo->m_values.reserve( values.size() );
|
||||
EnumInfo makeEnumInfo( StringRef enumName, StringRef allValueNames, std::vector<int64_t> const& values ) {
|
||||
EnumInfo enumInfo;
|
||||
enumInfo.m_name = enumName;
|
||||
enumInfo.m_values.reserve( values.size() );
|
||||
|
||||
const auto valueNames = Catch::Detail::parseEnums( allValueNames );
|
||||
assert( valueNames.size() == values.size() );
|
||||
std::size_t i = 0;
|
||||
for( auto value : values )
|
||||
enumInfo->m_values.emplace_back(value, valueNames[i++]);
|
||||
for (size_t i = 0; i < values.size(); ++i) {
|
||||
enumInfo.m_values.emplace_back( values[i], valueNames[i] );
|
||||
}
|
||||
|
||||
return enumInfo;
|
||||
}
|
||||
|
||||
EnumInfo const& EnumValuesRegistry::registerEnum( StringRef enumName, StringRef allValueNames, std::vector<int> const& values ) {
|
||||
m_enumInfos.push_back(makeEnumInfo(enumName, allValueNames, values));
|
||||
return *m_enumInfos.back();
|
||||
}
|
||||
|
||||
} // Detail
|
||||
} // Catch
|
||||
|
||||
@@ -5072,7 +5065,7 @@ namespace Catch {
|
||||
namespace {
|
||||
//! A no-op implementation, used if no reporter wants output
|
||||
//! redirection.
|
||||
class NoopRedirect : public OutputRedirect {
|
||||
class NoopRedirect final : public OutputRedirect {
|
||||
void activateImpl() override {}
|
||||
void deactivateImpl() override {}
|
||||
std::string getStdout() override { return {}; }
|
||||
@@ -5109,7 +5102,7 @@ namespace Catch {
|
||||
* Redirects the `std::cout`, `std::cerr`, `std::clog` streams,
|
||||
* but does not touch the actual `stdout`/`stderr` file descriptors.
|
||||
*/
|
||||
class StreamRedirect : public OutputRedirect {
|
||||
class StreamRedirect final : public OutputRedirect {
|
||||
ReusableStringStream m_redirectedOut, m_redirectedErr;
|
||||
RedirectedStreamNew m_cout, m_cerr, m_clog;
|
||||
|
||||
@@ -5220,7 +5213,7 @@ namespace Catch {
|
||||
* Works by replacing the file descriptors numbered 1 and 2
|
||||
* with an open temporary file.
|
||||
*/
|
||||
class FileRedirect : public OutputRedirect {
|
||||
class FileRedirect final : public OutputRedirect {
|
||||
TempFile m_outFile, m_errFile;
|
||||
int m_originalOut = -1;
|
||||
int m_originalErr = -1;
|
||||
@@ -5888,9 +5881,14 @@ namespace Catch {
|
||||
// can be, so the tracker has to throw for a wrong
|
||||
// filter to stop the execution flow.
|
||||
if (filter.type == PathFilter::For::Section) {
|
||||
// TBD: Explicit SKIP, or new exception that says
|
||||
// "don't continue", but doesn't show in totals?
|
||||
SKIP();
|
||||
// We want the semantics of `SKIP()`, but we inline it
|
||||
// to avoid issues with conditionally prefixed macros
|
||||
INTERNAL_CATCH_MSG(
|
||||
"SKIP",
|
||||
Catch::ResultWas::ExplicitSkip,
|
||||
Catch::ResultDisposition::Normal,
|
||||
"" );
|
||||
Catch::Detail::Unreachable();
|
||||
}
|
||||
// '*' is the wildcard for "all elements in generator"
|
||||
// used for filtering sections below the generator, but
|
||||
@@ -6131,6 +6129,25 @@ namespace Catch {
|
||||
}
|
||||
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
|
||||
|
||||
|
||||
void pushScopedMessage( MessageInfo&& message ) {
|
||||
Detail::g_messageHolder().addScopedMessage( CATCH_MOVE( message ) );
|
||||
}
|
||||
|
||||
void popScopedMessage( unsigned int messageId ) {
|
||||
Detail::g_messageHolder().removeMessage( messageId );
|
||||
}
|
||||
|
||||
void emplaceUnscopedMessage( MessageBuilder&& builder ) {
|
||||
Detail::g_messageHolder().addUnscopedMessage( CATCH_MOVE( builder ) );
|
||||
}
|
||||
|
||||
void addUnscopedMessage( MessageInfo&& message ) {
|
||||
Detail::g_messageHolder().addUnscopedMessage( CATCH_MOVE( message ) );
|
||||
}
|
||||
|
||||
bool lastAssertionPassed() { return Detail::g_lastAssertionPassed; }
|
||||
|
||||
} // namespace Detail
|
||||
|
||||
RunContext::RunContext(IConfig const* _config, IEventListenerPtr&& reporter)
|
||||
@@ -6264,14 +6281,13 @@ namespace Catch {
|
||||
Detail::g_lastAssertionPassed = true;
|
||||
} else if (!result.succeeded()) {
|
||||
Detail::g_lastAssertionPassed = false;
|
||||
if (result.isOk()) {
|
||||
}
|
||||
else if( m_activeTestCase->getTestCaseInfo().okToFail() ) // Read from a shared state established before the threads could start, this is fine
|
||||
if (result.isOk()) {}
|
||||
else if( m_activeTestCase->getTestCaseInfo().okToFail() ) { // Read from a shared state established before the threads could start, this is fine
|
||||
m_atomicAssertionCount.failedButOk++;
|
||||
else
|
||||
} else {
|
||||
m_atomicAssertionCount.failed++;
|
||||
}
|
||||
else {
|
||||
}
|
||||
} else {
|
||||
Detail::g_lastAssertionPassed = true;
|
||||
}
|
||||
|
||||
@@ -6347,8 +6363,12 @@ namespace Catch {
|
||||
// TBD: Do we want to avoid the warning if the generator is filtered?
|
||||
if ( m_config->warnAboutInfiniteGenerators() &&
|
||||
!generator->isFinite() ) {
|
||||
// TBD: Would it be better to expand this macro inline?
|
||||
FAIL( "GENERATE() would run infinitely" );
|
||||
// We want the semantics of `FAIL()`, but we inline it
|
||||
// to avoid issues with conditionally prefixed macros
|
||||
INTERNAL_CATCH_MSG( "FAIL",
|
||||
Catch::ResultWas::ExplicitFailure,
|
||||
Catch::ResultDisposition::Normal,
|
||||
"GENERATE() would run infinitely" );
|
||||
}
|
||||
|
||||
auto nameAndLoc = TestCaseTracking::NameAndLocation( static_cast<std::string>( generatorName ), lineInfo );
|
||||
@@ -6449,7 +6469,7 @@ namespace Catch {
|
||||
// and since IResultCapture::getLastResult is deprecated,
|
||||
// we will leave it as is, until it is finally removed.
|
||||
Detail::LockGuard _( m_assertionMutex );
|
||||
return &(*m_lastResult);
|
||||
return &*m_lastResult;
|
||||
}
|
||||
|
||||
void RunContext::exceptionEarlyReported() {
|
||||
@@ -6523,10 +6543,6 @@ namespace Catch {
|
||||
m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, false));
|
||||
}
|
||||
|
||||
bool RunContext::lastAssertionPassed() {
|
||||
return Detail::g_lastAssertionPassed;
|
||||
}
|
||||
|
||||
void RunContext::assertionPassedFastPath(SourceLineInfo lineInfo) {
|
||||
// We want to save the line info for better experience with unexpected assertions
|
||||
Detail::g_lastKnownLineInfo = lineInfo;
|
||||
@@ -6705,7 +6721,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
void RunContext::populateReaction( AssertionReaction& reaction,
|
||||
bool has_normal_disposition ) {
|
||||
bool has_normal_disposition ) const {
|
||||
reaction.shouldDebugBreak = m_shouldDebugBreak;
|
||||
reaction.shouldThrow = aborting() || has_normal_disposition;
|
||||
}
|
||||
@@ -6756,22 +6772,6 @@ namespace Catch {
|
||||
}
|
||||
}
|
||||
|
||||
void IResultCapture::pushScopedMessage( MessageInfo&& message ) {
|
||||
Detail::g_messageHolder().addScopedMessage( CATCH_MOVE( message ) );
|
||||
}
|
||||
|
||||
void IResultCapture::popScopedMessage( unsigned int messageId ) {
|
||||
Detail::g_messageHolder().removeMessage( messageId );
|
||||
}
|
||||
|
||||
void IResultCapture::emplaceUnscopedMessage( MessageBuilder&& builder ) {
|
||||
Detail::g_messageHolder().addUnscopedMessage( CATCH_MOVE( builder ) );
|
||||
}
|
||||
|
||||
void IResultCapture::addUnscopedMessage( MessageInfo&& message ) {
|
||||
Detail::g_messageHolder().addUnscopedMessage( CATCH_MOVE( message ) );
|
||||
}
|
||||
|
||||
void seedRng(IConfig const& config) {
|
||||
sharedRng().seed(config.rngSeed());
|
||||
}
|
||||
@@ -7103,10 +7103,11 @@ namespace Catch {
|
||||
|
||||
TagAlias const* TagAliasRegistry::find( std::string const& alias ) const {
|
||||
auto it = m_registry.find( alias );
|
||||
if( it != m_registry.end() )
|
||||
return &(it->second);
|
||||
else
|
||||
if ( it != m_registry.end() ) {
|
||||
return &it->second;
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
std::string TagAliasRegistry::expandAliases( std::string const& unexpandedTestSpec ) const {
|
||||
@@ -7553,7 +7554,7 @@ namespace Catch {
|
||||
|
||||
void throw_test_failure_exception() {
|
||||
#if !defined( CATCH_CONFIG_DISABLE_EXCEPTIONS )
|
||||
throw TestFailureException{};
|
||||
throw TestFailureException{}; //NOLINT(bugprone-std-exception-baseclass)
|
||||
#else
|
||||
CATCH_ERROR( "Test failure requires aborting test!" );
|
||||
#endif
|
||||
@@ -7561,7 +7562,7 @@ namespace Catch {
|
||||
|
||||
void throw_test_skip_exception() {
|
||||
#if !defined( CATCH_CONFIG_DISABLE_EXCEPTIONS )
|
||||
throw Catch::TestSkipException();
|
||||
throw Catch::TestSkipException(); //NOLINT(bugprone-std-exception-baseclass)
|
||||
#else
|
||||
CATCH_ERROR( "Explicitly skipping tests during runtime requires exceptions" );
|
||||
#endif
|
||||
@@ -7893,6 +7894,10 @@ namespace {
|
||||
return std::memchr( chars, c, sizeof( chars ) - 1 ) != nullptr;
|
||||
}
|
||||
|
||||
bool isUtf8ContinuationByte( char c ) {
|
||||
return ( static_cast<unsigned char>( c ) & 0xC0 ) == 0x80;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace Catch {
|
||||
@@ -7919,6 +7924,11 @@ namespace Catch {
|
||||
if ( it != m_string.end() ) {
|
||||
++m_size;
|
||||
++it;
|
||||
// Skip UTF-8 continuation bytes
|
||||
while ( it != m_string.end() &&
|
||||
isUtf8ContinuationByte( *it ) ) {
|
||||
++it;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7981,6 +7991,11 @@ namespace Catch {
|
||||
void AnsiSkippingString::const_iterator::advance() {
|
||||
assert( m_it != m_string->end() );
|
||||
m_it++;
|
||||
// Skip UTF-8 continuation bytes
|
||||
while ( m_it != m_string->end() &&
|
||||
isUtf8ContinuationByte( *m_it ) ) {
|
||||
m_it++;
|
||||
}
|
||||
tryParseAnsiEscapes();
|
||||
}
|
||||
|
||||
@@ -8000,6 +8015,11 @@ namespace Catch {
|
||||
assert( *m_it == '\033' );
|
||||
m_it--;
|
||||
}
|
||||
// Skip back over UTF-8 continuation bytes to the leading byte
|
||||
while ( isUtf8ContinuationByte( *m_it ) ) {
|
||||
assert( m_it != m_string->begin() );
|
||||
m_it--;
|
||||
}
|
||||
}
|
||||
|
||||
static bool isBoundary( AnsiSkippingString const& line,
|
||||
@@ -8646,13 +8666,13 @@ namespace Catch {
|
||||
namespace Matchers {
|
||||
|
||||
std::string MatcherUntypedBase::toString() const {
|
||||
if (m_cachedToString.empty()) {
|
||||
m_cachedToString = describe();
|
||||
}
|
||||
return m_cachedToString;
|
||||
return describe();
|
||||
}
|
||||
|
||||
MatcherUntypedBase::~MatcherUntypedBase() = default;
|
||||
std::string MatcherUntypedBase::describe() const {
|
||||
using namespace std::string_literals;
|
||||
return "Undescribed matcher"s;
|
||||
}
|
||||
|
||||
} // namespace Matchers
|
||||
} // namespace Catch
|
||||
@@ -8673,14 +8693,6 @@ namespace Matchers {
|
||||
return sstr.str();
|
||||
}
|
||||
|
||||
IsEmptyMatcher IsEmpty() {
|
||||
return {};
|
||||
}
|
||||
|
||||
HasSizeMatcher SizeIs(std::size_t sz) {
|
||||
return HasSizeMatcher{ sz };
|
||||
}
|
||||
|
||||
} // end namespace Matchers
|
||||
} // end namespace Catch
|
||||
|
||||
@@ -8934,17 +8946,13 @@ std::string Catch::Matchers::Detail::finalizeDescription(const std::string& desc
|
||||
|
||||
namespace Catch {
|
||||
namespace Matchers {
|
||||
std::string AllTrueMatcher::describe() const { return "contains only true"; }
|
||||
|
||||
AllTrueMatcher AllTrue() { return AllTrueMatcher{}; }
|
||||
std::string AllTrueMatcher::describe() const { return "contains only true"; }
|
||||
|
||||
std::string NoneTrueMatcher::describe() const { return "contains no true"; }
|
||||
|
||||
NoneTrueMatcher NoneTrue() { return NoneTrueMatcher{}; }
|
||||
|
||||
std::string AnyTrueMatcher::describe() const { return "contains at least one true"; }
|
||||
|
||||
AnyTrueMatcher AnyTrue() { return AnyTrueMatcher{}; }
|
||||
} // namespace Matchers
|
||||
} // namespace Catch
|
||||
|
||||
@@ -9057,7 +9065,11 @@ namespace Matchers {
|
||||
|
||||
namespace Catch {
|
||||
namespace Matchers {
|
||||
MatcherGenericBase::~MatcherGenericBase() = default;
|
||||
|
||||
std::string MatcherGenericBase::describe() const {
|
||||
using namespace std::string_literals;
|
||||
return "Undescribed generic matcher"s;
|
||||
}
|
||||
|
||||
namespace Detail {
|
||||
|
||||
@@ -9152,12 +9164,12 @@ namespace Catch {
|
||||
|
||||
void ReporterBase::listReporters(
|
||||
std::vector<ReporterDescription> const& descriptions ) {
|
||||
defaultListReporters(m_stream, descriptions, m_config->verbosity());
|
||||
defaultListReporters( m_stream, descriptions, m_config->verbosity() );
|
||||
}
|
||||
|
||||
void ReporterBase::listListeners(
|
||||
std::vector<ListenerDescription> const& descriptions ) {
|
||||
defaultListListeners( m_stream, descriptions );
|
||||
defaultListListeners( m_stream, descriptions, m_config->verbosity() );
|
||||
}
|
||||
|
||||
void ReporterBase::listTests(std::vector<TestCaseHandle> const& tests) {
|
||||
@@ -9169,7 +9181,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
void ReporterBase::listTags(std::vector<TagInfo> const& tags) {
|
||||
defaultListTags( m_stream, tags, m_config->hasTestFilters() );
|
||||
defaultListTags( m_stream, tags, m_config->hasTestFilters(), m_config->verbosity() );
|
||||
}
|
||||
|
||||
} // namespace Catch
|
||||
@@ -10080,9 +10092,8 @@ namespace Catch {
|
||||
bool operator()(
|
||||
Detail::unique_ptr<CumulativeReporterBase::SectionNode> const&
|
||||
node ) const {
|
||||
return (
|
||||
( node->stats.sectionInfo.name == m_other.name ) &&
|
||||
( node->stats.sectionInfo.lineInfo == m_other.lineInfo ) );
|
||||
return node->stats.sectionInfo.name == m_other.name
|
||||
&& node->stats.sectionInfo.lineInfo == m_other.lineInfo;
|
||||
}
|
||||
void operator=( BySectionInfo const& ) = delete;
|
||||
|
||||
@@ -10380,7 +10391,15 @@ namespace Catch {
|
||||
}
|
||||
|
||||
void defaultListListeners( std::ostream& out,
|
||||
std::vector<ListenerDescription> const& descriptions ) {
|
||||
std::vector<ListenerDescription> const& descriptions,
|
||||
Verbosity verbosity ) {
|
||||
if ( verbosity == Verbosity::Quiet ) {
|
||||
for ( auto const& desc : descriptions ) {
|
||||
out << desc.name << '\n';
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
out << "Registered listeners:\n";
|
||||
|
||||
if(descriptions.empty()) {
|
||||
@@ -10413,7 +10432,14 @@ namespace Catch {
|
||||
|
||||
void defaultListTags( std::ostream& out,
|
||||
std::vector<TagInfo> const& tags,
|
||||
bool isFiltered ) {
|
||||
bool isFiltered,
|
||||
Verbosity verbosity ) {
|
||||
if (verbosity == Verbosity::Quiet) {
|
||||
for (auto const& tagCount : tags) {
|
||||
out << tagCount.all() << '\n';
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ( isFiltered ) {
|
||||
out << "Tags for matching test cases:\n";
|
||||
} else {
|
||||
@@ -10421,7 +10447,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
// minimum whitespace to pad tag counts, possibly overwritten below
|
||||
size_t maxTagCountLen = 2;
|
||||
int maxTagCountLen = 2;
|
||||
|
||||
// determine necessary padding for tag count column
|
||||
if ( ! tags.empty() ) {
|
||||
@@ -10432,11 +10458,11 @@ namespace Catch {
|
||||
return lhs.count < rhs.count;
|
||||
} )
|
||||
->count;
|
||||
|
||||
|
||||
// more padding necessary for 3+ digits
|
||||
if (maxTagCount >= 100) {
|
||||
auto numDigits = 1 + std::floor( std::log10( maxTagCount ) );
|
||||
maxTagCountLen = static_cast<size_t>( numDigits );
|
||||
maxTagCountLen = static_cast<int>( numDigits );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11189,70 +11215,77 @@ namespace Catch {
|
||||
void JunitReporter::writeAssertions( SectionNode const& sectionNode ) {
|
||||
for (auto const& assertionOrBenchmark : sectionNode.assertionsAndBenchmarks) {
|
||||
if (assertionOrBenchmark.isAssertion()) {
|
||||
writeAssertion(assertionOrBenchmark.asAssertion());
|
||||
// JUnit XML format supports only 1 error/failure/skip
|
||||
// assertion elements per test case
|
||||
if (writeAssertion(assertionOrBenchmark.asAssertion())) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void JunitReporter::writeAssertion( AssertionStats const& stats ) {
|
||||
bool JunitReporter::writeAssertion( AssertionStats const& stats ) {
|
||||
AssertionResult const& result = stats.assertionResult;
|
||||
if ( !result.isOk() ||
|
||||
result.getResultType() == ResultWas::ExplicitSkip ) {
|
||||
std::string elementName;
|
||||
switch( result.getResultType() ) {
|
||||
case ResultWas::ThrewException:
|
||||
case ResultWas::FatalErrorCondition:
|
||||
elementName = "error";
|
||||
break;
|
||||
case ResultWas::ExplicitFailure:
|
||||
case ResultWas::ExpressionFailed:
|
||||
case ResultWas::DidntThrowException:
|
||||
elementName = "failure";
|
||||
break;
|
||||
case ResultWas::ExplicitSkip:
|
||||
elementName = "skipped";
|
||||
break;
|
||||
// We should never see these here:
|
||||
case ResultWas::Info:
|
||||
case ResultWas::Warning:
|
||||
case ResultWas::Ok:
|
||||
case ResultWas::Unknown:
|
||||
case ResultWas::FailureBit:
|
||||
case ResultWas::Exception:
|
||||
elementName = "internalError";
|
||||
break;
|
||||
}
|
||||
|
||||
XmlWriter::ScopedElement e = xml.scopedElement( elementName );
|
||||
|
||||
xml.writeAttribute( "message"_sr, result.getExpression() );
|
||||
xml.writeAttribute( "type"_sr, result.getTestMacroName() );
|
||||
|
||||
ReusableStringStream rss;
|
||||
if ( result.getResultType() == ResultWas::ExplicitSkip ) {
|
||||
rss << "SKIPPED\n";
|
||||
} else {
|
||||
rss << "FAILED" << ":\n";
|
||||
if (result.hasExpression()) {
|
||||
rss << " ";
|
||||
rss << result.getExpressionInMacro();
|
||||
rss << '\n';
|
||||
}
|
||||
if (result.hasExpandedExpression()) {
|
||||
rss << "with expansion:\n";
|
||||
rss << TextFlow::Column(result.getExpandedExpression()).indent(2) << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
if( result.hasMessage() )
|
||||
rss << result.getMessage() << '\n';
|
||||
for( auto const& msg : stats.infoMessages )
|
||||
if( msg.type == ResultWas::Info )
|
||||
rss << msg.message << '\n';
|
||||
|
||||
rss << "at " << result.getSourceInfo();
|
||||
xml.writeText( rss.str(), XmlFormatting::Newline );
|
||||
if ( result.isOk() &&
|
||||
result.getResultType() != ResultWas::ExplicitSkip ) {
|
||||
return false;
|
||||
}
|
||||
std::string elementName;
|
||||
switch ( result.getResultType() ) {
|
||||
case ResultWas::ThrewException:
|
||||
case ResultWas::FatalErrorCondition:
|
||||
elementName = "error";
|
||||
break;
|
||||
case ResultWas::ExplicitFailure:
|
||||
case ResultWas::ExpressionFailed:
|
||||
case ResultWas::DidntThrowException:
|
||||
elementName = "failure";
|
||||
break;
|
||||
case ResultWas::ExplicitSkip:
|
||||
elementName = "skipped";
|
||||
break;
|
||||
// We should never see these here:
|
||||
case ResultWas::Info:
|
||||
case ResultWas::Warning:
|
||||
case ResultWas::Ok:
|
||||
case ResultWas::Unknown:
|
||||
case ResultWas::FailureBit:
|
||||
case ResultWas::Exception:
|
||||
elementName = "internalError";
|
||||
break;
|
||||
}
|
||||
|
||||
XmlWriter::ScopedElement e = xml.scopedElement( elementName );
|
||||
|
||||
xml.writeAttribute( "message"_sr, result.getExpression() );
|
||||
xml.writeAttribute( "type"_sr, result.getTestMacroName() );
|
||||
|
||||
ReusableStringStream rss;
|
||||
if ( result.getResultType() == ResultWas::ExplicitSkip ) {
|
||||
rss << "SKIPPED\n";
|
||||
} else {
|
||||
rss << "FAILED:\n";
|
||||
if ( result.hasExpression() ) {
|
||||
rss << " ";
|
||||
rss << result.getExpressionInMacro();
|
||||
rss << '\n';
|
||||
}
|
||||
if ( result.hasExpandedExpression() ) {
|
||||
rss << "with expansion:\n";
|
||||
rss << TextFlow::Column( result.getExpandedExpression() )
|
||||
.indent( 2 )
|
||||
<< '\n';
|
||||
}
|
||||
}
|
||||
|
||||
if ( result.hasMessage() ) { rss << result.getMessage() << '\n'; }
|
||||
for ( auto const& msg : stats.infoMessages ) {
|
||||
if ( msg.type == ResultWas::Info ) { rss << msg.message << '\n'; }
|
||||
}
|
||||
|
||||
rss << "at " << result.getSourceInfo();
|
||||
xml.writeText( rss.str(), XmlFormatting::Newline );
|
||||
return true;
|
||||
}
|
||||
|
||||
} // end namespace Catch
|
||||
|
||||
+308
-213
File diff suppressed because it is too large
Load Diff
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <catch2/internal/catch_test_spec_parser.hpp>
|
||||
#include <catch2/internal/catch_tag_alias_registry.hpp>
|
||||
#include <cstdint>
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <cstdint>
|
||||
|
||||
|
||||
template<class Callback>
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
project(
|
||||
'catch2',
|
||||
'cpp',
|
||||
version: '3.13.0', # CML version placeholder, don't delete
|
||||
version: '3.15.0', # CML version placeholder, don't delete
|
||||
license: 'BSL-1.0',
|
||||
meson_version: '>=0.54.1',
|
||||
)
|
||||
|
||||
+2
-3
@@ -87,7 +87,7 @@ set(IMPL_HEADERS
|
||||
${SOURCES_DIR}/internal/catch_decomposer.hpp
|
||||
${SOURCES_DIR}/internal/catch_deprecation_macro.hpp
|
||||
${SOURCES_DIR}/internal/catch_enforce.hpp
|
||||
${SOURCES_DIR}/internal/catch_enum_values_registry.hpp
|
||||
${SOURCES_DIR}/internal/catch_enum_info.hpp
|
||||
${SOURCES_DIR}/internal/catch_errno_guard.hpp
|
||||
${SOURCES_DIR}/internal/catch_exception_translator_registry.hpp
|
||||
${SOURCES_DIR}/internal/catch_fatal_condition_handler.hpp
|
||||
@@ -181,7 +181,7 @@ set(IMPL_SOURCES
|
||||
${SOURCES_DIR}/internal/catch_debugger.cpp
|
||||
${SOURCES_DIR}/internal/catch_decomposer.cpp
|
||||
${SOURCES_DIR}/internal/catch_enforce.cpp
|
||||
${SOURCES_DIR}/internal/catch_enum_values_registry.cpp
|
||||
${SOURCES_DIR}/internal/catch_enum_info.cpp
|
||||
${SOURCES_DIR}/internal/catch_errno_guard.cpp
|
||||
${SOURCES_DIR}/internal/catch_exception_translator_registry.cpp
|
||||
${SOURCES_DIR}/internal/catch_fatal_condition_handler.cpp
|
||||
@@ -227,7 +227,6 @@ set(INTERFACE_HEADERS
|
||||
${SOURCES_DIR}/interfaces/catch_interfaces_all.hpp
|
||||
${SOURCES_DIR}/interfaces/catch_interfaces_capture.hpp
|
||||
${SOURCES_DIR}/interfaces/catch_interfaces_config.hpp
|
||||
${SOURCES_DIR}/interfaces/catch_interfaces_enum_values_registry.hpp
|
||||
${SOURCES_DIR}/interfaces/catch_interfaces_exception.hpp
|
||||
${SOURCES_DIR}/interfaces/catch_interfaces_generatortracker.hpp
|
||||
${SOURCES_DIR}/interfaces/catch_interfaces_registry_hub.hpp
|
||||
|
||||
@@ -36,11 +36,11 @@ namespace Catch {
|
||||
samples.data(), samples.data() + samples.size() );
|
||||
|
||||
auto wrap_estimate = [](Estimate<double> e) {
|
||||
return Estimate<FDuration> {
|
||||
FDuration(e.point),
|
||||
FDuration(e.lower_bound),
|
||||
FDuration(e.upper_bound),
|
||||
e.confidence_interval,
|
||||
return Estimate<FDuration>{
|
||||
FDuration( e.point ),
|
||||
FDuration( e.lower_bound ),
|
||||
FDuration( e.upper_bound ),
|
||||
e.confidence_interval,
|
||||
};
|
||||
};
|
||||
std::vector<FDuration> samples2;
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Catch {
|
||||
callable& operator=(callable&&) = default;
|
||||
};
|
||||
template <typename Fun>
|
||||
struct model : public callable {
|
||||
struct model final : public callable {
|
||||
model(Fun&& fun_) : fun(CATCH_MOVE(fun_)) {}
|
||||
model(Fun const& fun_) : fun(fun_) {}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#ifndef CATCH_BENCHMARK_STATS_HPP_INCLUDED
|
||||
#define CATCH_BENCHMARK_STATS_HPP_INCLUDED
|
||||
|
||||
#include <catch2/benchmark/catch_clock.hpp>
|
||||
#include <catch2/benchmark/catch_estimate.hpp>
|
||||
#include <catch2/benchmark/catch_outlier_classification.hpp>
|
||||
// The fwd decl & default specialization needs to be seen by VS2017 before
|
||||
|
||||
@@ -8,14 +8,16 @@
|
||||
#ifndef CATCH_BENCHMARK_STATS_FWD_HPP_INCLUDED
|
||||
#define CATCH_BENCHMARK_STATS_FWD_HPP_INCLUDED
|
||||
|
||||
#include <catch2/benchmark/catch_clock.hpp>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
namespace Detail {
|
||||
struct DummyTemplateArgPlaceholder;
|
||||
}
|
||||
|
||||
// We cannot forward declare the type with default template argument
|
||||
// multiple times, so it is split out into a separate header so that
|
||||
// we can prevent multiple declarations in dependencies
|
||||
template <typename Duration = Benchmark::FDuration>
|
||||
template <typename Duration = Detail::DummyTemplateArgPlaceholder>
|
||||
struct BenchmarkStats;
|
||||
|
||||
} // end namespace Catch
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
namespace Catch {
|
||||
namespace Benchmark {
|
||||
namespace Detail {
|
||||
struct optimized_away_error : std::exception {
|
||||
struct optimized_away_error final : std::exception {
|
||||
const char* what() const noexcept override;
|
||||
};
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
#include <catch2/internal/catch_decomposer.hpp>
|
||||
#include <catch2/internal/catch_deprecation_macro.hpp>
|
||||
#include <catch2/internal/catch_enforce.hpp>
|
||||
#include <catch2/internal/catch_enum_values_registry.hpp>
|
||||
#include <catch2/internal/catch_enum_info.hpp>
|
||||
#include <catch2/internal/catch_errno_guard.hpp>
|
||||
#include <catch2/internal/catch_exception_translator_registry.hpp>
|
||||
#include <catch2/internal/catch_fatal_condition_handler.hpp>
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// https://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
|
||||
#include <catch2/catch_message.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_capture.hpp>
|
||||
#include <catch2/internal/catch_enforce.hpp>
|
||||
#include <catch2/internal/catch_move_and_forward.hpp>
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Catch {
|
||||
m_messageId( builder.m_info.sequence ) {
|
||||
MessageInfo info( CATCH_MOVE( builder.m_info ) );
|
||||
info.message = builder.m_stream.str();
|
||||
IResultCapture::pushScopedMessage( CATCH_MOVE( info ) );
|
||||
Detail::pushScopedMessage( CATCH_MOVE( info ) );
|
||||
}
|
||||
|
||||
ScopedMessage::ScopedMessage( ScopedMessage&& old ) noexcept:
|
||||
@@ -31,7 +31,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
ScopedMessage::~ScopedMessage() {
|
||||
if ( !m_moved ) { IResultCapture::popScopedMessage( m_messageId ); }
|
||||
if ( !m_moved ) { Detail::popScopedMessage( m_messageId ); }
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace Catch {
|
||||
assert( m_captured == m_messages.size() );
|
||||
if ( m_isScoped ) {
|
||||
for ( auto const& message : m_messages ) {
|
||||
IResultCapture::popScopedMessage( message.sequence );
|
||||
Detail::popScopedMessage( message.sequence );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,9 +112,9 @@ namespace Catch {
|
||||
assert( index < m_messages.size() );
|
||||
m_messages[index].message += value;
|
||||
if ( m_isScoped ) {
|
||||
IResultCapture::pushScopedMessage( CATCH_MOVE( m_messages[index] ) );
|
||||
Detail::pushScopedMessage( CATCH_MOVE( m_messages[index] ) );
|
||||
} else {
|
||||
IResultCapture::addUnscopedMessage( CATCH_MOVE( m_messages[index] ) );
|
||||
Detail::addUnscopedMessage( CATCH_MOVE( m_messages[index] ) );
|
||||
}
|
||||
m_captured++;
|
||||
}
|
||||
|
||||
@@ -13,16 +13,28 @@
|
||||
#include <catch2/internal/catch_reusable_string_stream.hpp>
|
||||
#include <catch2/internal/catch_stream_end_stop.hpp>
|
||||
#include <catch2/internal/catch_message_info.hpp>
|
||||
#include <catch2/internal/catch_move_and_forward.hpp>
|
||||
#include <catch2/catch_tostring.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_capture.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace Catch {
|
||||
struct MessageInfo;
|
||||
struct MessageBuilder;
|
||||
|
||||
namespace Detail {
|
||||
// The message state affecting functions have to be defined in
|
||||
// the TU where the thread-local message holders are defined.
|
||||
// Currently this is catch_run_context.cpp
|
||||
|
||||
void pushScopedMessage( MessageInfo&& message );
|
||||
void popScopedMessage( unsigned int messageId );
|
||||
void addUnscopedMessage( MessageInfo&& message );
|
||||
void emplaceUnscopedMessage( MessageBuilder&& builder );
|
||||
} // namespace Detail
|
||||
|
||||
struct SourceLineInfo;
|
||||
class IResultCapture;
|
||||
|
||||
struct MessageStream {
|
||||
|
||||
@@ -112,7 +124,7 @@ namespace Catch {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define INTERNAL_CATCH_UNSCOPED_INFO( macroName, log ) \
|
||||
Catch::IResultCapture::emplaceUnscopedMessage( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log )
|
||||
Catch::Detail::emplaceUnscopedMessage( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log )
|
||||
|
||||
|
||||
#if defined(CATCH_CONFIG_PREFIX_MESSAGES) && !defined(CATCH_CONFIG_DISABLE)
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <catch2/internal/catch_tag_alias_registry.hpp>
|
||||
#include <catch2/internal/catch_startup_exception_registry.hpp>
|
||||
#include <catch2/internal/catch_singletons.hpp>
|
||||
#include <catch2/internal/catch_enum_values_registry.hpp>
|
||||
#include <catch2/catch_test_case_info.hpp>
|
||||
#include <catch2/internal/catch_noncopyable.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_reporter_factory.hpp>
|
||||
@@ -72,9 +71,6 @@ namespace Catch {
|
||||
CATCH_INTERNAL_ERROR("Attempted to register active exception under CATCH_CONFIG_DISABLE_EXCEPTIONS!");
|
||||
#endif
|
||||
}
|
||||
IMutableEnumValuesRegistry& getMutableEnumValuesRegistry() override {
|
||||
return m_enumValuesRegistry;
|
||||
}
|
||||
|
||||
private:
|
||||
TestRegistry m_testCaseRegistry;
|
||||
@@ -82,7 +78,6 @@ namespace Catch {
|
||||
ExceptionTranslatorRegistry m_exceptionTranslatorRegistry;
|
||||
TagAliasRegistry m_tagAliasRegistry;
|
||||
StartupExceptionRegistry m_exceptionRegistry;
|
||||
Detail::EnumValuesRegistry m_enumValuesRegistry;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <catch2/reporters/catch_reporter_multi.hpp>
|
||||
#include <catch2/internal/catch_reporter_registry.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_reporter_factory.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_registry_hub.hpp>
|
||||
#include <catch2/internal/catch_move_and_forward.hpp>
|
||||
#include <catch2/internal/catch_stdstreams.hpp>
|
||||
#include <catch2/internal/catch_istream.hpp>
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
#include <catch2/internal/catch_config_wchar.hpp>
|
||||
#include <catch2/internal/catch_reusable_string_stream.hpp>
|
||||
#include <catch2/internal/catch_void_type.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_enum_values_registry.hpp>
|
||||
#include <catch2/internal/catch_enum_info.hpp>
|
||||
#include <catch2/internal/catch_stringref.hpp>
|
||||
|
||||
#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
|
||||
#include <string_view>
|
||||
@@ -383,7 +384,10 @@ namespace Catch {
|
||||
}
|
||||
#endif // CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER
|
||||
|
||||
#if defined(CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER) && defined(CATCH_CONFIG_CPP17_OPTIONAL)
|
||||
#if defined( CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER ) && \
|
||||
defined( CATCH_CONFIG_CPP17_OPTIONAL ) && \
|
||||
/* P3168 turned optional into a range, making this ambigous with the range support */ \
|
||||
!defined( __cpp_lib_optional_range_support )
|
||||
#include <optional>
|
||||
namespace Catch {
|
||||
template<typename T>
|
||||
@@ -630,17 +634,21 @@ struct ratio_string<std::milli> {
|
||||
};
|
||||
}
|
||||
|
||||
#include <catch2/interfaces/catch_interfaces_registry_hub.hpp>
|
||||
|
||||
#define INTERNAL_CATCH_REGISTER_ENUM( enumName, ... ) \
|
||||
namespace Catch { \
|
||||
template<> struct StringMaker<enumName> { \
|
||||
static std::string convert( enumName value ) { \
|
||||
static const auto& enumInfo = ::Catch::getMutableRegistryHub().getMutableEnumValuesRegistry().registerEnum( #enumName, #__VA_ARGS__, { __VA_ARGS__ } ); \
|
||||
return static_cast<std::string>(enumInfo.lookup( static_cast<int>( value ) )); \
|
||||
} \
|
||||
}; \
|
||||
}
|
||||
#define INTERNAL_CATCH_REGISTER_ENUM( enumName, ... ) \
|
||||
namespace Catch { \
|
||||
template <> \
|
||||
struct StringMaker<enumName> { \
|
||||
static std::string convert( enumName value ) { \
|
||||
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
|
||||
CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
|
||||
static const auto enumInfo = ::Catch::Detail::makeEnumInfo( \
|
||||
#enumName, #__VA_ARGS__, { __VA_ARGS__ } ); \
|
||||
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
|
||||
return static_cast<std::string>( \
|
||||
enumInfo.lookup( static_cast<int64_t>( value ) ) ); \
|
||||
} \
|
||||
}; \
|
||||
}
|
||||
|
||||
#define CATCH_REGISTER_ENUM( enumName, ... ) INTERNAL_CATCH_REGISTER_ENUM( enumName, __VA_ARGS__ )
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Catch {
|
||||
|
||||
class ExceptionTranslatorRegistrar {
|
||||
template<typename T>
|
||||
class ExceptionTranslator : public IExceptionTranslator {
|
||||
class ExceptionTranslator final : public IExceptionTranslator {
|
||||
public:
|
||||
|
||||
constexpr ExceptionTranslator( std::string(*translateFunction)( T const& ) )
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
Version const& libraryVersion() {
|
||||
static Version version( 3, 13, 0, "", 0 );
|
||||
static Version version( 3, 15, 0, "", 0 );
|
||||
return version;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#define CATCH_VERSION_MACROS_HPP_INCLUDED
|
||||
|
||||
#define CATCH_VERSION_MAJOR 3
|
||||
#define CATCH_VERSION_MINOR 13
|
||||
#define CATCH_VERSION_MINOR 15
|
||||
#define CATCH_VERSION_PATCH 0
|
||||
|
||||
#endif // CATCH_VERSION_MACROS_HPP_INCLUDED
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include <catch2/interfaces/catch_interfaces_capture.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_config.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_enum_values_registry.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_exception.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_generatortracker.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_registry_hub.hpp>
|
||||
|
||||
@@ -22,8 +22,6 @@ namespace Catch {
|
||||
struct AssertionInfo;
|
||||
struct SectionInfo;
|
||||
struct SectionEndInfo;
|
||||
struct MessageInfo;
|
||||
struct MessageBuilder;
|
||||
struct Counts;
|
||||
struct AssertionReaction;
|
||||
struct SourceLineInfo;
|
||||
@@ -63,11 +61,6 @@ namespace Catch {
|
||||
virtual void benchmarkEnded( BenchmarkStats<> const& stats ) = 0;
|
||||
virtual void benchmarkFailed( StringRef error ) = 0;
|
||||
|
||||
static void pushScopedMessage( MessageInfo&& message );
|
||||
static void popScopedMessage( unsigned int messageId );
|
||||
static void addUnscopedMessage( MessageInfo&& message );
|
||||
static void emplaceUnscopedMessage( MessageBuilder&& builder );
|
||||
|
||||
virtual void handleFatalErrorCondition( StringRef message ) = 0;
|
||||
|
||||
virtual void handleExpr
|
||||
@@ -93,9 +86,6 @@ namespace Catch {
|
||||
ResultWas::OfType resultType,
|
||||
AssertionReaction &reaction ) = 0;
|
||||
|
||||
|
||||
virtual bool lastAssertionPassed() = 0;
|
||||
|
||||
// Deprecated, do not use:
|
||||
virtual std::string getCurrentTestName() const = 0;
|
||||
virtual const AssertionResult* getLastResult() const = 0;
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Catch {
|
||||
class IStream;
|
||||
struct PathFilter;
|
||||
|
||||
class IConfig : public Detail::NonCopyable {
|
||||
class IConfig : Detail::NonCopyable {
|
||||
public:
|
||||
virtual ~IConfig();
|
||||
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
|
||||
// Copyright Catch2 Authors
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE.txt or copy at
|
||||
// https://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
#ifndef CATCH_INTERFACES_ENUM_VALUES_REGISTRY_HPP_INCLUDED
|
||||
#define CATCH_INTERFACES_ENUM_VALUES_REGISTRY_HPP_INCLUDED
|
||||
|
||||
#include <catch2/internal/catch_stringref.hpp>
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
namespace Detail {
|
||||
struct EnumInfo {
|
||||
StringRef m_name;
|
||||
std::vector<std::pair<int, StringRef>> m_values;
|
||||
|
||||
~EnumInfo();
|
||||
|
||||
StringRef lookup( int value ) const;
|
||||
};
|
||||
} // namespace Detail
|
||||
|
||||
class IMutableEnumValuesRegistry {
|
||||
public:
|
||||
virtual ~IMutableEnumValuesRegistry(); // = default;
|
||||
|
||||
virtual Detail::EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::vector<int> const& values ) = 0;
|
||||
|
||||
template<typename E>
|
||||
Detail::EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::initializer_list<E> values ) {
|
||||
static_assert(sizeof(int) >= sizeof(E), "Cannot serialize enum to int");
|
||||
std::vector<int> intValues;
|
||||
intValues.reserve( values.size() );
|
||||
for( auto enumValue : values )
|
||||
intValues.push_back( static_cast<int>( enumValue ) );
|
||||
return registerEnum( enumName, allEnums, intValues );
|
||||
}
|
||||
};
|
||||
|
||||
} // Catch
|
||||
|
||||
#endif // CATCH_INTERFACES_ENUM_VALUES_REGISTRY_HPP_INCLUDED
|
||||
@@ -53,7 +53,6 @@ namespace Catch {
|
||||
virtual void registerTranslator( Detail::unique_ptr<IExceptionTranslator>&& translator ) = 0;
|
||||
virtual void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) = 0;
|
||||
virtual void registerStartupException() noexcept = 0;
|
||||
virtual IMutableEnumValuesRegistry& getMutableEnumValuesRegistry() = 0;
|
||||
};
|
||||
|
||||
IRegistryHub const& getRegistryHub();
|
||||
|
||||
@@ -6,21 +6,28 @@
|
||||
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
#include <catch2/internal/catch_assertion_handler.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_capture.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_debugger.hpp>
|
||||
#include <catch2/internal/catch_run_context.hpp>
|
||||
#include <catch2/internal/catch_test_failure_exception.hpp>
|
||||
#include <catch2/matchers/catch_matchers_string.hpp>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
void AssertionHandler::finishIncomplete() {
|
||||
m_resultCapture.handleIncomplete( m_assertionInfo );
|
||||
}
|
||||
|
||||
AssertionHandler::AssertionHandler
|
||||
( StringRef macroName,
|
||||
SourceLineInfo const& lineInfo,
|
||||
StringRef capturedExpression,
|
||||
ResultDisposition::Flags resultDisposition )
|
||||
: m_assertionInfo{ macroName, lineInfo, capturedExpression, resultDisposition },
|
||||
m_resultCapture( getResultCapture() )
|
||||
m_resultCapture( static_cast<RunContext&>(getResultCapture()) )
|
||||
{
|
||||
m_resultCapture.notifyAssertionStarted( m_assertionInfo );
|
||||
}
|
||||
|
||||
@@ -10,12 +10,13 @@
|
||||
|
||||
#include <catch2/catch_assertion_info.hpp>
|
||||
#include <catch2/internal/catch_decomposer.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_capture.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
class RunContext;
|
||||
|
||||
struct AssertionReaction {
|
||||
bool shouldDebugBreak = false;
|
||||
bool shouldThrow = false;
|
||||
@@ -26,7 +27,12 @@ namespace Catch {
|
||||
AssertionInfo m_assertionInfo;
|
||||
AssertionReaction m_reaction;
|
||||
bool m_completed = false;
|
||||
IResultCapture& m_resultCapture;
|
||||
// Since all uses are hidden in the .cpp file, we can directly use
|
||||
// the final type and avoid going through virtual dispatch, without
|
||||
// massive compilation time overhead.
|
||||
RunContext& m_resultCapture;
|
||||
|
||||
void finishIncomplete();
|
||||
|
||||
public:
|
||||
AssertionHandler
|
||||
@@ -35,9 +41,9 @@ namespace Catch {
|
||||
StringRef capturedExpression,
|
||||
ResultDisposition::Flags resultDisposition );
|
||||
~AssertionHandler() {
|
||||
if ( !m_completed ) {
|
||||
m_resultCapture.handleIncomplete( m_assertionInfo );
|
||||
}
|
||||
// We want the common fast path inlinable, and the virtual
|
||||
// dispatch in a function in single TU.
|
||||
if ( !m_completed ) { finishIncomplete(); }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,16 +27,24 @@
|
||||
#include <catch2/internal/catch_platform.hpp>
|
||||
#include <catch2/catch_user_config.hpp>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
|
||||
# define CATCH_CPP17_OR_GREATER
|
||||
#endif
|
||||
|
||||
# if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
|
||||
# define CATCH_CPP17_OR_GREATER
|
||||
# endif
|
||||
|
||||
# if (__cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)
|
||||
# define CATCH_CPP20_OR_GREATER
|
||||
# endif
|
||||
#if (__cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)
|
||||
# define CATCH_CPP20_OR_GREATER
|
||||
#endif
|
||||
|
||||
// Matchers are only constexpr-able in C++20
|
||||
#if defined( CATCH_CPP20_OR_GREATER ) && \
|
||||
defined( __cpp_constexpr_dynamic_alloc ) && \
|
||||
__cpp_constexpr_dynamic_alloc >= 201907L && \
|
||||
/* GCC < 13 define the feature macro, but compiler bugs stop us from using it */ \
|
||||
( !defined( __GNUC__ ) || __GNUC__ >= 13 || defined(__clang__) )
|
||||
# define CATCH_INTERNAL_CONSTEXPR_MATCHERS_ENABLED
|
||||
# define CATCH_DESTRUCTOR_CONSTEXPR constexpr
|
||||
#else
|
||||
# define CATCH_DESTRUCTOR_CONSTEXPR
|
||||
#endif
|
||||
|
||||
// Only GCC compiler should be used in this block, so other compilers trying to
|
||||
@@ -110,10 +118,15 @@
|
||||
# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
|
||||
_Pragma( "clang diagnostic ignored \"-Wc++20-extensions\"" )
|
||||
# else
|
||||
# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS
|
||||
# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
|
||||
_Pragma( "clang diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"" )
|
||||
# endif
|
||||
|
||||
# if ( __clang_major__ >= 22 )
|
||||
# define CATCH_INTERNAL_SUPPRESS_COUNTER_WARNINGS \
|
||||
_Pragma( "clang diagnostic ignored \"-Wc2y-extensions\"" )
|
||||
# endif
|
||||
|
||||
# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
|
||||
_Pragma( "clang diagnostic ignored \"-Wunused-template\"" )
|
||||
|
||||
@@ -429,6 +442,9 @@
|
||||
#if !defined( CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS )
|
||||
# define CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS
|
||||
#endif
|
||||
#if !defined( CATCH_INTERNAL_SUPPRESS_COUNTER_WARNINGS )
|
||||
# define CATCH_INTERNAL_SUPPRESS_COUNTER_WARNINGS
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__) && defined(__apple_build_version__) && (__clang_major__ < 10)
|
||||
# undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
|
||||
|
||||
@@ -193,7 +193,7 @@ namespace Catch {
|
||||
void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs );
|
||||
|
||||
template<typename LhsT, typename RhsT>
|
||||
class BinaryExpr : public ITransientExpression {
|
||||
class BinaryExpr final : public ITransientExpression {
|
||||
LhsT m_lhs;
|
||||
StringRef m_op;
|
||||
RhsT m_rhs;
|
||||
@@ -269,7 +269,7 @@ namespace Catch {
|
||||
};
|
||||
|
||||
template<typename LhsT>
|
||||
class UnaryExpr : public ITransientExpression {
|
||||
class UnaryExpr final : public ITransientExpression {
|
||||
LhsT m_lhs;
|
||||
|
||||
void streamReconstructedExpression( std::ostream &os ) const override {
|
||||
|
||||
+10
-18
@@ -5,15 +5,14 @@
|
||||
// https://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
#include <catch2/internal/catch_enum_values_registry.hpp>
|
||||
|
||||
#include <catch2/internal/catch_enum_info.hpp>
|
||||
#include <catch2/internal/catch_string_manip.hpp>
|
||||
|
||||
#include <cassert>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
IMutableEnumValuesRegistry::~IMutableEnumValuesRegistry() = default;
|
||||
|
||||
namespace Detail {
|
||||
|
||||
namespace {
|
||||
@@ -39,9 +38,7 @@ namespace Catch {
|
||||
return parsed;
|
||||
}
|
||||
|
||||
EnumInfo::~EnumInfo() = default;
|
||||
|
||||
StringRef EnumInfo::lookup( int value ) const {
|
||||
StringRef EnumInfo::lookup( int64_t value ) const {
|
||||
for( auto const& valueToName : m_values ) {
|
||||
if( valueToName.first == value )
|
||||
return valueToName.second;
|
||||
@@ -49,25 +46,20 @@ namespace Catch {
|
||||
return "{** unexpected enum value **}"_sr;
|
||||
}
|
||||
|
||||
Catch::Detail::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName, StringRef allValueNames, std::vector<int> const& values ) {
|
||||
auto enumInfo = Catch::Detail::make_unique<EnumInfo>();
|
||||
enumInfo->m_name = enumName;
|
||||
enumInfo->m_values.reserve( values.size() );
|
||||
EnumInfo makeEnumInfo( StringRef enumName, StringRef allValueNames, std::vector<int64_t> const& values ) {
|
||||
EnumInfo enumInfo;
|
||||
enumInfo.m_name = enumName;
|
||||
enumInfo.m_values.reserve( values.size() );
|
||||
|
||||
const auto valueNames = Catch::Detail::parseEnums( allValueNames );
|
||||
assert( valueNames.size() == values.size() );
|
||||
std::size_t i = 0;
|
||||
for( auto value : values )
|
||||
enumInfo->m_values.emplace_back(value, valueNames[i++]);
|
||||
for (size_t i = 0; i < values.size(); ++i) {
|
||||
enumInfo.m_values.emplace_back( values[i], valueNames[i] );
|
||||
}
|
||||
|
||||
return enumInfo;
|
||||
}
|
||||
|
||||
EnumInfo const& EnumValuesRegistry::registerEnum( StringRef enumName, StringRef allValueNames, std::vector<int> const& values ) {
|
||||
m_enumInfos.push_back(makeEnumInfo(enumName, allValueNames, values));
|
||||
return *m_enumInfos.back();
|
||||
}
|
||||
|
||||
} // Detail
|
||||
} // Catch
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
|
||||
// Copyright Catch2 Authors
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE.txt or copy at
|
||||
// https://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
#ifndef CATCH_ENUM_INFO_HPP_INCLUDED
|
||||
#define CATCH_ENUM_INFO_HPP_INCLUDED
|
||||
|
||||
#include <catch2/internal/catch_stringref.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace Catch {
|
||||
namespace Detail {
|
||||
|
||||
struct EnumInfo {
|
||||
StringRef m_name;
|
||||
std::vector<std::pair<int64_t, StringRef>> m_values;
|
||||
|
||||
StringRef lookup( int64_t value ) const;
|
||||
};
|
||||
|
||||
EnumInfo makeEnumInfo( StringRef enumName,
|
||||
StringRef allValueNames,
|
||||
std::vector<int64_t> const& values );
|
||||
template <typename E>
|
||||
Detail::EnumInfo makeEnumInfo( StringRef enumName,
|
||||
StringRef allEnums,
|
||||
std::initializer_list<E> values ) {
|
||||
static_assert( sizeof( int64_t ) >= sizeof( E ),
|
||||
"Cannot serialize enum to int64_t" );
|
||||
std::vector<int64_t> intValues;
|
||||
intValues.reserve( values.size() );
|
||||
for ( auto enumValue : values )
|
||||
intValues.push_back( static_cast<int64_t>( enumValue ) );
|
||||
return makeEnumInfo( enumName, allEnums, intValues );
|
||||
}
|
||||
|
||||
std::vector<StringRef> parseEnums( StringRef enums );
|
||||
|
||||
} // namespace Detail
|
||||
} // namespace Catch
|
||||
|
||||
#endif // CATCH_ENUM_INFO_HPP_INCLUDED
|
||||
@@ -1,36 +0,0 @@
|
||||
|
||||
// Copyright Catch2 Authors
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE.txt or copy at
|
||||
// https://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
#ifndef CATCH_ENUM_VALUES_REGISTRY_HPP_INCLUDED
|
||||
#define CATCH_ENUM_VALUES_REGISTRY_HPP_INCLUDED
|
||||
|
||||
#include <catch2/interfaces/catch_interfaces_enum_values_registry.hpp>
|
||||
#include <catch2/internal/catch_unique_ptr.hpp>
|
||||
#include <catch2/internal/catch_stringref.hpp>
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
namespace Detail {
|
||||
|
||||
Catch::Detail::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName, StringRef allValueNames, std::vector<int> const& values );
|
||||
|
||||
class EnumValuesRegistry : public IMutableEnumValuesRegistry {
|
||||
|
||||
std::vector<Catch::Detail::unique_ptr<EnumInfo>> m_enumInfos;
|
||||
|
||||
EnumInfo const& registerEnum( StringRef enumName, StringRef allValueNames, std::vector<int> const& values) override;
|
||||
};
|
||||
|
||||
std::vector<StringRef> parseEnums( StringRef enums );
|
||||
|
||||
} // Detail
|
||||
|
||||
} // Catch
|
||||
|
||||
#endif // CATCH_ENUM_VALUES_REGISTRY_HPP_INCLUDED
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
namespace Catch {
|
||||
|
||||
class ExceptionTranslatorRegistry : public IExceptionTranslatorRegistry {
|
||||
class ExceptionTranslatorRegistry final : public IExceptionTranslatorRegistry {
|
||||
public:
|
||||
~ExceptionTranslatorRegistry() override;
|
||||
void registerTranslator( Detail::unique_ptr<IExceptionTranslator>&& translator );
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Catch {
|
||||
namespace {
|
||||
//! A no-op implementation, used if no reporter wants output
|
||||
//! redirection.
|
||||
class NoopRedirect : public OutputRedirect {
|
||||
class NoopRedirect final : public OutputRedirect {
|
||||
void activateImpl() override {}
|
||||
void deactivateImpl() override {}
|
||||
std::string getStdout() override { return {}; }
|
||||
@@ -70,7 +70,7 @@ namespace Catch {
|
||||
* Redirects the `std::cout`, `std::cerr`, `std::clog` streams,
|
||||
* but does not touch the actual `stdout`/`stderr` file descriptors.
|
||||
*/
|
||||
class StreamRedirect : public OutputRedirect {
|
||||
class StreamRedirect final : public OutputRedirect {
|
||||
ReusableStringStream m_redirectedOut, m_redirectedErr;
|
||||
RedirectedStreamNew m_cout, m_cerr, m_clog;
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace Catch {
|
||||
* Works by replacing the file descriptors numbered 1 and 2
|
||||
* with an open temporary file.
|
||||
*/
|
||||
class FileRedirect : public OutputRedirect {
|
||||
class FileRedirect final : public OutputRedirect {
|
||||
TempFile m_outFile, m_errFile;
|
||||
int m_originalOut = -1;
|
||||
int m_originalErr = -1;
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <catch2/generators/catch_generators_throw.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_config.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_generatortracker.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_registry_hub.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_reporter.hpp>
|
||||
#include <catch2/internal/catch_compiler_capabilities.hpp>
|
||||
#include <catch2/internal/catch_context.hpp>
|
||||
@@ -60,9 +61,14 @@ namespace Catch {
|
||||
// can be, so the tracker has to throw for a wrong
|
||||
// filter to stop the execution flow.
|
||||
if (filter.type == PathFilter::For::Section) {
|
||||
// TBD: Explicit SKIP, or new exception that says
|
||||
// "don't continue", but doesn't show in totals?
|
||||
SKIP();
|
||||
// We want the semantics of `SKIP()`, but we inline it
|
||||
// to avoid issues with conditionally prefixed macros
|
||||
INTERNAL_CATCH_MSG(
|
||||
"SKIP",
|
||||
Catch::ResultWas::ExplicitSkip,
|
||||
Catch::ResultDisposition::Normal,
|
||||
"" );
|
||||
Catch::Detail::Unreachable();
|
||||
}
|
||||
// '*' is the wildcard for "all elements in generator"
|
||||
// used for filtering sections below the generator, but
|
||||
@@ -303,6 +309,25 @@ namespace Catch {
|
||||
}
|
||||
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
|
||||
|
||||
|
||||
void pushScopedMessage( MessageInfo&& message ) {
|
||||
Detail::g_messageHolder().addScopedMessage( CATCH_MOVE( message ) );
|
||||
}
|
||||
|
||||
void popScopedMessage( unsigned int messageId ) {
|
||||
Detail::g_messageHolder().removeMessage( messageId );
|
||||
}
|
||||
|
||||
void emplaceUnscopedMessage( MessageBuilder&& builder ) {
|
||||
Detail::g_messageHolder().addUnscopedMessage( CATCH_MOVE( builder ) );
|
||||
}
|
||||
|
||||
void addUnscopedMessage( MessageInfo&& message ) {
|
||||
Detail::g_messageHolder().addUnscopedMessage( CATCH_MOVE( message ) );
|
||||
}
|
||||
|
||||
bool lastAssertionPassed() { return Detail::g_lastAssertionPassed; }
|
||||
|
||||
} // namespace Detail
|
||||
|
||||
RunContext::RunContext(IConfig const* _config, IEventListenerPtr&& reporter)
|
||||
@@ -436,14 +461,13 @@ namespace Catch {
|
||||
Detail::g_lastAssertionPassed = true;
|
||||
} else if (!result.succeeded()) {
|
||||
Detail::g_lastAssertionPassed = false;
|
||||
if (result.isOk()) {
|
||||
}
|
||||
else if( m_activeTestCase->getTestCaseInfo().okToFail() ) // Read from a shared state established before the threads could start, this is fine
|
||||
if (result.isOk()) {}
|
||||
else if( m_activeTestCase->getTestCaseInfo().okToFail() ) { // Read from a shared state established before the threads could start, this is fine
|
||||
m_atomicAssertionCount.failedButOk++;
|
||||
else
|
||||
} else {
|
||||
m_atomicAssertionCount.failed++;
|
||||
}
|
||||
else {
|
||||
}
|
||||
} else {
|
||||
Detail::g_lastAssertionPassed = true;
|
||||
}
|
||||
|
||||
@@ -519,8 +543,12 @@ namespace Catch {
|
||||
// TBD: Do we want to avoid the warning if the generator is filtered?
|
||||
if ( m_config->warnAboutInfiniteGenerators() &&
|
||||
!generator->isFinite() ) {
|
||||
// TBD: Would it be better to expand this macro inline?
|
||||
FAIL( "GENERATE() would run infinitely" );
|
||||
// We want the semantics of `FAIL()`, but we inline it
|
||||
// to avoid issues with conditionally prefixed macros
|
||||
INTERNAL_CATCH_MSG( "FAIL",
|
||||
Catch::ResultWas::ExplicitFailure,
|
||||
Catch::ResultDisposition::Normal,
|
||||
"GENERATE() would run infinitely" );
|
||||
}
|
||||
|
||||
auto nameAndLoc = TestCaseTracking::NameAndLocation( static_cast<std::string>( generatorName ), lineInfo );
|
||||
@@ -621,7 +649,7 @@ namespace Catch {
|
||||
// and since IResultCapture::getLastResult is deprecated,
|
||||
// we will leave it as is, until it is finally removed.
|
||||
Detail::LockGuard _( m_assertionMutex );
|
||||
return &(*m_lastResult);
|
||||
return &*m_lastResult;
|
||||
}
|
||||
|
||||
void RunContext::exceptionEarlyReported() {
|
||||
@@ -695,10 +723,6 @@ namespace Catch {
|
||||
m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, false));
|
||||
}
|
||||
|
||||
bool RunContext::lastAssertionPassed() {
|
||||
return Detail::g_lastAssertionPassed;
|
||||
}
|
||||
|
||||
void RunContext::assertionPassedFastPath(SourceLineInfo lineInfo) {
|
||||
// We want to save the line info for better experience with unexpected assertions
|
||||
Detail::g_lastKnownLineInfo = lineInfo;
|
||||
@@ -877,7 +901,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
void RunContext::populateReaction( AssertionReaction& reaction,
|
||||
bool has_normal_disposition ) {
|
||||
bool has_normal_disposition ) const {
|
||||
reaction.shouldDebugBreak = m_shouldDebugBreak;
|
||||
reaction.shouldThrow = aborting() || has_normal_disposition;
|
||||
}
|
||||
@@ -928,22 +952,6 @@ namespace Catch {
|
||||
}
|
||||
}
|
||||
|
||||
void IResultCapture::pushScopedMessage( MessageInfo&& message ) {
|
||||
Detail::g_messageHolder().addScopedMessage( CATCH_MOVE( message ) );
|
||||
}
|
||||
|
||||
void IResultCapture::popScopedMessage( unsigned int messageId ) {
|
||||
Detail::g_messageHolder().removeMessage( messageId );
|
||||
}
|
||||
|
||||
void IResultCapture::emplaceUnscopedMessage( MessageBuilder&& builder ) {
|
||||
Detail::g_messageHolder().addUnscopedMessage( CATCH_MOVE( builder ) );
|
||||
}
|
||||
|
||||
void IResultCapture::addUnscopedMessage( MessageInfo&& message ) {
|
||||
Detail::g_messageHolder().addUnscopedMessage( CATCH_MOVE( message ) );
|
||||
}
|
||||
|
||||
void seedRng(IConfig const& config) {
|
||||
sharedRng().seed(config.rngSeed());
|
||||
}
|
||||
|
||||
@@ -102,8 +102,6 @@ namespace Catch {
|
||||
|
||||
void handleFatalErrorCondition( StringRef message ) override;
|
||||
|
||||
bool lastAssertionPassed() override;
|
||||
|
||||
public:
|
||||
// !TBD We need to do this another way!
|
||||
bool aborting() const;
|
||||
@@ -125,7 +123,7 @@ namespace Catch {
|
||||
ITransientExpression const *expr,
|
||||
bool negated );
|
||||
|
||||
void populateReaction( AssertionReaction& reaction, bool has_normal_disposition );
|
||||
void populateReaction( AssertionReaction& reaction, bool has_normal_disposition ) const;
|
||||
|
||||
// Creates dummy info for unexpected exceptions/fatal errors,
|
||||
// where we do not have the access to one, but we still need
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Catch {
|
||||
|
||||
|
||||
template<typename SingletonImplT, typename InterfaceT = SingletonImplT, typename MutableInterfaceT = InterfaceT>
|
||||
class Singleton : SingletonImplT, public ISingleton {
|
||||
class Singleton final : SingletonImplT, public ISingleton {
|
||||
|
||||
static auto getInternal() -> Singleton* {
|
||||
static Singleton* s_instance = nullptr;
|
||||
|
||||
@@ -16,10 +16,11 @@ namespace Catch {
|
||||
|
||||
TagAlias const* TagAliasRegistry::find( std::string const& alias ) const {
|
||||
auto it = m_registry.find( alias );
|
||||
if( it != m_registry.end() )
|
||||
return &(it->second);
|
||||
else
|
||||
if ( it != m_registry.end() ) {
|
||||
return &it->second;
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
std::string TagAliasRegistry::expandAliases( std::string const& unexpandedTestSpec ) const {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
namespace Catch {
|
||||
struct SourceLineInfo;
|
||||
|
||||
class TagAliasRegistry : public ITagAliasRegistry {
|
||||
class TagAliasRegistry final : public ITagAliasRegistry {
|
||||
public:
|
||||
~TagAliasRegistry() override;
|
||||
TagAlias const* find( std::string const& alias ) const override;
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Catch {
|
||||
std::vector<TestCaseHandle> filterTests( std::vector<TestCaseHandle> const& testCases, TestSpec const& testSpec, IConfig const& config );
|
||||
std::vector<TestCaseHandle> const& getAllTestCasesSorted( IConfig const& config );
|
||||
|
||||
class TestRegistry : public ITestCaseRegistry {
|
||||
class TestRegistry final : public ITestCaseRegistry {
|
||||
public:
|
||||
void registerTest( Detail::unique_ptr<TestCaseInfo> testInfo, Detail::unique_ptr<ITestInvoker> testInvoker );
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Catch {
|
||||
|
||||
void throw_test_failure_exception() {
|
||||
#if !defined( CATCH_CONFIG_DISABLE_EXCEPTIONS )
|
||||
throw TestFailureException{};
|
||||
throw TestFailureException{}; //NOLINT(bugprone-std-exception-baseclass)
|
||||
#else
|
||||
CATCH_ERROR( "Test failure requires aborting test!" );
|
||||
#endif
|
||||
@@ -22,7 +22,7 @@ namespace Catch {
|
||||
|
||||
void throw_test_skip_exception() {
|
||||
#if !defined( CATCH_CONFIG_DISABLE_EXCEPTIONS )
|
||||
throw Catch::TestSkipException();
|
||||
throw Catch::TestSkipException(); //NOLINT(bugprone-std-exception-baseclass)
|
||||
#else
|
||||
CATCH_ERROR( "Explicitly skipping tests during runtime requires exceptions" );
|
||||
#endif
|
||||
|
||||
@@ -11,10 +11,16 @@
|
||||
#include <catch2/catch_user_config.hpp>
|
||||
#include <catch2/internal/catch_assertion_handler.hpp>
|
||||
#include <catch2/internal/catch_preprocessor_internal_stringify.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_capture.hpp>
|
||||
#include <catch2/internal/catch_stringref.hpp>
|
||||
#include <catch2/internal/catch_source_line_info.hpp>
|
||||
|
||||
namespace Catch {
|
||||
namespace Detail {
|
||||
// Defined in catch_run_context.cpp, where the thread-local data lives.
|
||||
bool lastAssertionPassed();
|
||||
}
|
||||
}
|
||||
|
||||
// We need this suppression to leak, because it took until GCC 10
|
||||
// for the front end to handle local suppression via _Pragma properly
|
||||
#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && __GNUC__ <= 9
|
||||
@@ -57,12 +63,12 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define INTERNAL_CATCH_IF( macroName, resultDisposition, ... ) \
|
||||
INTERNAL_CATCH_TEST( macroName, resultDisposition, __VA_ARGS__ ); \
|
||||
if( Catch::getResultCapture().lastAssertionPassed() )
|
||||
if( Catch::Detail::lastAssertionPassed() )
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define INTERNAL_CATCH_ELSE( macroName, resultDisposition, ... ) \
|
||||
INTERNAL_CATCH_TEST( macroName, resultDisposition, __VA_ARGS__ ); \
|
||||
if( !Catch::getResultCapture().lastAssertionPassed() )
|
||||
if( !Catch::Detail::lastAssertionPassed() )
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define INTERNAL_CATCH_NO_THROW( macroName, resultDisposition, ... ) \
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
namespace Catch {
|
||||
|
||||
template<typename C>
|
||||
class TestInvokerAsMethod : public ITestInvoker {
|
||||
class TestInvokerAsMethod final : public ITestInvoker {
|
||||
void (C::*m_testAsMethod)();
|
||||
public:
|
||||
constexpr TestInvokerAsMethod( void ( C::*testAsMethod )() ) noexcept:
|
||||
@@ -49,7 +49,7 @@ Detail::unique_ptr<ITestInvoker> makeTestInvoker( void (C::*testAsMethod)() ) {
|
||||
}
|
||||
|
||||
template <typename C>
|
||||
class TestInvokerFixture : public ITestInvoker {
|
||||
class TestInvokerFixture final : public ITestInvoker {
|
||||
void ( C::*m_testAsMethod )() const;
|
||||
Detail::unique_ptr<C> m_fixture = nullptr;
|
||||
|
||||
@@ -124,7 +124,7 @@ struct AutoReg : Detail::NonCopyable {
|
||||
namespace Catch {
|
||||
namespace Detail {
|
||||
struct DummyUse {
|
||||
DummyUse( void ( * )( int ), Catch::NameAndTags const& );
|
||||
DummyUse( void ( * )( int ), Catch::NameAndTags const& ) noexcept;
|
||||
};
|
||||
} // namespace Detail
|
||||
} // namespace Catch
|
||||
|
||||
@@ -26,6 +26,10 @@ namespace {
|
||||
return std::memchr( chars, c, sizeof( chars ) - 1 ) != nullptr;
|
||||
}
|
||||
|
||||
bool isUtf8ContinuationByte( char c ) {
|
||||
return ( static_cast<unsigned char>( c ) & 0xC0 ) == 0x80;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace Catch {
|
||||
@@ -52,6 +56,11 @@ namespace Catch {
|
||||
if ( it != m_string.end() ) {
|
||||
++m_size;
|
||||
++it;
|
||||
// Skip UTF-8 continuation bytes
|
||||
while ( it != m_string.end() &&
|
||||
isUtf8ContinuationByte( *it ) ) {
|
||||
++it;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -114,6 +123,11 @@ namespace Catch {
|
||||
void AnsiSkippingString::const_iterator::advance() {
|
||||
assert( m_it != m_string->end() );
|
||||
m_it++;
|
||||
// Skip UTF-8 continuation bytes
|
||||
while ( m_it != m_string->end() &&
|
||||
isUtf8ContinuationByte( *m_it ) ) {
|
||||
m_it++;
|
||||
}
|
||||
tryParseAnsiEscapes();
|
||||
}
|
||||
|
||||
@@ -133,6 +147,11 @@ namespace Catch {
|
||||
assert( *m_it == '\033' );
|
||||
m_it--;
|
||||
}
|
||||
// Skip back over UTF-8 continuation bytes to the leading byte
|
||||
while ( isUtf8ContinuationByte( *m_it ) ) {
|
||||
assert( m_it != m_string->begin() );
|
||||
m_it--;
|
||||
}
|
||||
}
|
||||
|
||||
static bool isBoundary( AnsiSkippingString const& line,
|
||||
|
||||
@@ -8,9 +8,22 @@
|
||||
#ifndef CATCH_UNIQUE_NAME_HPP_INCLUDED
|
||||
#define CATCH_UNIQUE_NAME_HPP_INCLUDED
|
||||
|
||||
#include <catch2/internal/catch_compiler_capabilities.hpp>
|
||||
#include <catch2/internal/catch_config_counter.hpp>
|
||||
|
||||
// Fixme: Clang 22 has an annoying bug where the localized suppression
|
||||
// below does not actually suppress the extension warning from
|
||||
// using __COUNTER__, so we have to leak the suppression for the
|
||||
// whole TU. Hopefully Clang 23 fixes this before full release.
|
||||
// As AppleClang does its own thing version-wise, we ignore it
|
||||
// completely.
|
||||
#if defined( __clang__ ) && ( __clang_major__ >= 22 ) && !defined( __APPLE__ )
|
||||
CATCH_INTERNAL_SUPPRESS_COUNTER_WARNINGS
|
||||
#endif
|
||||
|
||||
#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line
|
||||
#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line )
|
||||
|
||||
#ifdef CATCH_CONFIG_COUNTER
|
||||
# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ )
|
||||
#else
|
||||
|
||||
@@ -13,13 +13,13 @@ namespace Catch {
|
||||
namespace Matchers {
|
||||
|
||||
std::string MatcherUntypedBase::toString() const {
|
||||
if (m_cachedToString.empty()) {
|
||||
m_cachedToString = describe();
|
||||
}
|
||||
return m_cachedToString;
|
||||
return describe();
|
||||
}
|
||||
|
||||
MatcherUntypedBase::~MatcherUntypedBase() = default;
|
||||
std::string MatcherUntypedBase::describe() const {
|
||||
using namespace std::string_literals;
|
||||
return "Undescribed matcher"s;
|
||||
}
|
||||
|
||||
} // namespace Matchers
|
||||
} // namespace Catch
|
||||
|
||||
@@ -20,10 +20,10 @@ namespace Matchers {
|
||||
|
||||
class MatcherUntypedBase {
|
||||
public:
|
||||
MatcherUntypedBase() = default;
|
||||
constexpr MatcherUntypedBase() = default;
|
||||
|
||||
MatcherUntypedBase(MatcherUntypedBase const&) = default;
|
||||
MatcherUntypedBase(MatcherUntypedBase&&) = default;
|
||||
constexpr MatcherUntypedBase(MatcherUntypedBase const&) = default;
|
||||
constexpr MatcherUntypedBase(MatcherUntypedBase&&) = default;
|
||||
|
||||
MatcherUntypedBase& operator = (MatcherUntypedBase const&) = delete;
|
||||
MatcherUntypedBase& operator = (MatcherUntypedBase&&) = delete;
|
||||
@@ -31,9 +31,9 @@ namespace Matchers {
|
||||
std::string toString() const;
|
||||
|
||||
protected:
|
||||
virtual ~MatcherUntypedBase(); // = default;
|
||||
virtual std::string describe() const = 0;
|
||||
mutable std::string m_cachedToString;
|
||||
CATCH_DESTRUCTOR_CONSTEXPR virtual ~MatcherUntypedBase() = default;
|
||||
//! Should be overridden, but we provide default "undescribed" impl
|
||||
virtual std::string describe() const;
|
||||
};
|
||||
|
||||
|
||||
@@ -215,6 +215,19 @@ namespace Matchers {
|
||||
#define CATCH_CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CATCH_CHECK_THAT", matcher, Catch::ResultDisposition::ContinueOnFailure, arg )
|
||||
#define CATCH_REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CATCH_REQUIRE_THAT", matcher, Catch::ResultDisposition::Normal, arg )
|
||||
|
||||
#if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE)
|
||||
#define CATCH_STATIC_REQUIRE_THAT( arg, matcher ) \
|
||||
static_assert( ( matcher ).match( arg ), #matcher ".match( " #arg " )"); \
|
||||
CATCH_SUCCEED( #matcher ".match( " #arg " )" )
|
||||
#define CATCH_STATIC_CHECK_THAT( arg, matcher ) \
|
||||
static_assert( ( matcher ).match( arg ), #matcher ".match( " #arg " )"); \
|
||||
CATCH_SUCCEED( #matcher ".match( " #arg " )" )
|
||||
#else
|
||||
#define CATCH_STATIC_REQUIRE_THAT( arg, matcher ) CATCH_REQUIRE_THAT( arg, matcher )
|
||||
#define CATCH_STATIC_CHECK_THAT( arg, matcher ) CATCH_CHECK_THAT( arg, matcher )
|
||||
#endif
|
||||
|
||||
|
||||
#elif defined(CATCH_CONFIG_PREFIX_ALL) && defined(CATCH_CONFIG_DISABLE)
|
||||
|
||||
#define CATCH_REQUIRE_THROWS_WITH( expr, matcher ) (void)(0)
|
||||
@@ -226,6 +239,9 @@ namespace Matchers {
|
||||
#define CATCH_CHECK_THAT( arg, matcher ) (void)(0)
|
||||
#define CATCH_REQUIRE_THAT( arg, matcher ) (void)(0)
|
||||
|
||||
#define CATCH_STATIC_REQUIRE_THAT( arg, matcher ) (void)(0)
|
||||
#define CATCH_STATIC_CHECK_THAT( arg, matcher ) (void)(0)
|
||||
|
||||
#elif !defined(CATCH_CONFIG_PREFIX_ALL) && !defined(CATCH_CONFIG_DISABLE)
|
||||
|
||||
#define REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "REQUIRE_THROWS_WITH", Catch::ResultDisposition::Normal, matcher, expr )
|
||||
@@ -237,6 +253,19 @@ namespace Matchers {
|
||||
#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CHECK_THAT", matcher, Catch::ResultDisposition::ContinueOnFailure, arg )
|
||||
#define REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "REQUIRE_THAT", matcher, Catch::ResultDisposition::Normal, arg )
|
||||
|
||||
#if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE)
|
||||
#define STATIC_REQUIRE_THAT( arg, matcher ) \
|
||||
static_assert( ( matcher ).match( arg ), #matcher ".match( " #arg " )"); \
|
||||
SUCCEED( #matcher ".match( " #arg " )" )
|
||||
#define STATIC_CHECK_THAT( arg, matcher ) \
|
||||
static_assert( ( matcher ).match( arg ), #matcher ".match( " #arg " )"); \
|
||||
SUCCEED( #matcher ".match( " #arg " )" )
|
||||
#else
|
||||
#define STATIC_REQUIRE_THAT( arg, matcher ) REQUIRE_THAT( arg, matcher )
|
||||
#define STATIC_CHECK_THAT( arg, matcher ) CHECK_THAT( arg, matcher )
|
||||
#endif
|
||||
|
||||
|
||||
#elif !defined(CATCH_CONFIG_PREFIX_ALL) && defined(CATCH_CONFIG_DISABLE)
|
||||
|
||||
#define REQUIRE_THROWS_WITH( expr, matcher ) (void)(0)
|
||||
@@ -248,6 +277,9 @@ namespace Matchers {
|
||||
#define CHECK_THAT( arg, matcher ) (void)(0)
|
||||
#define REQUIRE_THAT( arg, matcher ) (void)(0)
|
||||
|
||||
#define STATIC_REQUIRE_THAT( arg, matcher ) (void)(0)
|
||||
#define STATIC_CHECK_THAT( arg, matcher ) (void)(0)
|
||||
|
||||
#endif // end of user facing macro declarations
|
||||
|
||||
#endif // CATCH_MATCHERS_HPP_INCLUDED
|
||||
|
||||
@@ -22,13 +22,5 @@ namespace Matchers {
|
||||
return sstr.str();
|
||||
}
|
||||
|
||||
IsEmptyMatcher IsEmpty() {
|
||||
return {};
|
||||
}
|
||||
|
||||
HasSizeMatcher SizeIs(std::size_t sz) {
|
||||
return HasSizeMatcher{ sz };
|
||||
}
|
||||
|
||||
} // end namespace Matchers
|
||||
} // end namespace Catch
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Catch {
|
||||
class IsEmptyMatcher final : public MatcherGenericBase {
|
||||
public:
|
||||
template <typename RangeLike>
|
||||
bool match(RangeLike&& rng) const {
|
||||
constexpr bool match(RangeLike&& rng) const {
|
||||
#if defined(CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS)
|
||||
using Catch::Detail::empty;
|
||||
#else
|
||||
@@ -33,12 +33,12 @@ namespace Catch {
|
||||
class HasSizeMatcher final : public MatcherGenericBase {
|
||||
std::size_t m_target_size;
|
||||
public:
|
||||
explicit HasSizeMatcher(std::size_t target_size):
|
||||
constexpr explicit HasSizeMatcher(std::size_t target_size):
|
||||
m_target_size(target_size)
|
||||
{}
|
||||
|
||||
template <typename RangeLike>
|
||||
bool match(RangeLike&& rng) const {
|
||||
constexpr bool match(RangeLike&& rng) const {
|
||||
#if defined(CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS)
|
||||
using Catch::Detail::size;
|
||||
#else
|
||||
@@ -54,12 +54,12 @@ namespace Catch {
|
||||
class SizeMatchesMatcher final : public MatcherGenericBase {
|
||||
Matcher m_matcher;
|
||||
public:
|
||||
explicit SizeMatchesMatcher(Matcher m):
|
||||
constexpr explicit SizeMatchesMatcher(Matcher m):
|
||||
m_matcher(CATCH_MOVE(m))
|
||||
{}
|
||||
|
||||
template <typename RangeLike>
|
||||
bool match(RangeLike&& rng) const {
|
||||
constexpr bool match(RangeLike&& rng) const {
|
||||
#if defined(CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS)
|
||||
using Catch::Detail::size;
|
||||
#else
|
||||
@@ -75,11 +75,13 @@ namespace Catch {
|
||||
|
||||
|
||||
//! Creates a matcher that accepts empty ranges/containers
|
||||
IsEmptyMatcher IsEmpty();
|
||||
inline CATCH_DESTRUCTOR_CONSTEXPR IsEmptyMatcher IsEmpty() { return {}; }
|
||||
//! Creates a matcher that accepts ranges/containers with specific size
|
||||
HasSizeMatcher SizeIs(std::size_t sz);
|
||||
inline CATCH_DESTRUCTOR_CONSTEXPR HasSizeMatcher SizeIs( std::size_t sz ) {
|
||||
return HasSizeMatcher{ sz };
|
||||
}
|
||||
template <typename Matcher>
|
||||
std::enable_if_t<Detail::is_matcher_v<Matcher>,
|
||||
constexpr std::enable_if_t<Detail::is_matcher_v<Matcher>,
|
||||
SizeMatchesMatcher<Matcher>> SizeIs(Matcher&& m) {
|
||||
return SizeMatchesMatcher<Matcher>{CATCH_FORWARD(m)};
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Catch {
|
||||
Equality m_eq;
|
||||
public:
|
||||
template <typename T2, typename Equality2>
|
||||
ContainsElementMatcher(T2&& target, Equality2&& predicate):
|
||||
constexpr ContainsElementMatcher(T2&& target, Equality2&& predicate):
|
||||
m_desired(CATCH_FORWARD(target)),
|
||||
m_eq(CATCH_FORWARD(predicate))
|
||||
{}
|
||||
@@ -33,7 +33,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
template <typename RangeLike>
|
||||
bool match( RangeLike&& rng ) const {
|
||||
constexpr bool match( RangeLike&& rng ) const {
|
||||
for ( auto&& elem : rng ) {
|
||||
if ( m_eq( elem, m_desired ) ) { return true; }
|
||||
}
|
||||
@@ -49,12 +49,12 @@ namespace Catch {
|
||||
// Note that we do a copy+move to avoid having to SFINAE this
|
||||
// constructor (and also avoid some perfect forwarding failure
|
||||
// cases)
|
||||
ContainsMatcherMatcher(Matcher matcher):
|
||||
constexpr ContainsMatcherMatcher(Matcher matcher):
|
||||
m_matcher(CATCH_MOVE(matcher))
|
||||
{}
|
||||
|
||||
template <typename RangeLike>
|
||||
bool match(RangeLike&& rng) const {
|
||||
constexpr bool match(RangeLike&& rng) const {
|
||||
for (auto&& elem : rng) {
|
||||
if (m_matcher.match(elem)) {
|
||||
return true;
|
||||
@@ -74,14 +74,14 @@ namespace Catch {
|
||||
* Uses `std::equal_to` to do the comparison
|
||||
*/
|
||||
template <typename T>
|
||||
std::enable_if_t<!Detail::is_matcher_v<T>,
|
||||
constexpr std::enable_if_t<!Detail::is_matcher_v<T>,
|
||||
ContainsElementMatcher<T, std::equal_to<>>> Contains(T&& elem) {
|
||||
return { CATCH_FORWARD(elem), std::equal_to<>{} };
|
||||
}
|
||||
|
||||
//! Creates a matcher that checks whether a range contains element matching a matcher
|
||||
template <typename Matcher>
|
||||
std::enable_if_t<Detail::is_matcher_v<Matcher>,
|
||||
constexpr std::enable_if_t<Detail::is_matcher_v<Matcher>,
|
||||
ContainsMatcherMatcher<Matcher>> Contains(Matcher&& matcher) {
|
||||
return { CATCH_FORWARD(matcher) };
|
||||
}
|
||||
@@ -92,7 +92,7 @@ namespace Catch {
|
||||
* Uses `eq` to do the comparisons, the element is provided on the rhs
|
||||
*/
|
||||
template <typename T, typename Equality>
|
||||
ContainsElementMatcher<T, Equality> Contains(T&& elem, Equality&& eq) {
|
||||
constexpr ContainsElementMatcher<T, Equality> Contains(T&& elem, Equality&& eq) {
|
||||
return { CATCH_FORWARD(elem), CATCH_FORWARD(eq) };
|
||||
}
|
||||
|
||||
|
||||
@@ -9,16 +9,12 @@
|
||||
|
||||
namespace Catch {
|
||||
namespace Matchers {
|
||||
std::string AllTrueMatcher::describe() const { return "contains only true"; }
|
||||
|
||||
AllTrueMatcher AllTrue() { return AllTrueMatcher{}; }
|
||||
std::string AllTrueMatcher::describe() const { return "contains only true"; }
|
||||
|
||||
std::string NoneTrueMatcher::describe() const { return "contains no true"; }
|
||||
|
||||
NoneTrueMatcher NoneTrue() { return NoneTrueMatcher{}; }
|
||||
|
||||
std::string AnyTrueMatcher::describe() const { return "contains at least one true"; }
|
||||
|
||||
AnyTrueMatcher AnyTrue() { return AnyTrueMatcher{}; }
|
||||
} // namespace Matchers
|
||||
} // namespace Catch
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Catch {
|
||||
class AllMatchMatcher final : public MatcherGenericBase {
|
||||
Matcher m_matcher;
|
||||
public:
|
||||
AllMatchMatcher(Matcher matcher):
|
||||
constexpr AllMatchMatcher(Matcher matcher):
|
||||
m_matcher(CATCH_MOVE(matcher))
|
||||
{}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
template <typename RangeLike>
|
||||
bool match(RangeLike&& rng) const {
|
||||
constexpr bool match(RangeLike&& rng) const {
|
||||
for (auto&& elem : rng) {
|
||||
if (!m_matcher.match(elem)) {
|
||||
return false;
|
||||
@@ -42,7 +42,7 @@ namespace Catch {
|
||||
class NoneMatchMatcher final : public MatcherGenericBase {
|
||||
Matcher m_matcher;
|
||||
public:
|
||||
NoneMatchMatcher(Matcher matcher):
|
||||
constexpr NoneMatchMatcher(Matcher matcher):
|
||||
m_matcher(CATCH_MOVE(matcher))
|
||||
{}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
template <typename RangeLike>
|
||||
bool match(RangeLike&& rng) const {
|
||||
constexpr bool match(RangeLike&& rng) const {
|
||||
for (auto&& elem : rng) {
|
||||
if (m_matcher.match(elem)) {
|
||||
return false;
|
||||
@@ -66,7 +66,7 @@ namespace Catch {
|
||||
class AnyMatchMatcher final : public MatcherGenericBase {
|
||||
Matcher m_matcher;
|
||||
public:
|
||||
AnyMatchMatcher(Matcher matcher):
|
||||
constexpr AnyMatchMatcher(Matcher matcher):
|
||||
m_matcher(CATCH_MOVE(matcher))
|
||||
{}
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
template <typename RangeLike>
|
||||
bool match(RangeLike&& rng) const {
|
||||
constexpr bool match(RangeLike&& rng) const {
|
||||
for (auto&& elem : rng) {
|
||||
if (m_matcher.match(elem)) {
|
||||
return true;
|
||||
@@ -91,7 +91,7 @@ namespace Catch {
|
||||
std::string describe() const override;
|
||||
|
||||
template <typename RangeLike>
|
||||
bool match(RangeLike&& rng) const {
|
||||
constexpr bool match(RangeLike&& rng) const {
|
||||
for (auto&& elem : rng) {
|
||||
if (!elem) {
|
||||
return false;
|
||||
@@ -107,7 +107,7 @@ namespace Catch {
|
||||
std::string describe() const override;
|
||||
|
||||
template <typename RangeLike>
|
||||
bool match(RangeLike&& rng) const {
|
||||
constexpr bool match(RangeLike&& rng) const {
|
||||
for (auto&& elem : rng) {
|
||||
if (elem) {
|
||||
return false;
|
||||
@@ -123,7 +123,7 @@ namespace Catch {
|
||||
std::string describe() const override;
|
||||
|
||||
template <typename RangeLike>
|
||||
bool match(RangeLike&& rng) const {
|
||||
constexpr bool match(RangeLike&& rng) const {
|
||||
for (auto&& elem : rng) {
|
||||
if (elem) {
|
||||
return true;
|
||||
@@ -133,32 +133,35 @@ namespace Catch {
|
||||
}
|
||||
};
|
||||
|
||||
// Creates a matcher that checks whether all elements in a range match a matcher
|
||||
//! Creates a matcher that checks whether all elements in a range match a matcher
|
||||
template <typename Matcher>
|
||||
AllMatchMatcher<Matcher> AllMatch(Matcher&& matcher) {
|
||||
constexpr AllMatchMatcher<Matcher> AllMatch(Matcher&& matcher) {
|
||||
return { CATCH_FORWARD(matcher) };
|
||||
}
|
||||
|
||||
// Creates a matcher that checks whether no element in a range matches a matcher.
|
||||
//! Creates a matcher that checks whether no element in a range matches a matcher.
|
||||
template <typename Matcher>
|
||||
NoneMatchMatcher<Matcher> NoneMatch(Matcher&& matcher) {
|
||||
constexpr NoneMatchMatcher<Matcher> NoneMatch(Matcher&& matcher) {
|
||||
return { CATCH_FORWARD(matcher) };
|
||||
}
|
||||
|
||||
// Creates a matcher that checks whether any element in a range matches a matcher.
|
||||
//! Creates a matcher that checks whether any element in a range matches a matcher.
|
||||
template <typename Matcher>
|
||||
AnyMatchMatcher<Matcher> AnyMatch(Matcher&& matcher) {
|
||||
constexpr AnyMatchMatcher<Matcher> AnyMatch(Matcher&& matcher) {
|
||||
return { CATCH_FORWARD(matcher) };
|
||||
}
|
||||
|
||||
// Creates a matcher that checks whether all elements in a range are true
|
||||
AllTrueMatcher AllTrue();
|
||||
//! Creates a matcher that checks whether all elements in a range are true
|
||||
inline CATCH_DESTRUCTOR_CONSTEXPR
|
||||
AllTrueMatcher AllTrue() { return AllTrueMatcher{}; }
|
||||
|
||||
// Creates a matcher that checks whether no element in a range is true
|
||||
NoneTrueMatcher NoneTrue();
|
||||
//! Creates a matcher that checks whether no element in a range is true
|
||||
inline CATCH_DESTRUCTOR_CONSTEXPR
|
||||
NoneTrueMatcher NoneTrue() { return NoneTrueMatcher{}; }
|
||||
|
||||
// Creates a matcher that checks whether any element in a range is true
|
||||
AnyTrueMatcher AnyTrue();
|
||||
//! Creates a matcher that checks whether any element in a range is true
|
||||
inline CATCH_DESTRUCTOR_CONSTEXPR
|
||||
AnyTrueMatcher AnyTrue() { return AnyTrueMatcher{}; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,11 @@
|
||||
|
||||
namespace Catch {
|
||||
namespace Matchers {
|
||||
MatcherGenericBase::~MatcherGenericBase() = default;
|
||||
|
||||
std::string MatcherGenericBase::describe() const {
|
||||
using namespace std::string_literals;
|
||||
return "Undescribed generic matcher"s;
|
||||
}
|
||||
|
||||
namespace Detail {
|
||||
|
||||
|
||||
@@ -22,12 +22,12 @@
|
||||
namespace Catch {
|
||||
namespace Matchers {
|
||||
class MatcherGenericBase : public MatcherUntypedBase {
|
||||
std::string describe() const override;
|
||||
public:
|
||||
MatcherGenericBase() = default;
|
||||
~MatcherGenericBase() override; // = default;
|
||||
constexpr MatcherGenericBase() = default;
|
||||
|
||||
MatcherGenericBase(MatcherGenericBase const&) = default;
|
||||
MatcherGenericBase(MatcherGenericBase&&) = default;
|
||||
constexpr MatcherGenericBase(MatcherGenericBase const&) = default;
|
||||
constexpr MatcherGenericBase(MatcherGenericBase&&) = default;
|
||||
|
||||
MatcherGenericBase& operator=(MatcherGenericBase const&) = delete;
|
||||
MatcherGenericBase& operator=(MatcherGenericBase&&) = delete;
|
||||
@@ -36,7 +36,9 @@ namespace Matchers {
|
||||
|
||||
namespace Detail {
|
||||
template<std::size_t N, std::size_t M>
|
||||
std::array<void const*, N + M> array_cat(std::array<void const*, N> && lhs, std::array<void const*, M> && rhs) {
|
||||
constexpr std::array<void const*, N + M>
|
||||
array_cat( std::array<void const*, N>&& lhs,
|
||||
std::array<void const*, M>&& rhs ) {
|
||||
std::array<void const*, N + M> arr{};
|
||||
std::copy_n(lhs.begin(), N, arr.begin());
|
||||
std::copy_n(rhs.begin(), M, arr.begin() + N);
|
||||
@@ -44,7 +46,8 @@ namespace Matchers {
|
||||
}
|
||||
|
||||
template<std::size_t N>
|
||||
std::array<void const*, N+1> array_cat(std::array<void const*, N> && lhs, void const* rhs) {
|
||||
constexpr std::array<void const*, N + 1>
|
||||
array_cat( std::array<void const*, N>&& lhs, void const* rhs ) {
|
||||
std::array<void const*, N+1> arr{};
|
||||
std::copy_n(lhs.begin(), N, arr.begin());
|
||||
arr[N] = rhs;
|
||||
@@ -52,7 +55,8 @@ namespace Matchers {
|
||||
}
|
||||
|
||||
template<std::size_t N>
|
||||
std::array<void const*, N+1> array_cat(void const* lhs, std::array<void const*, N> && rhs) {
|
||||
constexpr std::array<void const*, N + 1>
|
||||
array_cat( void const* lhs, std::array<void const*, N>&& rhs ) {
|
||||
std::array<void const*, N + 1> arr{ {lhs} };
|
||||
std::copy_n(rhs.begin(), N, arr.begin() + 1);
|
||||
return arr;
|
||||
@@ -75,23 +79,31 @@ namespace Matchers {
|
||||
|
||||
|
||||
template<std::size_t N, typename Arg>
|
||||
bool match_all_of(Arg&&, std::array<void const*, N> const&, std::index_sequence<>) {
|
||||
constexpr bool match_all_of( Arg&&,
|
||||
std::array<void const*, N> const&,
|
||||
std::index_sequence<> ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
template<typename T, typename... MatcherTs, std::size_t N, typename Arg, std::size_t Idx, std::size_t... Indices>
|
||||
bool match_all_of(Arg&& arg, std::array<void const*, N> const& matchers, std::index_sequence<Idx, Indices...>) {
|
||||
constexpr bool match_all_of( Arg&& arg,
|
||||
std::array<void const*, N> const& matchers,
|
||||
std::index_sequence<Idx, Indices...> ) {
|
||||
return static_cast<T const*>(matchers[Idx])->match(arg) && match_all_of<MatcherTs...>(arg, matchers, std::index_sequence<Indices...>{});
|
||||
}
|
||||
|
||||
|
||||
template<std::size_t N, typename Arg>
|
||||
bool match_any_of(Arg&&, std::array<void const*, N> const&, std::index_sequence<>) {
|
||||
constexpr bool match_any_of( Arg&&,
|
||||
std::array<void const*, N> const&,
|
||||
std::index_sequence<> ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
template<typename T, typename... MatcherTs, std::size_t N, typename Arg, std::size_t Idx, std::size_t... Indices>
|
||||
bool match_any_of(Arg&& arg, std::array<void const*, N> const& matchers, std::index_sequence<Idx, Indices...>) {
|
||||
constexpr bool match_any_of( Arg&& arg,
|
||||
std::array<void const*, N> const& matchers,
|
||||
std::index_sequence<Idx, Indices...> ) {
|
||||
return static_cast<T const*>(matchers[Idx])->match(arg) || match_any_of<MatcherTs...>(arg, matchers, std::index_sequence<Indices...>{});
|
||||
}
|
||||
|
||||
@@ -112,15 +124,18 @@ namespace Matchers {
|
||||
public:
|
||||
MatchAllOfGeneric(MatchAllOfGeneric const&) = delete;
|
||||
MatchAllOfGeneric& operator=(MatchAllOfGeneric const&) = delete;
|
||||
MatchAllOfGeneric(MatchAllOfGeneric&&) = default;
|
||||
MatchAllOfGeneric& operator=(MatchAllOfGeneric&&) = default;
|
||||
constexpr MatchAllOfGeneric( MatchAllOfGeneric&& ) = default;
|
||||
constexpr MatchAllOfGeneric& operator=(MatchAllOfGeneric&&) = default;
|
||||
|
||||
MatchAllOfGeneric(MatcherTs const&... matchers CATCH_ATTR_LIFETIMEBOUND)
|
||||
constexpr MatchAllOfGeneric(
|
||||
MatcherTs const&... matchers CATCH_ATTR_LIFETIMEBOUND )
|
||||
: m_matchers{ {std::addressof(matchers)...} } {}
|
||||
explicit MatchAllOfGeneric(std::array<void const*, sizeof...(MatcherTs)> matchers) : m_matchers{matchers} {}
|
||||
constexpr explicit MatchAllOfGeneric(
|
||||
std::array<void const*, sizeof...( MatcherTs )> matchers ):
|
||||
m_matchers{ matchers } {}
|
||||
|
||||
template<typename Arg>
|
||||
bool match(Arg&& arg) const {
|
||||
constexpr bool match( Arg&& arg ) const {
|
||||
return match_all_of<MatcherTs...>(arg, m_matchers, std::index_sequence_for<MatcherTs...>{});
|
||||
}
|
||||
|
||||
@@ -136,7 +151,7 @@ namespace Matchers {
|
||||
|
||||
//! Avoids type nesting for `GenericAllOf && GenericAllOf` case
|
||||
template<typename... MatchersRHS>
|
||||
friend
|
||||
constexpr friend
|
||||
MatchAllOfGeneric<MatcherTs..., MatchersRHS...> operator && (
|
||||
MatchAllOfGeneric<MatcherTs...>&& lhs CATCH_ATTR_LIFETIMEBOUND,
|
||||
MatchAllOfGeneric<MatchersRHS...>&& rhs CATCH_ATTR_LIFETIMEBOUND ) {
|
||||
@@ -145,7 +160,8 @@ namespace Matchers {
|
||||
|
||||
//! Avoids type nesting for `GenericAllOf && some matcher` case
|
||||
template<typename MatcherRHS>
|
||||
friend std::enable_if_t<is_matcher_v<MatcherRHS>,
|
||||
constexpr friend std::enable_if_t<
|
||||
is_matcher_v<MatcherRHS>,
|
||||
MatchAllOfGeneric<MatcherTs..., MatcherRHS>> operator && (
|
||||
MatchAllOfGeneric<MatcherTs...>&& lhs CATCH_ATTR_LIFETIMEBOUND,
|
||||
MatcherRHS const& rhs CATCH_ATTR_LIFETIMEBOUND ) {
|
||||
@@ -154,7 +170,8 @@ namespace Matchers {
|
||||
|
||||
//! Avoids type nesting for `some matcher && GenericAllOf` case
|
||||
template<typename MatcherLHS>
|
||||
friend std::enable_if_t<is_matcher_v<MatcherLHS>,
|
||||
constexpr friend std::enable_if_t<
|
||||
is_matcher_v<MatcherLHS>,
|
||||
MatchAllOfGeneric<MatcherLHS, MatcherTs...>> operator && (
|
||||
MatcherLHS const& lhs CATCH_ATTR_LIFETIMEBOUND,
|
||||
MatchAllOfGeneric<MatcherTs...>&& rhs CATCH_ATTR_LIFETIMEBOUND ) {
|
||||
@@ -168,15 +185,18 @@ namespace Matchers {
|
||||
public:
|
||||
MatchAnyOfGeneric(MatchAnyOfGeneric const&) = delete;
|
||||
MatchAnyOfGeneric& operator=(MatchAnyOfGeneric const&) = delete;
|
||||
MatchAnyOfGeneric(MatchAnyOfGeneric&&) = default;
|
||||
MatchAnyOfGeneric& operator=(MatchAnyOfGeneric&&) = default;
|
||||
constexpr MatchAnyOfGeneric( MatchAnyOfGeneric&& ) = default;
|
||||
constexpr MatchAnyOfGeneric& operator=(MatchAnyOfGeneric&&) = default;
|
||||
|
||||
MatchAnyOfGeneric(MatcherTs const&... matchers CATCH_ATTR_LIFETIMEBOUND)
|
||||
constexpr MatchAnyOfGeneric(
|
||||
MatcherTs const&... matchers CATCH_ATTR_LIFETIMEBOUND )
|
||||
: m_matchers{ {std::addressof(matchers)...} } {}
|
||||
explicit MatchAnyOfGeneric(std::array<void const*, sizeof...(MatcherTs)> matchers) : m_matchers{matchers} {}
|
||||
constexpr explicit MatchAnyOfGeneric(
|
||||
std::array<void const*, sizeof...( MatcherTs )> matchers ):
|
||||
m_matchers{ matchers } {}
|
||||
|
||||
template<typename Arg>
|
||||
bool match(Arg&& arg) const {
|
||||
constexpr bool match( Arg&& arg ) const {
|
||||
return match_any_of<MatcherTs...>(arg, m_matchers, std::index_sequence_for<MatcherTs...>{});
|
||||
}
|
||||
|
||||
@@ -192,7 +212,8 @@ namespace Matchers {
|
||||
|
||||
//! Avoids type nesting for `GenericAnyOf || GenericAnyOf` case
|
||||
template<typename... MatchersRHS>
|
||||
friend MatchAnyOfGeneric<MatcherTs..., MatchersRHS...> operator || (
|
||||
constexpr friend MatchAnyOfGeneric<MatcherTs..., MatchersRHS...>
|
||||
operator||(
|
||||
MatchAnyOfGeneric<MatcherTs...>&& lhs CATCH_ATTR_LIFETIMEBOUND,
|
||||
MatchAnyOfGeneric<MatchersRHS...>&& rhs CATCH_ATTR_LIFETIMEBOUND ) {
|
||||
return MatchAnyOfGeneric<MatcherTs..., MatchersRHS...>{array_cat(CATCH_MOVE(lhs.m_matchers), CATCH_MOVE(rhs.m_matchers))};
|
||||
@@ -200,7 +221,8 @@ namespace Matchers {
|
||||
|
||||
//! Avoids type nesting for `GenericAnyOf || some matcher` case
|
||||
template<typename MatcherRHS>
|
||||
friend std::enable_if_t<is_matcher_v<MatcherRHS>,
|
||||
constexpr friend std::enable_if_t<
|
||||
is_matcher_v<MatcherRHS>,
|
||||
MatchAnyOfGeneric<MatcherTs..., MatcherRHS>> operator || (
|
||||
MatchAnyOfGeneric<MatcherTs...>&& lhs CATCH_ATTR_LIFETIMEBOUND,
|
||||
MatcherRHS const& rhs CATCH_ATTR_LIFETIMEBOUND ) {
|
||||
@@ -209,7 +231,8 @@ namespace Matchers {
|
||||
|
||||
//! Avoids type nesting for `some matcher || GenericAnyOf` case
|
||||
template<typename MatcherLHS>
|
||||
friend std::enable_if_t<is_matcher_v<MatcherLHS>,
|
||||
constexpr friend std::enable_if_t<
|
||||
is_matcher_v<MatcherLHS>,
|
||||
MatchAnyOfGeneric<MatcherLHS, MatcherTs...>> operator || (
|
||||
MatcherLHS const& lhs CATCH_ATTR_LIFETIMEBOUND,
|
||||
MatchAnyOfGeneric<MatcherTs...>&& rhs CATCH_ATTR_LIFETIMEBOUND) {
|
||||
@@ -225,14 +248,15 @@ namespace Matchers {
|
||||
public:
|
||||
MatchNotOfGeneric(MatchNotOfGeneric const&) = delete;
|
||||
MatchNotOfGeneric& operator=(MatchNotOfGeneric const&) = delete;
|
||||
MatchNotOfGeneric(MatchNotOfGeneric&&) = default;
|
||||
MatchNotOfGeneric& operator=(MatchNotOfGeneric&&) = default;
|
||||
constexpr MatchNotOfGeneric( MatchNotOfGeneric&& ) = default;
|
||||
constexpr MatchNotOfGeneric& operator=(MatchNotOfGeneric&&) = default;
|
||||
|
||||
explicit MatchNotOfGeneric(MatcherT const& matcher CATCH_ATTR_LIFETIMEBOUND)
|
||||
constexpr explicit MatchNotOfGeneric(
|
||||
MatcherT const& matcher CATCH_ATTR_LIFETIMEBOUND )
|
||||
: m_matcher{matcher} {}
|
||||
|
||||
template<typename Arg>
|
||||
bool match(Arg&& arg) const {
|
||||
constexpr bool match( Arg&& arg ) const {
|
||||
return !m_matcher.match(arg);
|
||||
}
|
||||
|
||||
@@ -241,7 +265,7 @@ namespace Matchers {
|
||||
}
|
||||
|
||||
//! Negating negation can just unwrap and return underlying matcher
|
||||
friend MatcherT const&
|
||||
constexpr friend MatcherT const&
|
||||
operator!( MatchNotOfGeneric<MatcherT> const& matcher
|
||||
CATCH_ATTR_LIFETIMEBOUND ) {
|
||||
return matcher.m_matcher;
|
||||
@@ -252,14 +276,18 @@ namespace Matchers {
|
||||
|
||||
// compose only generic matchers
|
||||
template<typename MatcherLHS, typename MatcherRHS>
|
||||
std::enable_if_t<Detail::are_generic_matchers_v<MatcherLHS, MatcherRHS>, Detail::MatchAllOfGeneric<MatcherLHS, MatcherRHS>>
|
||||
constexpr std::enable_if_t<
|
||||
Detail::are_generic_matchers_v<MatcherLHS, MatcherRHS>,
|
||||
Detail::MatchAllOfGeneric<MatcherLHS, MatcherRHS>>
|
||||
operator&&( MatcherLHS const& lhs CATCH_ATTR_LIFETIMEBOUND,
|
||||
MatcherRHS const& rhs CATCH_ATTR_LIFETIMEBOUND ) {
|
||||
return { lhs, rhs };
|
||||
}
|
||||
|
||||
template<typename MatcherLHS, typename MatcherRHS>
|
||||
std::enable_if_t<Detail::are_generic_matchers_v<MatcherLHS, MatcherRHS>, Detail::MatchAnyOfGeneric<MatcherLHS, MatcherRHS>>
|
||||
constexpr std::enable_if_t<
|
||||
Detail::are_generic_matchers_v<MatcherLHS, MatcherRHS>,
|
||||
Detail::MatchAnyOfGeneric<MatcherLHS, MatcherRHS>>
|
||||
operator||( MatcherLHS const& lhs CATCH_ATTR_LIFETIMEBOUND,
|
||||
MatcherRHS const& rhs CATCH_ATTR_LIFETIMEBOUND ) {
|
||||
return { lhs, rhs };
|
||||
@@ -267,7 +295,8 @@ namespace Matchers {
|
||||
|
||||
//! Wrap provided generic matcher in generic negator
|
||||
template<typename MatcherT>
|
||||
std::enable_if_t<Detail::is_generic_matcher_v<MatcherT>, Detail::MatchNotOfGeneric<MatcherT>>
|
||||
constexpr std::enable_if_t<Detail::is_generic_matcher_v<MatcherT>,
|
||||
Detail::MatchNotOfGeneric<MatcherT>>
|
||||
operator!( MatcherT const& matcher CATCH_ATTR_LIFETIMEBOUND ) {
|
||||
return Detail::MatchNotOfGeneric<MatcherT>{matcher};
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Catch {
|
||||
#endif
|
||||
|
||||
template<typename ArgT, typename MatcherT>
|
||||
class MatchExpr : public ITransientExpression {
|
||||
class MatchExpr final : public ITransientExpression {
|
||||
ArgT && m_arg;
|
||||
MatcherT const& m_matcher;
|
||||
public:
|
||||
|
||||
@@ -65,7 +65,6 @@ internal_headers = [
|
||||
'interfaces/catch_interfaces_all.hpp',
|
||||
'interfaces/catch_interfaces_capture.hpp',
|
||||
'interfaces/catch_interfaces_config.hpp',
|
||||
'interfaces/catch_interfaces_enum_values_registry.hpp',
|
||||
'interfaces/catch_interfaces_exception.hpp',
|
||||
'interfaces/catch_interfaces_generatortracker.hpp',
|
||||
'interfaces/catch_interfaces_registry_hub.hpp',
|
||||
@@ -95,7 +94,7 @@ internal_headers = [
|
||||
'internal/catch_decomposer.hpp',
|
||||
'internal/catch_deprecation_macro.hpp',
|
||||
'internal/catch_enforce.hpp',
|
||||
'internal/catch_enum_values_registry.hpp',
|
||||
'internal/catch_enum_info.hpp',
|
||||
'internal/catch_errno_guard.hpp',
|
||||
'internal/catch_exception_translator_registry.hpp',
|
||||
'internal/catch_fatal_condition_handler.hpp',
|
||||
@@ -224,7 +223,7 @@ internal_sources = files(
|
||||
'internal/catch_debugger.cpp',
|
||||
'internal/catch_decomposer.cpp',
|
||||
'internal/catch_enforce.cpp',
|
||||
'internal/catch_enum_values_registry.cpp',
|
||||
'internal/catch_enum_info.cpp',
|
||||
'internal/catch_errno_guard.cpp',
|
||||
'internal/catch_exception_translator_registry.cpp',
|
||||
'internal/catch_fatal_condition_handler.cpp',
|
||||
|
||||
@@ -26,12 +26,12 @@ namespace Catch {
|
||||
|
||||
void ReporterBase::listReporters(
|
||||
std::vector<ReporterDescription> const& descriptions ) {
|
||||
defaultListReporters(m_stream, descriptions, m_config->verbosity());
|
||||
defaultListReporters( m_stream, descriptions, m_config->verbosity() );
|
||||
}
|
||||
|
||||
void ReporterBase::listListeners(
|
||||
std::vector<ListenerDescription> const& descriptions ) {
|
||||
defaultListListeners( m_stream, descriptions );
|
||||
defaultListListeners( m_stream, descriptions, m_config->verbosity() );
|
||||
}
|
||||
|
||||
void ReporterBase::listTests(std::vector<TestCaseHandle> const& tests) {
|
||||
@@ -43,7 +43,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
void ReporterBase::listTags(std::vector<TagInfo> const& tags) {
|
||||
defaultListTags( m_stream, tags, m_config->hasTestFilters() );
|
||||
defaultListTags( m_stream, tags, m_config->hasTestFilters(), m_config->verbosity() );
|
||||
}
|
||||
|
||||
} // namespace Catch
|
||||
|
||||
@@ -20,9 +20,8 @@ namespace Catch {
|
||||
bool operator()(
|
||||
Detail::unique_ptr<CumulativeReporterBase::SectionNode> const&
|
||||
node ) const {
|
||||
return (
|
||||
( node->stats.sectionInfo.name == m_other.name ) &&
|
||||
( node->stats.sectionInfo.lineInfo == m_other.lineInfo ) );
|
||||
return node->stats.sectionInfo.name == m_other.name
|
||||
&& node->stats.sectionInfo.lineInfo == m_other.lineInfo;
|
||||
}
|
||||
void operator=( BySectionInfo const& ) = delete;
|
||||
|
||||
|
||||
@@ -143,7 +143,15 @@ namespace Catch {
|
||||
}
|
||||
|
||||
void defaultListListeners( std::ostream& out,
|
||||
std::vector<ListenerDescription> const& descriptions ) {
|
||||
std::vector<ListenerDescription> const& descriptions,
|
||||
Verbosity verbosity ) {
|
||||
if ( verbosity == Verbosity::Quiet ) {
|
||||
for ( auto const& desc : descriptions ) {
|
||||
out << desc.name << '\n';
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
out << "Registered listeners:\n";
|
||||
|
||||
if(descriptions.empty()) {
|
||||
@@ -176,7 +184,14 @@ namespace Catch {
|
||||
|
||||
void defaultListTags( std::ostream& out,
|
||||
std::vector<TagInfo> const& tags,
|
||||
bool isFiltered ) {
|
||||
bool isFiltered,
|
||||
Verbosity verbosity ) {
|
||||
if (verbosity == Verbosity::Quiet) {
|
||||
for (auto const& tagCount : tags) {
|
||||
out << tagCount.all() << '\n';
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ( isFiltered ) {
|
||||
out << "Tags for matching test cases:\n";
|
||||
} else {
|
||||
@@ -184,7 +199,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
// minimum whitespace to pad tag counts, possibly overwritten below
|
||||
size_t maxTagCountLen = 2;
|
||||
int maxTagCountLen = 2;
|
||||
|
||||
// determine necessary padding for tag count column
|
||||
if ( ! tags.empty() ) {
|
||||
@@ -195,11 +210,11 @@ namespace Catch {
|
||||
return lhs.count < rhs.count;
|
||||
} )
|
||||
->count;
|
||||
|
||||
|
||||
// more padding necessary for 3+ digits
|
||||
if (maxTagCount >= 100) {
|
||||
auto numDigits = 1 + std::floor( std::log10( maxTagCount ) );
|
||||
maxTagCountLen = static_cast<size_t>( numDigits );
|
||||
maxTagCountLen = static_cast<int>( numDigits );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,8 @@ namespace Catch {
|
||||
* format
|
||||
*/
|
||||
void defaultListListeners( std::ostream& out,
|
||||
std::vector<ListenerDescription> const& descriptions );
|
||||
std::vector<ListenerDescription> const& descriptions,
|
||||
Verbosity verbosity );
|
||||
|
||||
/**
|
||||
* Lists tag information to the provided stream in user-friendly format
|
||||
@@ -64,7 +65,10 @@ namespace Catch {
|
||||
* bases. The output should be backwards compatible with the output of
|
||||
* Catch2 v2 binaries.
|
||||
*/
|
||||
void defaultListTags( std::ostream& out, std::vector<TagInfo> const& tags, bool isFiltered );
|
||||
void defaultListTags( std::ostream& out,
|
||||
std::vector<TagInfo> const& tags,
|
||||
bool isFiltered,
|
||||
Verbosity verbosity );
|
||||
|
||||
/**
|
||||
* Lists test case information to the provided stream in user-friendly
|
||||
|
||||
@@ -241,70 +241,77 @@ namespace Catch {
|
||||
void JunitReporter::writeAssertions( SectionNode const& sectionNode ) {
|
||||
for (auto const& assertionOrBenchmark : sectionNode.assertionsAndBenchmarks) {
|
||||
if (assertionOrBenchmark.isAssertion()) {
|
||||
writeAssertion(assertionOrBenchmark.asAssertion());
|
||||
// JUnit XML format supports only 1 error/failure/skip
|
||||
// assertion elements per test case
|
||||
if (writeAssertion(assertionOrBenchmark.asAssertion())) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void JunitReporter::writeAssertion( AssertionStats const& stats ) {
|
||||
bool JunitReporter::writeAssertion( AssertionStats const& stats ) {
|
||||
AssertionResult const& result = stats.assertionResult;
|
||||
if ( !result.isOk() ||
|
||||
result.getResultType() == ResultWas::ExplicitSkip ) {
|
||||
std::string elementName;
|
||||
switch( result.getResultType() ) {
|
||||
case ResultWas::ThrewException:
|
||||
case ResultWas::FatalErrorCondition:
|
||||
elementName = "error";
|
||||
break;
|
||||
case ResultWas::ExplicitFailure:
|
||||
case ResultWas::ExpressionFailed:
|
||||
case ResultWas::DidntThrowException:
|
||||
elementName = "failure";
|
||||
break;
|
||||
case ResultWas::ExplicitSkip:
|
||||
elementName = "skipped";
|
||||
break;
|
||||
// We should never see these here:
|
||||
case ResultWas::Info:
|
||||
case ResultWas::Warning:
|
||||
case ResultWas::Ok:
|
||||
case ResultWas::Unknown:
|
||||
case ResultWas::FailureBit:
|
||||
case ResultWas::Exception:
|
||||
elementName = "internalError";
|
||||
break;
|
||||
}
|
||||
|
||||
XmlWriter::ScopedElement e = xml.scopedElement( elementName );
|
||||
|
||||
xml.writeAttribute( "message"_sr, result.getExpression() );
|
||||
xml.writeAttribute( "type"_sr, result.getTestMacroName() );
|
||||
|
||||
ReusableStringStream rss;
|
||||
if ( result.getResultType() == ResultWas::ExplicitSkip ) {
|
||||
rss << "SKIPPED\n";
|
||||
} else {
|
||||
rss << "FAILED" << ":\n";
|
||||
if (result.hasExpression()) {
|
||||
rss << " ";
|
||||
rss << result.getExpressionInMacro();
|
||||
rss << '\n';
|
||||
}
|
||||
if (result.hasExpandedExpression()) {
|
||||
rss << "with expansion:\n";
|
||||
rss << TextFlow::Column(result.getExpandedExpression()).indent(2) << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
if( result.hasMessage() )
|
||||
rss << result.getMessage() << '\n';
|
||||
for( auto const& msg : stats.infoMessages )
|
||||
if( msg.type == ResultWas::Info )
|
||||
rss << msg.message << '\n';
|
||||
|
||||
rss << "at " << result.getSourceInfo();
|
||||
xml.writeText( rss.str(), XmlFormatting::Newline );
|
||||
if ( result.isOk() &&
|
||||
result.getResultType() != ResultWas::ExplicitSkip ) {
|
||||
return false;
|
||||
}
|
||||
std::string elementName;
|
||||
switch ( result.getResultType() ) {
|
||||
case ResultWas::ThrewException:
|
||||
case ResultWas::FatalErrorCondition:
|
||||
elementName = "error";
|
||||
break;
|
||||
case ResultWas::ExplicitFailure:
|
||||
case ResultWas::ExpressionFailed:
|
||||
case ResultWas::DidntThrowException:
|
||||
elementName = "failure";
|
||||
break;
|
||||
case ResultWas::ExplicitSkip:
|
||||
elementName = "skipped";
|
||||
break;
|
||||
// We should never see these here:
|
||||
case ResultWas::Info:
|
||||
case ResultWas::Warning:
|
||||
case ResultWas::Ok:
|
||||
case ResultWas::Unknown:
|
||||
case ResultWas::FailureBit:
|
||||
case ResultWas::Exception:
|
||||
elementName = "internalError";
|
||||
break;
|
||||
}
|
||||
|
||||
XmlWriter::ScopedElement e = xml.scopedElement( elementName );
|
||||
|
||||
xml.writeAttribute( "message"_sr, result.getExpression() );
|
||||
xml.writeAttribute( "type"_sr, result.getTestMacroName() );
|
||||
|
||||
ReusableStringStream rss;
|
||||
if ( result.getResultType() == ResultWas::ExplicitSkip ) {
|
||||
rss << "SKIPPED\n";
|
||||
} else {
|
||||
rss << "FAILED:\n";
|
||||
if ( result.hasExpression() ) {
|
||||
rss << " ";
|
||||
rss << result.getExpressionInMacro();
|
||||
rss << '\n';
|
||||
}
|
||||
if ( result.hasExpandedExpression() ) {
|
||||
rss << "with expansion:\n";
|
||||
rss << TextFlow::Column( result.getExpandedExpression() )
|
||||
.indent( 2 )
|
||||
<< '\n';
|
||||
}
|
||||
}
|
||||
|
||||
if ( result.hasMessage() ) { rss << result.getMessage() << '\n'; }
|
||||
for ( auto const& msg : stats.infoMessages ) {
|
||||
if ( msg.type == ResultWas::Info ) { rss << msg.message << '\n'; }
|
||||
}
|
||||
|
||||
rss << "at " << result.getSourceInfo();
|
||||
xml.writeText( rss.str(), XmlFormatting::Newline );
|
||||
return true;
|
||||
}
|
||||
|
||||
} // end namespace Catch
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Catch {
|
||||
bool testOkToFail );
|
||||
|
||||
void writeAssertions(SectionNode const& sectionNode);
|
||||
void writeAssertion(AssertionStats const& stats);
|
||||
bool writeAssertion(AssertionStats const& stats);
|
||||
|
||||
XmlWriter xml;
|
||||
Timer suiteTimer;
|
||||
|
||||
@@ -62,6 +62,7 @@ cc_test(
|
||||
"SelfTest/UsageTests/Exception.tests.cpp",
|
||||
"SelfTest/UsageTests/Generators.tests.cpp",
|
||||
"SelfTest/UsageTests/Matchers.tests.cpp",
|
||||
"SelfTest/UsageTests/MatchersConstexpr.tests.cpp",
|
||||
"SelfTest/UsageTests/MatchersRanges.tests.cpp",
|
||||
"SelfTest/UsageTests/Message.tests.cpp",
|
||||
"SelfTest/UsageTests/Misc.tests.cpp",
|
||||
|
||||
@@ -124,8 +124,9 @@ set(TEST_SOURCES
|
||||
${SELF_TEST_DIR}/UsageTests/ToStringWhich.tests.cpp
|
||||
${SELF_TEST_DIR}/UsageTests/Tricky.tests.cpp
|
||||
${SELF_TEST_DIR}/UsageTests/VariadicMacros.tests.cpp
|
||||
${SELF_TEST_DIR}/UsageTests/MatchersRanges.tests.cpp
|
||||
${SELF_TEST_DIR}/UsageTests/Matchers.tests.cpp
|
||||
${SELF_TEST_DIR}/UsageTests/MatchersConstexpr.tests.cpp
|
||||
${SELF_TEST_DIR}/UsageTests/MatchersRanges.tests.cpp
|
||||
)
|
||||
|
||||
set(TEST_HEADERS
|
||||
|
||||
@@ -56,9 +56,9 @@ set(TESTS_DIR ${CATCH_DIR}/tests/ExtraTests)
|
||||
|
||||
add_executable(PrefixedMacros ${TESTS_DIR}/X01-PrefixedMacros.cpp)
|
||||
target_compile_definitions(PrefixedMacros PRIVATE CATCH_CONFIG_PREFIX_ALL CATCH_CONFIG_RUNTIME_STATIC_REQUIRE)
|
||||
# Macro configuration does not touch the compiled parts, so we can link
|
||||
# it against the main library
|
||||
target_link_libraries(PrefixedMacros Catch2WithMain)
|
||||
# We want to verify that the main library can also be built with prefixed
|
||||
# macros, regression test for #3087.
|
||||
target_link_libraries(PrefixedMacros Catch2_buildall_interface)
|
||||
|
||||
add_test(NAME CATCH_CONFIG_PREFIX_ALL COMMAND PrefixedMacros -s)
|
||||
set_tests_properties(CATCH_CONFIG_PREFIX_ALL
|
||||
@@ -174,7 +174,7 @@ target_compile_definitions(DeferredStaticChecks PRIVATE "CATCH_CONFIG_RUNTIME_ST
|
||||
add_test(NAME DeferredStaticChecks COMMAND DeferredStaticChecks -r compact)
|
||||
set_tests_properties(DeferredStaticChecks
|
||||
PROPERTIES
|
||||
PASS_REGULAR_EXPRESSION "test cases: 1 \\| 1 failed\nassertions: 3 \\| 3 failed"
|
||||
PASS_REGULAR_EXPRESSION "test cases: 1 \\| 1 failed\nassertions: 3 \\| 3 failed;test cases: 1 \\| 1 failed\nassertions: 4 \\| 4 failed"
|
||||
)
|
||||
|
||||
add_executable(MixingClearedAndUnclearedMessages ${TESTS_DIR}/X06-MixingClearedAndUnclearedMessages.cpp)
|
||||
|
||||
@@ -53,6 +53,8 @@ TEST_CASE( "Disabled Macros" ) {
|
||||
REQUIRE_THAT( 1,
|
||||
Catch::Matchers::Predicate( []( int ) { return false; } ) );
|
||||
BENCHMARK( "Disabled benchmark" ) { REQUIRE( 1 == 2 ); };
|
||||
|
||||
STATIC_REQUIRE_THAT( 1, Catch::Matchers::Predicate( []( int ) { return false; } ) );
|
||||
}
|
||||
|
||||
struct DisabledFixture {};
|
||||
|
||||
@@ -12,10 +12,36 @@
|
||||
*/
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <catch2/matchers/catch_matchers_templated.hpp>
|
||||
|
||||
#if defined( CATCH_INTERNAL_CONSTEXPR_MATCHERS_ENABLED )
|
||||
|
||||
namespace {
|
||||
struct MatchNoneMatcher final : public Catch::Matchers::MatcherGenericBase {
|
||||
public:
|
||||
template <typename Any>
|
||||
constexpr bool match( Any&& ) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string describe() const override {
|
||||
using namespace std::string_literals;
|
||||
return "Matches anything"s;
|
||||
}
|
||||
};
|
||||
|
||||
constexpr MatchNoneMatcher MatchNone() { return MatchNoneMatcher(); }
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif
|
||||
|
||||
TEST_CASE("Deferred static checks") {
|
||||
STATIC_CHECK(1 == 2);
|
||||
STATIC_CHECK_FALSE(1 != 2);
|
||||
#if defined(CATCH_INTERNAL_CONSTEXPR_MATCHERS_ENABLED)
|
||||
STATIC_CHECK_THAT(1, MatchNone());
|
||||
#endif
|
||||
// This last assertion must be executed too
|
||||
CHECK(1 == 2);
|
||||
}
|
||||
|
||||
@@ -144,6 +144,7 @@ Nor would this
|
||||
:test-result: SKIP Empty generators can SKIP in constructor
|
||||
:test-result: PASS Empty stream name opens cout stream
|
||||
:test-result: FAIL EndsWith string matcher
|
||||
:test-result: PASS Enum backed by larger underlying type
|
||||
:test-result: PASS Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM
|
||||
:test-result: PASS Enums in namespaces can quickly have stringification enabled using CATCH_REGISTER_ENUM
|
||||
:test-result: PASS Epsilon only applies to Approx's value
|
||||
|
||||
@@ -142,6 +142,7 @@
|
||||
:test-result: SKIP Empty generators can SKIP in constructor
|
||||
:test-result: PASS Empty stream name opens cout stream
|
||||
:test-result: FAIL EndsWith string matcher
|
||||
:test-result: PASS Enum backed by larger underlying type
|
||||
:test-result: PASS Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM
|
||||
:test-result: PASS Enums in namespaces can quickly have stringification enabled using CATCH_REGISTER_ENUM
|
||||
:test-result: PASS Epsilon only applies to Approx's value
|
||||
|
||||
@@ -576,15 +576,18 @@ Approx.tests.cpp:<line number>: passed: 101.000001 != Approx(100).epsilon(0.01)
|
||||
Approx.tests.cpp:<line number>: passed: std::pow(10, -5) != Approx(std::pow(10, -7)) for: 0.00001 != Approx( 0.0000001 )
|
||||
Message.tests.cpp:<line number>: passed: true with 1 message: 'a'
|
||||
Message.tests.cpp:<line number>: failed: false with 1 message: 'b'
|
||||
ToString.tests.cpp:<line number>: passed: enumInfo->lookup(0) == "Value1" for: Value1 == "Value1"
|
||||
ToString.tests.cpp:<line number>: passed: enumInfo->lookup(1) == "Value2" for: Value2 == "Value2"
|
||||
ToString.tests.cpp:<line number>: passed: enumInfo->lookup(3) == "{** unexpected enum value **}" for: {** unexpected enum value **}
|
||||
EnumToString.tests.cpp:<line number>: passed: enumInfo.lookup(0) == "Value1" for: Value1 == "Value1"
|
||||
EnumToString.tests.cpp:<line number>: passed: enumInfo.lookup(1) == "Value2" for: Value2 == "Value2"
|
||||
EnumToString.tests.cpp:<line number>: passed: enumInfo.lookup(3) == "{** unexpected enum value **}" for: {** unexpected enum value **}
|
||||
==
|
||||
"{** unexpected enum value **}"
|
||||
Skip.tests.cpp:<line number>: skipped: 'This generator is empty'
|
||||
Stream.tests.cpp:<line number>: passed: Catch::makeStream( "" )->isConsole() for: true
|
||||
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), EndsWith( "Substring" ) for: "this string contains 'abc' as a substring" ends with: "Substring"
|
||||
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), EndsWith( "this", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" ends with: "this" (case insensitive)
|
||||
EnumToString.tests.cpp:<line number>: passed: stringify( LargeEnum::Flag1 ) == "Flag1" for: "Flag1" == "Flag1"
|
||||
EnumToString.tests.cpp:<line number>: passed: stringify( LargeEnum::Flag2 ) == "Flag2" for: "Flag2" == "Flag2"
|
||||
EnumToString.tests.cpp:<line number>: passed: stringify( LargeEnum::Flag5 ) == "Flag5" for: "Flag5" == "Flag5"
|
||||
EnumToString.tests.cpp:<line number>: passed: stringify( EnumClass3::Value1 ) == "Value1" for: "Value1" == "Value1"
|
||||
EnumToString.tests.cpp:<line number>: passed: stringify( EnumClass3::Value2 ) == "Value2" for: "Value2" == "Value2"
|
||||
EnumToString.tests.cpp:<line number>: passed: stringify( EnumClass3::Value3 ) == "Value3" for: "Value3" == "Value3"
|
||||
@@ -2755,13 +2758,13 @@ Tricky.tests.cpp:<line number>: passed: ptr.get() == 0 for: 0 == 0
|
||||
ToStringPair.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( pair ) == "{ { 42, \"Arthur\" }, { \"Ford\", 24 } }" for: "{ { 42, "Arthur" }, { "Ford", 24 } }"
|
||||
==
|
||||
"{ { 42, "Arthur" }, { "Ford", 24 } }"
|
||||
ToString.tests.cpp:<line number>: passed: parseEnums( "" ), Equals( std::vector<Catch::StringRef>{} ) for: { } Equals: { }
|
||||
ToString.tests.cpp:<line number>: passed: parseEnums( "ClassName::EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) for: { Value1 } Equals: { Value1 }
|
||||
ToString.tests.cpp:<line number>: passed: parseEnums( "Value1" ), Equals( std::vector<Catch::StringRef>{"Value1"} ) for: { Value1 } Equals: { Value1 }
|
||||
ToString.tests.cpp:<line number>: passed: parseEnums( "EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) for: { Value1 } Equals: { Value1 }
|
||||
ToString.tests.cpp:<line number>: passed: parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2"} ) for: { Value1, Value2 } Equals: { Value1, Value2 }
|
||||
ToString.tests.cpp:<line number>: passed: parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2, ClassName::EnumName::Value3" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2", "Value3"} ) for: { Value1, Value2, Value3 } Equals: { Value1, Value2, Value3 }
|
||||
ToString.tests.cpp:<line number>: passed: parseEnums( "ClassName::EnumName::Value1,ClassName::EnumName::Value2 , ClassName::EnumName::Value3" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2", "Value3"} ) for: { Value1, Value2, Value3 } Equals: { Value1, Value2, Value3 }
|
||||
EnumToString.tests.cpp:<line number>: passed: parseEnums( "" ), Equals( std::vector<Catch::StringRef>{} ) for: { } Equals: { }
|
||||
EnumToString.tests.cpp:<line number>: passed: parseEnums( "ClassName::EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) for: { Value1 } Equals: { Value1 }
|
||||
EnumToString.tests.cpp:<line number>: passed: parseEnums( "Value1" ), Equals( std::vector<Catch::StringRef>{"Value1"} ) for: { Value1 } Equals: { Value1 }
|
||||
EnumToString.tests.cpp:<line number>: passed: parseEnums( "EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) for: { Value1 } Equals: { Value1 }
|
||||
EnumToString.tests.cpp:<line number>: passed: parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2"} ) for: { Value1, Value2 } Equals: { Value1, Value2 }
|
||||
EnumToString.tests.cpp:<line number>: passed: parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2, ClassName::EnumName::Value3" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2", "Value3"} ) for: { Value1, Value2, Value3 } Equals: { Value1, Value2, Value3 }
|
||||
EnumToString.tests.cpp:<line number>: passed: parseEnums( "ClassName::EnumName::Value1,ClassName::EnumName::Value2 , ClassName::EnumName::Value3" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2", "Value3"} ) for: { Value1, Value2, Value3 } Equals: { Value1, Value2, Value3 }
|
||||
Tricky.tests.cpp:<line number>: passed: p == 0 for: 0 == 0
|
||||
Message.tests.cpp:<line number>: passed: true with 1 message: 'this MAY be seen IF info is printed for passing assertions'
|
||||
Message.tests.cpp:<line number>: failed: false with 2 messages: 'this SHOULD be seen' and 'this SHOULD also be seen'
|
||||
@@ -2997,7 +3000,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: 450 | 330 passed | 96 failed | 6 skipped | 18 failed as expected
|
||||
assertions: 2413 | 2212 passed | 158 failed | 43 failed as expected
|
||||
test cases: 451 | 331 passed | 96 failed | 6 skipped | 18 failed as expected
|
||||
assertions: 2416 | 2215 passed | 158 failed | 43 failed as expected
|
||||
|
||||
|
||||
|
||||
@@ -574,15 +574,18 @@ Approx.tests.cpp:<line number>: passed: 101.000001 != Approx(100).epsilon(0.01)
|
||||
Approx.tests.cpp:<line number>: passed: std::pow(10, -5) != Approx(std::pow(10, -7)) for: 0.00001 != Approx( 0.0000001 )
|
||||
Message.tests.cpp:<line number>: passed: true with 1 message: 'a'
|
||||
Message.tests.cpp:<line number>: failed: false with 1 message: 'b'
|
||||
ToString.tests.cpp:<line number>: passed: enumInfo->lookup(0) == "Value1" for: Value1 == "Value1"
|
||||
ToString.tests.cpp:<line number>: passed: enumInfo->lookup(1) == "Value2" for: Value2 == "Value2"
|
||||
ToString.tests.cpp:<line number>: passed: enumInfo->lookup(3) == "{** unexpected enum value **}" for: {** unexpected enum value **}
|
||||
EnumToString.tests.cpp:<line number>: passed: enumInfo.lookup(0) == "Value1" for: Value1 == "Value1"
|
||||
EnumToString.tests.cpp:<line number>: passed: enumInfo.lookup(1) == "Value2" for: Value2 == "Value2"
|
||||
EnumToString.tests.cpp:<line number>: passed: enumInfo.lookup(3) == "{** unexpected enum value **}" for: {** unexpected enum value **}
|
||||
==
|
||||
"{** unexpected enum value **}"
|
||||
Skip.tests.cpp:<line number>: skipped: 'This generator is empty'
|
||||
Stream.tests.cpp:<line number>: passed: Catch::makeStream( "" )->isConsole() for: true
|
||||
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), EndsWith( "Substring" ) for: "this string contains 'abc' as a substring" ends with: "Substring"
|
||||
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), EndsWith( "this", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" ends with: "this" (case insensitive)
|
||||
EnumToString.tests.cpp:<line number>: passed: stringify( LargeEnum::Flag1 ) == "Flag1" for: "Flag1" == "Flag1"
|
||||
EnumToString.tests.cpp:<line number>: passed: stringify( LargeEnum::Flag2 ) == "Flag2" for: "Flag2" == "Flag2"
|
||||
EnumToString.tests.cpp:<line number>: passed: stringify( LargeEnum::Flag5 ) == "Flag5" for: "Flag5" == "Flag5"
|
||||
EnumToString.tests.cpp:<line number>: passed: stringify( EnumClass3::Value1 ) == "Value1" for: "Value1" == "Value1"
|
||||
EnumToString.tests.cpp:<line number>: passed: stringify( EnumClass3::Value2 ) == "Value2" for: "Value2" == "Value2"
|
||||
EnumToString.tests.cpp:<line number>: passed: stringify( EnumClass3::Value3 ) == "Value3" for: "Value3" == "Value3"
|
||||
@@ -2744,13 +2747,13 @@ Tricky.tests.cpp:<line number>: passed: ptr.get() == 0 for: 0 == 0
|
||||
ToStringPair.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( pair ) == "{ { 42, \"Arthur\" }, { \"Ford\", 24 } }" for: "{ { 42, "Arthur" }, { "Ford", 24 } }"
|
||||
==
|
||||
"{ { 42, "Arthur" }, { "Ford", 24 } }"
|
||||
ToString.tests.cpp:<line number>: passed: parseEnums( "" ), Equals( std::vector<Catch::StringRef>{} ) for: { } Equals: { }
|
||||
ToString.tests.cpp:<line number>: passed: parseEnums( "ClassName::EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) for: { Value1 } Equals: { Value1 }
|
||||
ToString.tests.cpp:<line number>: passed: parseEnums( "Value1" ), Equals( std::vector<Catch::StringRef>{"Value1"} ) for: { Value1 } Equals: { Value1 }
|
||||
ToString.tests.cpp:<line number>: passed: parseEnums( "EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) for: { Value1 } Equals: { Value1 }
|
||||
ToString.tests.cpp:<line number>: passed: parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2"} ) for: { Value1, Value2 } Equals: { Value1, Value2 }
|
||||
ToString.tests.cpp:<line number>: passed: parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2, ClassName::EnumName::Value3" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2", "Value3"} ) for: { Value1, Value2, Value3 } Equals: { Value1, Value2, Value3 }
|
||||
ToString.tests.cpp:<line number>: passed: parseEnums( "ClassName::EnumName::Value1,ClassName::EnumName::Value2 , ClassName::EnumName::Value3" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2", "Value3"} ) for: { Value1, Value2, Value3 } Equals: { Value1, Value2, Value3 }
|
||||
EnumToString.tests.cpp:<line number>: passed: parseEnums( "" ), Equals( std::vector<Catch::StringRef>{} ) for: { } Equals: { }
|
||||
EnumToString.tests.cpp:<line number>: passed: parseEnums( "ClassName::EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) for: { Value1 } Equals: { Value1 }
|
||||
EnumToString.tests.cpp:<line number>: passed: parseEnums( "Value1" ), Equals( std::vector<Catch::StringRef>{"Value1"} ) for: { Value1 } Equals: { Value1 }
|
||||
EnumToString.tests.cpp:<line number>: passed: parseEnums( "EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) for: { Value1 } Equals: { Value1 }
|
||||
EnumToString.tests.cpp:<line number>: passed: parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2"} ) for: { Value1, Value2 } Equals: { Value1, Value2 }
|
||||
EnumToString.tests.cpp:<line number>: passed: parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2, ClassName::EnumName::Value3" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2", "Value3"} ) for: { Value1, Value2, Value3 } Equals: { Value1, Value2, Value3 }
|
||||
EnumToString.tests.cpp:<line number>: passed: parseEnums( "ClassName::EnumName::Value1,ClassName::EnumName::Value2 , ClassName::EnumName::Value3" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2", "Value3"} ) for: { Value1, Value2, Value3 } Equals: { Value1, Value2, Value3 }
|
||||
Tricky.tests.cpp:<line number>: passed: p == 0 for: 0 == 0
|
||||
Message.tests.cpp:<line number>: passed: true with 1 message: 'this MAY be seen IF info is printed for passing assertions'
|
||||
Message.tests.cpp:<line number>: failed: false with 2 messages: 'this SHOULD be seen' and 'this SHOULD also be seen'
|
||||
@@ -2986,7 +2989,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: 450 | 330 passed | 96 failed | 6 skipped | 18 failed as expected
|
||||
assertions: 2413 | 2212 passed | 158 failed | 43 failed as expected
|
||||
test cases: 451 | 331 passed | 96 failed | 6 skipped | 18 failed as expected
|
||||
assertions: 2416 | 2215 passed | 158 failed | 43 failed as expected
|
||||
|
||||
|
||||
|
||||
@@ -1743,6 +1743,6 @@ due to unexpected exception with message:
|
||||
Why would you throw a std::string?
|
||||
|
||||
===============================================================================
|
||||
test cases: 450 | 348 passed | 76 failed | 7 skipped | 19 failed as expected
|
||||
assertions: 2391 | 2212 passed | 136 failed | 43 failed as expected
|
||||
test cases: 451 | 349 passed | 76 failed | 7 skipped | 19 failed as expected
|
||||
assertions: 2394 | 2215 passed | 136 failed | 43 failed as expected
|
||||
|
||||
|
||||
@@ -4241,21 +4241,21 @@ with message:
|
||||
-------------------------------------------------------------------------------
|
||||
Directly creating an EnumInfo
|
||||
-------------------------------------------------------------------------------
|
||||
ToString.tests.cpp:<line number>
|
||||
EnumToString.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
ToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK( enumInfo->lookup(0) == "Value1" )
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK( enumInfo.lookup(0) == "Value1" )
|
||||
with expansion:
|
||||
Value1 == "Value1"
|
||||
|
||||
ToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK( enumInfo->lookup(1) == "Value2" )
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK( enumInfo.lookup(1) == "Value2" )
|
||||
with expansion:
|
||||
Value2 == "Value2"
|
||||
|
||||
ToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK( enumInfo->lookup(3) == "{** unexpected enum value **}" )
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK( enumInfo.lookup(3) == "{** unexpected enum value **}" )
|
||||
with expansion:
|
||||
{** unexpected enum value **}
|
||||
==
|
||||
@@ -4299,6 +4299,27 @@ with expansion:
|
||||
"this string contains 'abc' as a substring" ends with: "this" (case
|
||||
insensitive)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Enum backed by larger underlying type
|
||||
-------------------------------------------------------------------------------
|
||||
EnumToString.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( stringify( LargeEnum::Flag1 ) == "Flag1" )
|
||||
with expansion:
|
||||
"Flag1" == "Flag1"
|
||||
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( stringify( LargeEnum::Flag2 ) == "Flag2" )
|
||||
with expansion:
|
||||
"Flag2" == "Flag2"
|
||||
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( stringify( LargeEnum::Flag5 ) == "Flag5" )
|
||||
with expansion:
|
||||
"Flag5" == "Flag5"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -18383,10 +18404,10 @@ with expansion:
|
||||
parseEnums
|
||||
No enums
|
||||
-------------------------------------------------------------------------------
|
||||
ToString.tests.cpp:<line number>
|
||||
EnumToString.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
ToString.tests.cpp:<line number>: PASSED:
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( parseEnums( "" ), Equals( std::vector<Catch::StringRef>{} ) )
|
||||
with expansion:
|
||||
{ } Equals: { }
|
||||
@@ -18395,20 +18416,20 @@ with expansion:
|
||||
parseEnums
|
||||
One enum value
|
||||
-------------------------------------------------------------------------------
|
||||
ToString.tests.cpp:<line number>
|
||||
EnumToString.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
ToString.tests.cpp:<line number>: PASSED:
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( parseEnums( "ClassName::EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) )
|
||||
with expansion:
|
||||
{ Value1 } Equals: { Value1 }
|
||||
|
||||
ToString.tests.cpp:<line number>: PASSED:
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( parseEnums( "Value1" ), Equals( std::vector<Catch::StringRef>{"Value1"} ) )
|
||||
with expansion:
|
||||
{ Value1 } Equals: { Value1 }
|
||||
|
||||
ToString.tests.cpp:<line number>: PASSED:
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( parseEnums( "EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) )
|
||||
with expansion:
|
||||
{ Value1 } Equals: { Value1 }
|
||||
@@ -18417,20 +18438,20 @@ with expansion:
|
||||
parseEnums
|
||||
Multiple enum values
|
||||
-------------------------------------------------------------------------------
|
||||
ToString.tests.cpp:<line number>
|
||||
EnumToString.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
ToString.tests.cpp:<line number>: PASSED:
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2"} ) )
|
||||
with expansion:
|
||||
{ Value1, Value2 } Equals: { Value1, Value2 }
|
||||
|
||||
ToString.tests.cpp:<line number>: PASSED:
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2, ClassName::EnumName::Value3" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2", "Value3"} ) )
|
||||
with expansion:
|
||||
{ Value1, Value2, Value3 } Equals: { Value1, Value2, Value3 }
|
||||
|
||||
ToString.tests.cpp:<line number>: PASSED:
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( parseEnums( "ClassName::EnumName::Value1,ClassName::EnumName::Value2 , ClassName::EnumName::Value3" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2", "Value3"} ) )
|
||||
with expansion:
|
||||
{ Value1, Value2, Value3 } Equals: { Value1, Value2, Value3 }
|
||||
@@ -20113,6 +20134,6 @@ Misc.tests.cpp:<line number>
|
||||
Misc.tests.cpp:<line number>: PASSED:
|
||||
|
||||
===============================================================================
|
||||
test cases: 450 | 330 passed | 96 failed | 6 skipped | 18 failed as expected
|
||||
assertions: 2413 | 2212 passed | 158 failed | 43 failed as expected
|
||||
test cases: 451 | 331 passed | 96 failed | 6 skipped | 18 failed as expected
|
||||
assertions: 2416 | 2215 passed | 158 failed | 43 failed as expected
|
||||
|
||||
|
||||
@@ -4239,21 +4239,21 @@ with message:
|
||||
-------------------------------------------------------------------------------
|
||||
Directly creating an EnumInfo
|
||||
-------------------------------------------------------------------------------
|
||||
ToString.tests.cpp:<line number>
|
||||
EnumToString.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
ToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK( enumInfo->lookup(0) == "Value1" )
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK( enumInfo.lookup(0) == "Value1" )
|
||||
with expansion:
|
||||
Value1 == "Value1"
|
||||
|
||||
ToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK( enumInfo->lookup(1) == "Value2" )
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK( enumInfo.lookup(1) == "Value2" )
|
||||
with expansion:
|
||||
Value2 == "Value2"
|
||||
|
||||
ToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK( enumInfo->lookup(3) == "{** unexpected enum value **}" )
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK( enumInfo.lookup(3) == "{** unexpected enum value **}" )
|
||||
with expansion:
|
||||
{** unexpected enum value **}
|
||||
==
|
||||
@@ -4297,6 +4297,27 @@ with expansion:
|
||||
"this string contains 'abc' as a substring" ends with: "this" (case
|
||||
insensitive)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Enum backed by larger underlying type
|
||||
-------------------------------------------------------------------------------
|
||||
EnumToString.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( stringify( LargeEnum::Flag1 ) == "Flag1" )
|
||||
with expansion:
|
||||
"Flag1" == "Flag1"
|
||||
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( stringify( LargeEnum::Flag2 ) == "Flag2" )
|
||||
with expansion:
|
||||
"Flag2" == "Flag2"
|
||||
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( stringify( LargeEnum::Flag5 ) == "Flag5" )
|
||||
with expansion:
|
||||
"Flag5" == "Flag5"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -18372,10 +18393,10 @@ with expansion:
|
||||
parseEnums
|
||||
No enums
|
||||
-------------------------------------------------------------------------------
|
||||
ToString.tests.cpp:<line number>
|
||||
EnumToString.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
ToString.tests.cpp:<line number>: PASSED:
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( parseEnums( "" ), Equals( std::vector<Catch::StringRef>{} ) )
|
||||
with expansion:
|
||||
{ } Equals: { }
|
||||
@@ -18384,20 +18405,20 @@ with expansion:
|
||||
parseEnums
|
||||
One enum value
|
||||
-------------------------------------------------------------------------------
|
||||
ToString.tests.cpp:<line number>
|
||||
EnumToString.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
ToString.tests.cpp:<line number>: PASSED:
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( parseEnums( "ClassName::EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) )
|
||||
with expansion:
|
||||
{ Value1 } Equals: { Value1 }
|
||||
|
||||
ToString.tests.cpp:<line number>: PASSED:
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( parseEnums( "Value1" ), Equals( std::vector<Catch::StringRef>{"Value1"} ) )
|
||||
with expansion:
|
||||
{ Value1 } Equals: { Value1 }
|
||||
|
||||
ToString.tests.cpp:<line number>: PASSED:
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( parseEnums( "EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) )
|
||||
with expansion:
|
||||
{ Value1 } Equals: { Value1 }
|
||||
@@ -18406,20 +18427,20 @@ with expansion:
|
||||
parseEnums
|
||||
Multiple enum values
|
||||
-------------------------------------------------------------------------------
|
||||
ToString.tests.cpp:<line number>
|
||||
EnumToString.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
ToString.tests.cpp:<line number>: PASSED:
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2"} ) )
|
||||
with expansion:
|
||||
{ Value1, Value2 } Equals: { Value1, Value2 }
|
||||
|
||||
ToString.tests.cpp:<line number>: PASSED:
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2, ClassName::EnumName::Value3" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2", "Value3"} ) )
|
||||
with expansion:
|
||||
{ Value1, Value2, Value3 } Equals: { Value1, Value2, Value3 }
|
||||
|
||||
ToString.tests.cpp:<line number>: PASSED:
|
||||
EnumToString.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( parseEnums( "ClassName::EnumName::Value1,ClassName::EnumName::Value2 , ClassName::EnumName::Value3" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2", "Value3"} ) )
|
||||
with expansion:
|
||||
{ Value1, Value2, Value3 } Equals: { Value1, Value2, Value3 }
|
||||
@@ -20102,6 +20123,6 @@ Misc.tests.cpp:<line number>
|
||||
Misc.tests.cpp:<line number>: PASSED:
|
||||
|
||||
===============================================================================
|
||||
test cases: 450 | 330 passed | 96 failed | 6 skipped | 18 failed as expected
|
||||
assertions: 2413 | 2212 passed | 158 failed | 43 failed as expected
|
||||
test cases: 451 | 331 passed | 96 failed | 6 skipped | 18 failed as expected
|
||||
assertions: 2416 | 2215 passed | 158 failed | 43 failed as expected
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuitesloose text artifact
|
||||
>
|
||||
<testsuite name="<exe-name>" errors="17" failures="141" skipped="12" tests="2425" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
|
||||
<testsuite name="<exe-name>" errors="17" failures="141" skipped="12" tests="2428" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
|
||||
<properties>
|
||||
<property name="random-seed" value="1"/>
|
||||
<property name="filters" value=""*" ~[!nonportable] ~[!benchmark] ~[approvals]"/>
|
||||
@@ -105,51 +105,6 @@ at Misc.tests.cpp:<line number>
|
||||
<failure message="false != false" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( false != false )
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="true != true" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( true != true )
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="!true" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( !true )
|
||||
with expansion:
|
||||
false
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="!(true)" type="CHECK_FALSE">
|
||||
FAILED:
|
||||
CHECK_FALSE( true )
|
||||
with expansion:
|
||||
!true
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="!trueValue" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( !trueValue )
|
||||
with expansion:
|
||||
false
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="!(trueValue)" type="CHECK_FALSE">
|
||||
FAILED:
|
||||
CHECK_FALSE( trueValue )
|
||||
with expansion:
|
||||
!true
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="!(1 == 1)" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( !(1 == 1) )
|
||||
with expansion:
|
||||
false
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="!(1 == 1)" type="CHECK_FALSE">
|
||||
FAILED:
|
||||
CHECK_FALSE( 1 == 1 )
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -358,13 +313,6 @@ FAILED:
|
||||
CHECK( &o1 == &o2 )
|
||||
with expansion:
|
||||
0x<hex digits> == 0x<hex digits>
|
||||
at Tricky.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="o1 == o2" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( o1 == o2 )
|
||||
with expansion:
|
||||
{?} == {?}
|
||||
at Tricky.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -400,12 +348,6 @@ 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"/>
|
||||
@@ -416,12 +358,6 @@ 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"/>
|
||||
@@ -511,13 +447,6 @@ FAILED:
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" contains: "not there" (case
|
||||
insensitive)
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="testStringForMatching(), ContainsSubstring( "STRING" )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( testStringForMatching(), ContainsSubstring( "STRING" ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" contains: "STRING"
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -574,17 +503,10 @@ FAILED:
|
||||
CHECK_THAT( testStringForMatching(), EndsWith( "Substring" ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" ends with: "Substring"
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="testStringForMatching(), EndsWith( "this", Catch::CaseSensitive::No )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( testStringForMatching(), EndsWith( "this", Catch::CaseSensitive::No ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" ends with: "this" (case
|
||||
insensitive)
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase classname="<exe-name>.global" name="Enum backed by larger underlying type" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Enums in namespaces can quickly have stringification enabled using CATCH_REGISTER_ENUM" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Epsilon only applies to Approx's value" time="{duration}" status="run"/>
|
||||
@@ -595,96 +517,6 @@ FAILED:
|
||||
CHECK( data.int_seven == 6 )
|
||||
with expansion:
|
||||
7 == 6
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.int_seven == 8" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.int_seven == 8 )
|
||||
with expansion:
|
||||
7 == 8
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.int_seven == 0" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.int_seven == 0 )
|
||||
with expansion:
|
||||
7 == 0
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.float_nine_point_one == Approx( 9.11f )" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.float_nine_point_one == Approx( 9.11f ) )
|
||||
with expansion:
|
||||
9.100000381f
|
||||
==
|
||||
Approx( 9.10999965667724609 )
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.float_nine_point_one == Approx( 9.0f )" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.float_nine_point_one == Approx( 9.0f ) )
|
||||
with expansion:
|
||||
9.100000381f == Approx( 9.0 )
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.float_nine_point_one == Approx( 1 )" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.float_nine_point_one == Approx( 1 ) )
|
||||
with expansion:
|
||||
9.100000381f == Approx( 1.0 )
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.float_nine_point_one == Approx( 0 )" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.float_nine_point_one == Approx( 0 ) )
|
||||
with expansion:
|
||||
9.100000381f == Approx( 0.0 )
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.double_pi == Approx( 3.1415 )" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.double_pi == Approx( 3.1415 ) )
|
||||
with expansion:
|
||||
3.14159265350000005
|
||||
==
|
||||
Approx( 3.14150000000000018 )
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello == "goodbye"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello == "goodbye" )
|
||||
with expansion:
|
||||
"hello" == "goodbye"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello == "hell"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello == "hell" )
|
||||
with expansion:
|
||||
"hello" == "hell"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello == "hello1"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello == "hello1" )
|
||||
with expansion:
|
||||
"hello" == "hello1"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello.size() == 6" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello.size() == 6 )
|
||||
with expansion:
|
||||
5 == 6
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="x == Approx( 1.301 )" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( x == Approx( 1.301 ) )
|
||||
with expansion:
|
||||
1.30000000000000027
|
||||
==
|
||||
Approx( 1.30099999999999993 )
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -697,14 +529,6 @@ FAILED:
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" equals: "this string contains
|
||||
'ABC' as a substring"
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="testStringForMatching(), Equals( "something else", Catch::CaseSensitive::No )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( testStringForMatching(), Equals( "something else", Catch::CaseSensitive::No ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" equals: "something else" (case
|
||||
insensitive)
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -713,11 +537,6 @@ at Matchers.tests.cpp:<line number>
|
||||
<failure message="doesNotThrow(), SpecialException, ExceptionMatcher{ 1 }" type="CHECK_THROWS_MATCHES">
|
||||
FAILED:
|
||||
CHECK_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } )
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="doesNotThrow(), SpecialException, ExceptionMatcher{ 1 }" type="REQUIRE_THROWS_MATCHES">
|
||||
FAILED:
|
||||
REQUIRE_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } )
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -726,12 +545,6 @@ at Matchers.tests.cpp:<line number>
|
||||
FAILED:
|
||||
CHECK_THROWS_MATCHES( throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } )
|
||||
Unknown exception
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</error>
|
||||
<error message="throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 }" type="REQUIRE_THROWS_MATCHES">
|
||||
FAILED:
|
||||
REQUIRE_THROWS_MATCHES( throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } )
|
||||
Unknown exception
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</error>
|
||||
</testcase>
|
||||
@@ -741,13 +554,6 @@ FAILED:
|
||||
CHECK_THROWS_MATCHES( throwsSpecialException( 3 ), SpecialException, ExceptionMatcher{ 1 } )
|
||||
with expansion:
|
||||
SpecialException::what special exception has value of 1
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="throwsSpecialException( 4 ), SpecialException, ExceptionMatcher{ 1 }" type="REQUIRE_THROWS_MATCHES">
|
||||
FAILED:
|
||||
REQUIRE_THROWS_MATCHES( throwsSpecialException( 4 ), SpecialException, ExceptionMatcher{ 1 } )
|
||||
with expansion:
|
||||
SpecialException::what special exception has value of 1
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -764,17 +570,6 @@ at Matchers.tests.cpp:<line number>
|
||||
FAILED:
|
||||
CHECK_THROWS_AS( thisThrows(), std::string )
|
||||
expected exception
|
||||
at Exception.tests.cpp:<line number>
|
||||
</error>
|
||||
<failure message="thisDoesntThrow(), std::domain_error" type="CHECK_THROWS_AS">
|
||||
FAILED:
|
||||
CHECK_THROWS_AS( thisDoesntThrow(), std::domain_error )
|
||||
at Exception.tests.cpp:<line number>
|
||||
</failure>
|
||||
<error message="thisThrows()" type="CHECK_NOTHROW">
|
||||
FAILED:
|
||||
CHECK_NOTHROW( thisThrows() )
|
||||
expected exception
|
||||
at Exception.tests.cpp:<line number>
|
||||
</error>
|
||||
</testcase>
|
||||
@@ -792,12 +587,6 @@ 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">
|
||||
@@ -931,16 +720,6 @@ with expansion:
|
||||
2 == 1
|
||||
this message may be logged later
|
||||
this message should be logged
|
||||
at Message.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="a == 0" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( a == 0 )
|
||||
with expansion:
|
||||
2 == 0
|
||||
this message may be logged later
|
||||
this message should be logged
|
||||
and this, but later
|
||||
at Message.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -971,38 +750,6 @@ FAILED:
|
||||
CHECK( data.int_seven != 7 )
|
||||
with expansion:
|
||||
7 != 7
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.float_nine_point_one != Approx( 9.1f )" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.float_nine_point_one != Approx( 9.1f ) )
|
||||
with expansion:
|
||||
9.100000381f
|
||||
!=
|
||||
Approx( 9.10000038146972656 )
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.double_pi != Approx( 3.1415926535 )" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.double_pi != Approx( 3.1415926535 ) )
|
||||
with expansion:
|
||||
3.14159265350000005
|
||||
!=
|
||||
Approx( 3.14159265350000005 )
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello != "hello"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello != "hello" )
|
||||
with expansion:
|
||||
"hello" != "hello"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello.size() != 5" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello.size() != 5 )
|
||||
with expansion:
|
||||
5 != 5
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -1127,132 +874,6 @@ FAILED:
|
||||
CHECK( data.int_seven > 7 )
|
||||
with expansion:
|
||||
7 > 7
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.int_seven < 7" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.int_seven < 7 )
|
||||
with expansion:
|
||||
7 < 7
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.int_seven > 8" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.int_seven > 8 )
|
||||
with expansion:
|
||||
7 > 8
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.int_seven < 6" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.int_seven < 6 )
|
||||
with expansion:
|
||||
7 < 6
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.int_seven < 0" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.int_seven < 0 )
|
||||
with expansion:
|
||||
7 < 0
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.int_seven < -1" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.int_seven < -1 )
|
||||
with expansion:
|
||||
7 < -1
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.int_seven >= 8" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.int_seven >= 8 )
|
||||
with expansion:
|
||||
7 >= 8
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.int_seven <= 6" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.int_seven <= 6 )
|
||||
with expansion:
|
||||
7 <= 6
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.float_nine_point_one < 9" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.float_nine_point_one < 9 )
|
||||
with expansion:
|
||||
9.100000381f < 9
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.float_nine_point_one > 10" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.float_nine_point_one > 10 )
|
||||
with expansion:
|
||||
9.100000381f > 10
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.float_nine_point_one > 9.2" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.float_nine_point_one > 9.2 )
|
||||
with expansion:
|
||||
9.100000381f > 9.19999999999999929
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello > "hello"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello > "hello" )
|
||||
with expansion:
|
||||
"hello" > "hello"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello < "hello"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello < "hello" )
|
||||
with expansion:
|
||||
"hello" < "hello"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello > "hellp"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello > "hellp" )
|
||||
with expansion:
|
||||
"hello" > "hellp"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello > "z"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello > "z" )
|
||||
with expansion:
|
||||
"hello" > "z"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello < "hellm"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello < "hellm" )
|
||||
with expansion:
|
||||
"hello" < "hellm"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello < "a"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello < "a" )
|
||||
with expansion:
|
||||
"hello" < "a"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello >= "z"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello >= "z" )
|
||||
with expansion:
|
||||
"hello" >= "z"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello <= "a"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello <= "a" )
|
||||
with expansion:
|
||||
"hello" <= "a"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -1382,22 +1003,6 @@ FAILED:
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" matches "this STRING contains
|
||||
'abc' as a substring" case sensitively
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="testStringForMatching(), Matches( "contains 'abc' as a substring" )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( testStringForMatching(), Matches( "contains 'abc' as a substring" ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" matches "contains 'abc' as a
|
||||
substring" case sensitively
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="testStringForMatching(), Matches( "this string contains 'abc' as a" )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( testStringForMatching(), Matches( "this string contains 'abc' as a" ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" matches "this string contains
|
||||
'abc' as a" case sensitively
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -1462,12 +1067,6 @@ at Matchers.tests.cpp:<line number>
|
||||
FAILED:
|
||||
CHECK( false )
|
||||
This will be reported multiple times
|
||||
at Message.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="false" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( false )
|
||||
This will be reported multiple times
|
||||
at Message.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -1512,14 +1111,6 @@ FAILED:
|
||||
CHECK_THAT( testStringForMatching(), StartsWith( "This String" ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" starts with: "This String"
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="testStringForMatching(), StartsWith( "string", Catch::CaseSensitive::No )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( testStringForMatching(), StartsWith( "string", Catch::CaseSensitive::No ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" starts with: "string" (case
|
||||
insensitive)
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -1873,13 +1464,6 @@ FAILED:
|
||||
CHECK_THAT( v, VectorContains( -1 ) )
|
||||
with expansion:
|
||||
{ 1, 2, 3 } Contains: -1
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="empty, VectorContains( 1 )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( empty, VectorContains( 1 ) )
|
||||
with expansion:
|
||||
{ } Contains: 1
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -1889,13 +1473,6 @@ FAILED:
|
||||
CHECK_THAT( empty, Contains( v ) )
|
||||
with expansion:
|
||||
{ } Contains: { 1, 2, 3 }
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="v, Contains( v2 )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( v, Contains( v2 ) )
|
||||
with expansion:
|
||||
{ 1, 2, 3 } Contains: { 1, 2, 4 }
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -1905,27 +1482,6 @@ FAILED:
|
||||
CHECK_THAT( v, Equals( v2 ) )
|
||||
with expansion:
|
||||
{ 1, 2, 3 } Equals: { 1, 2 }
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="v2, Equals( v )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( v2, Equals( v ) )
|
||||
with expansion:
|
||||
{ 1, 2 } Equals: { 1, 2, 3 }
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="empty, Equals( v )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( empty, Equals( v ) )
|
||||
with expansion:
|
||||
{ } Equals: { 1, 2, 3 }
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="v, Equals( empty )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( v, Equals( empty ) )
|
||||
with expansion:
|
||||
{ 1, 2, 3 } Equals: { }
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -1935,27 +1491,6 @@ FAILED:
|
||||
CHECK_THAT( v, UnorderedEquals( empty ) )
|
||||
with expansion:
|
||||
{ 1, 2, 3 } UnorderedEquals: { }
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="empty, UnorderedEquals( v )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( empty, UnorderedEquals( v ) )
|
||||
with expansion:
|
||||
{ } UnorderedEquals: { 1, 2, 3 }
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="permuted, UnorderedEquals( v )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( permuted, UnorderedEquals( v ) )
|
||||
with expansion:
|
||||
{ 1, 3 } UnorderedEquals: { 1, 2, 3 }
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="permuted, UnorderedEquals( v )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( permuted, UnorderedEquals( v ) )
|
||||
with expansion:
|
||||
{ 3, 1 } UnorderedEquals: { 1, 2, 3 }
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -2063,11 +1598,6 @@ at Misc.tests.cpp:<line number>
|
||||
<skipped type="SKIP">
|
||||
SKIPPED
|
||||
skipping because answer = 41
|
||||
at Skip.tests.cpp:<line number>
|
||||
</skipped>
|
||||
<skipped type="SKIP">
|
||||
SKIPPED
|
||||
skipping because answer = 43
|
||||
at Skip.tests.cpp:<line number>
|
||||
</skipped>
|
||||
</testcase>
|
||||
@@ -2086,28 +1616,12 @@ FAILED:
|
||||
CHECK( 3 == 4 )
|
||||
at Skip.tests.cpp:<line number>
|
||||
</failure>
|
||||
<skipped type="SKIP">
|
||||
SKIPPED
|
||||
at Skip.tests.cpp:<line number>
|
||||
</skipped>
|
||||
</testcase>
|
||||
<testcase classname="<exe-name>.global" name="failing for some generator values causes entire test case to fail" time="{duration}" status="run">
|
||||
<failure type="FAIL">
|
||||
FAILED:
|
||||
at Skip.tests.cpp:<line number>
|
||||
</failure>
|
||||
<skipped type="SKIP">
|
||||
SKIPPED
|
||||
at Skip.tests.cpp:<line number>
|
||||
</skipped>
|
||||
<failure type="FAIL">
|
||||
FAILED:
|
||||
at Skip.tests.cpp:<line number>
|
||||
</failure>
|
||||
<skipped type="SKIP">
|
||||
SKIPPED
|
||||
at Skip.tests.cpp:<line number>
|
||||
</skipped>
|
||||
</testcase>
|
||||
<testcase classname="<exe-name>.global" name="failing in some unskipped sections causes entire test case to fail/skipped" time="{duration}" status="run">
|
||||
<skipped type="SKIP">
|
||||
@@ -2176,46 +1690,6 @@ FAILED:
|
||||
with expansion:
|
||||
1 == 0
|
||||
Testing if fib[0] (1) is even
|
||||
at Misc.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="( fib[i] % 2 ) == 0" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( ( fib[i] % 2 ) == 0 )
|
||||
with expansion:
|
||||
1 == 0
|
||||
Testing if fib[1] (1) is even
|
||||
at Misc.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="( fib[i] % 2 ) == 0" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( ( fib[i] % 2 ) == 0 )
|
||||
with expansion:
|
||||
1 == 0
|
||||
Testing if fib[3] (3) is even
|
||||
at Misc.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="( fib[i] % 2 ) == 0" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( ( fib[i] % 2 ) == 0 )
|
||||
with expansion:
|
||||
1 == 0
|
||||
Testing if fib[4] (5) is even
|
||||
at Misc.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="( fib[i] % 2 ) == 0" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( ( fib[i] % 2 ) == 0 )
|
||||
with expansion:
|
||||
1 == 0
|
||||
Testing if fib[6] (13) is even
|
||||
at Misc.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="( fib[i] % 2 ) == 0" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( ( fib[i] % 2 ) == 0 )
|
||||
with expansion:
|
||||
1 == 0
|
||||
Testing if fib[7] (21) is even
|
||||
at Misc.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -2360,15 +1834,6 @@ Count 1 to 3...
|
||||
1
|
||||
2
|
||||
3
|
||||
at Message.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="false" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( false )
|
||||
Count 4 to 6...
|
||||
4
|
||||
5
|
||||
6
|
||||
at Message.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuites>
|
||||
<testsuite name="<exe-name>" errors="17" failures="141" skipped="12" tests="2425" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
|
||||
<testsuite name="<exe-name>" errors="17" failures="141" skipped="12" tests="2428" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
|
||||
<properties>
|
||||
<property name="random-seed" value="1"/>
|
||||
<property name="filters" value=""*" ~[!nonportable] ~[!benchmark] ~[approvals]"/>
|
||||
@@ -104,51 +104,6 @@ at Misc.tests.cpp:<line number>
|
||||
<failure message="false != false" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( false != false )
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="true != true" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( true != true )
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="!true" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( !true )
|
||||
with expansion:
|
||||
false
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="!(true)" type="CHECK_FALSE">
|
||||
FAILED:
|
||||
CHECK_FALSE( true )
|
||||
with expansion:
|
||||
!true
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="!trueValue" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( !trueValue )
|
||||
with expansion:
|
||||
false
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="!(trueValue)" type="CHECK_FALSE">
|
||||
FAILED:
|
||||
CHECK_FALSE( trueValue )
|
||||
with expansion:
|
||||
!true
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="!(1 == 1)" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( !(1 == 1) )
|
||||
with expansion:
|
||||
false
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="!(1 == 1)" type="CHECK_FALSE">
|
||||
FAILED:
|
||||
CHECK_FALSE( 1 == 1 )
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -357,13 +312,6 @@ FAILED:
|
||||
CHECK( &o1 == &o2 )
|
||||
with expansion:
|
||||
0x<hex digits> == 0x<hex digits>
|
||||
at Tricky.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="o1 == o2" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( o1 == o2 )
|
||||
with expansion:
|
||||
{?} == {?}
|
||||
at Tricky.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -399,12 +347,6 @@ 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"/>
|
||||
@@ -415,12 +357,6 @@ 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"/>
|
||||
@@ -510,13 +446,6 @@ FAILED:
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" contains: "not there" (case
|
||||
insensitive)
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="testStringForMatching(), ContainsSubstring( "STRING" )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( testStringForMatching(), ContainsSubstring( "STRING" ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" contains: "STRING"
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -573,17 +502,10 @@ FAILED:
|
||||
CHECK_THAT( testStringForMatching(), EndsWith( "Substring" ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" ends with: "Substring"
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="testStringForMatching(), EndsWith( "this", Catch::CaseSensitive::No )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( testStringForMatching(), EndsWith( "this", Catch::CaseSensitive::No ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" ends with: "this" (case
|
||||
insensitive)
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase classname="<exe-name>.global" name="Enum backed by larger underlying type" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Enums in namespaces can quickly have stringification enabled using CATCH_REGISTER_ENUM" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Epsilon only applies to Approx's value" time="{duration}" status="run"/>
|
||||
@@ -594,96 +516,6 @@ FAILED:
|
||||
CHECK( data.int_seven == 6 )
|
||||
with expansion:
|
||||
7 == 6
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.int_seven == 8" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.int_seven == 8 )
|
||||
with expansion:
|
||||
7 == 8
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.int_seven == 0" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.int_seven == 0 )
|
||||
with expansion:
|
||||
7 == 0
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.float_nine_point_one == Approx( 9.11f )" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.float_nine_point_one == Approx( 9.11f ) )
|
||||
with expansion:
|
||||
9.100000381f
|
||||
==
|
||||
Approx( 9.10999965667724609 )
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.float_nine_point_one == Approx( 9.0f )" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.float_nine_point_one == Approx( 9.0f ) )
|
||||
with expansion:
|
||||
9.100000381f == Approx( 9.0 )
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.float_nine_point_one == Approx( 1 )" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.float_nine_point_one == Approx( 1 ) )
|
||||
with expansion:
|
||||
9.100000381f == Approx( 1.0 )
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.float_nine_point_one == Approx( 0 )" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.float_nine_point_one == Approx( 0 ) )
|
||||
with expansion:
|
||||
9.100000381f == Approx( 0.0 )
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.double_pi == Approx( 3.1415 )" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.double_pi == Approx( 3.1415 ) )
|
||||
with expansion:
|
||||
3.14159265350000005
|
||||
==
|
||||
Approx( 3.14150000000000018 )
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello == "goodbye"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello == "goodbye" )
|
||||
with expansion:
|
||||
"hello" == "goodbye"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello == "hell"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello == "hell" )
|
||||
with expansion:
|
||||
"hello" == "hell"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello == "hello1"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello == "hello1" )
|
||||
with expansion:
|
||||
"hello" == "hello1"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello.size() == 6" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello.size() == 6 )
|
||||
with expansion:
|
||||
5 == 6
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="x == Approx( 1.301 )" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( x == Approx( 1.301 ) )
|
||||
with expansion:
|
||||
1.30000000000000027
|
||||
==
|
||||
Approx( 1.30099999999999993 )
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -696,14 +528,6 @@ FAILED:
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" equals: "this string contains
|
||||
'ABC' as a substring"
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="testStringForMatching(), Equals( "something else", Catch::CaseSensitive::No )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( testStringForMatching(), Equals( "something else", Catch::CaseSensitive::No ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" equals: "something else" (case
|
||||
insensitive)
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -712,11 +536,6 @@ at Matchers.tests.cpp:<line number>
|
||||
<failure message="doesNotThrow(), SpecialException, ExceptionMatcher{ 1 }" type="CHECK_THROWS_MATCHES">
|
||||
FAILED:
|
||||
CHECK_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } )
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="doesNotThrow(), SpecialException, ExceptionMatcher{ 1 }" type="REQUIRE_THROWS_MATCHES">
|
||||
FAILED:
|
||||
REQUIRE_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } )
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -725,12 +544,6 @@ at Matchers.tests.cpp:<line number>
|
||||
FAILED:
|
||||
CHECK_THROWS_MATCHES( throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } )
|
||||
Unknown exception
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</error>
|
||||
<error message="throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 }" type="REQUIRE_THROWS_MATCHES">
|
||||
FAILED:
|
||||
REQUIRE_THROWS_MATCHES( throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } )
|
||||
Unknown exception
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</error>
|
||||
</testcase>
|
||||
@@ -740,13 +553,6 @@ FAILED:
|
||||
CHECK_THROWS_MATCHES( throwsSpecialException( 3 ), SpecialException, ExceptionMatcher{ 1 } )
|
||||
with expansion:
|
||||
SpecialException::what special exception has value of 1
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="throwsSpecialException( 4 ), SpecialException, ExceptionMatcher{ 1 }" type="REQUIRE_THROWS_MATCHES">
|
||||
FAILED:
|
||||
REQUIRE_THROWS_MATCHES( throwsSpecialException( 4 ), SpecialException, ExceptionMatcher{ 1 } )
|
||||
with expansion:
|
||||
SpecialException::what special exception has value of 1
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -763,17 +569,6 @@ at Matchers.tests.cpp:<line number>
|
||||
FAILED:
|
||||
CHECK_THROWS_AS( thisThrows(), std::string )
|
||||
expected exception
|
||||
at Exception.tests.cpp:<line number>
|
||||
</error>
|
||||
<failure message="thisDoesntThrow(), std::domain_error" type="CHECK_THROWS_AS">
|
||||
FAILED:
|
||||
CHECK_THROWS_AS( thisDoesntThrow(), std::domain_error )
|
||||
at Exception.tests.cpp:<line number>
|
||||
</failure>
|
||||
<error message="thisThrows()" type="CHECK_NOTHROW">
|
||||
FAILED:
|
||||
CHECK_NOTHROW( thisThrows() )
|
||||
expected exception
|
||||
at Exception.tests.cpp:<line number>
|
||||
</error>
|
||||
</testcase>
|
||||
@@ -791,12 +586,6 @@ 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">
|
||||
@@ -930,16 +719,6 @@ with expansion:
|
||||
2 == 1
|
||||
this message may be logged later
|
||||
this message should be logged
|
||||
at Message.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="a == 0" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( a == 0 )
|
||||
with expansion:
|
||||
2 == 0
|
||||
this message may be logged later
|
||||
this message should be logged
|
||||
and this, but later
|
||||
at Message.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -970,38 +749,6 @@ FAILED:
|
||||
CHECK( data.int_seven != 7 )
|
||||
with expansion:
|
||||
7 != 7
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.float_nine_point_one != Approx( 9.1f )" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.float_nine_point_one != Approx( 9.1f ) )
|
||||
with expansion:
|
||||
9.100000381f
|
||||
!=
|
||||
Approx( 9.10000038146972656 )
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.double_pi != Approx( 3.1415926535 )" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.double_pi != Approx( 3.1415926535 ) )
|
||||
with expansion:
|
||||
3.14159265350000005
|
||||
!=
|
||||
Approx( 3.14159265350000005 )
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello != "hello"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello != "hello" )
|
||||
with expansion:
|
||||
"hello" != "hello"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello.size() != 5" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello.size() != 5 )
|
||||
with expansion:
|
||||
5 != 5
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -1126,132 +873,6 @@ FAILED:
|
||||
CHECK( data.int_seven > 7 )
|
||||
with expansion:
|
||||
7 > 7
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.int_seven < 7" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.int_seven < 7 )
|
||||
with expansion:
|
||||
7 < 7
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.int_seven > 8" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.int_seven > 8 )
|
||||
with expansion:
|
||||
7 > 8
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.int_seven < 6" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.int_seven < 6 )
|
||||
with expansion:
|
||||
7 < 6
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.int_seven < 0" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.int_seven < 0 )
|
||||
with expansion:
|
||||
7 < 0
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.int_seven < -1" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.int_seven < -1 )
|
||||
with expansion:
|
||||
7 < -1
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.int_seven >= 8" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.int_seven >= 8 )
|
||||
with expansion:
|
||||
7 >= 8
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.int_seven <= 6" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.int_seven <= 6 )
|
||||
with expansion:
|
||||
7 <= 6
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.float_nine_point_one < 9" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.float_nine_point_one < 9 )
|
||||
with expansion:
|
||||
9.100000381f < 9
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.float_nine_point_one > 10" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.float_nine_point_one > 10 )
|
||||
with expansion:
|
||||
9.100000381f > 10
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.float_nine_point_one > 9.2" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.float_nine_point_one > 9.2 )
|
||||
with expansion:
|
||||
9.100000381f > 9.19999999999999929
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello > "hello"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello > "hello" )
|
||||
with expansion:
|
||||
"hello" > "hello"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello < "hello"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello < "hello" )
|
||||
with expansion:
|
||||
"hello" < "hello"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello > "hellp"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello > "hellp" )
|
||||
with expansion:
|
||||
"hello" > "hellp"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello > "z"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello > "z" )
|
||||
with expansion:
|
||||
"hello" > "z"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello < "hellm"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello < "hellm" )
|
||||
with expansion:
|
||||
"hello" < "hellm"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello < "a"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello < "a" )
|
||||
with expansion:
|
||||
"hello" < "a"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello >= "z"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello >= "z" )
|
||||
with expansion:
|
||||
"hello" >= "z"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="data.str_hello <= "a"" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( data.str_hello <= "a" )
|
||||
with expansion:
|
||||
"hello" <= "a"
|
||||
at Condition.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -1381,22 +1002,6 @@ FAILED:
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" matches "this STRING contains
|
||||
'abc' as a substring" case sensitively
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="testStringForMatching(), Matches( "contains 'abc' as a substring" )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( testStringForMatching(), Matches( "contains 'abc' as a substring" ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" matches "contains 'abc' as a
|
||||
substring" case sensitively
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="testStringForMatching(), Matches( "this string contains 'abc' as a" )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( testStringForMatching(), Matches( "this string contains 'abc' as a" ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" matches "this string contains
|
||||
'abc' as a" case sensitively
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -1461,12 +1066,6 @@ at Matchers.tests.cpp:<line number>
|
||||
FAILED:
|
||||
CHECK( false )
|
||||
This will be reported multiple times
|
||||
at Message.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="false" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( false )
|
||||
This will be reported multiple times
|
||||
at Message.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -1511,14 +1110,6 @@ FAILED:
|
||||
CHECK_THAT( testStringForMatching(), StartsWith( "This String" ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" starts with: "This String"
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="testStringForMatching(), StartsWith( "string", Catch::CaseSensitive::No )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( testStringForMatching(), StartsWith( "string", Catch::CaseSensitive::No ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" starts with: "string" (case
|
||||
insensitive)
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -1872,13 +1463,6 @@ FAILED:
|
||||
CHECK_THAT( v, VectorContains( -1 ) )
|
||||
with expansion:
|
||||
{ 1, 2, 3 } Contains: -1
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="empty, VectorContains( 1 )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( empty, VectorContains( 1 ) )
|
||||
with expansion:
|
||||
{ } Contains: 1
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -1888,13 +1472,6 @@ FAILED:
|
||||
CHECK_THAT( empty, Contains( v ) )
|
||||
with expansion:
|
||||
{ } Contains: { 1, 2, 3 }
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="v, Contains( v2 )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( v, Contains( v2 ) )
|
||||
with expansion:
|
||||
{ 1, 2, 3 } Contains: { 1, 2, 4 }
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -1904,27 +1481,6 @@ FAILED:
|
||||
CHECK_THAT( v, Equals( v2 ) )
|
||||
with expansion:
|
||||
{ 1, 2, 3 } Equals: { 1, 2 }
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="v2, Equals( v )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( v2, Equals( v ) )
|
||||
with expansion:
|
||||
{ 1, 2 } Equals: { 1, 2, 3 }
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="empty, Equals( v )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( empty, Equals( v ) )
|
||||
with expansion:
|
||||
{ } Equals: { 1, 2, 3 }
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="v, Equals( empty )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( v, Equals( empty ) )
|
||||
with expansion:
|
||||
{ 1, 2, 3 } Equals: { }
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -1934,27 +1490,6 @@ FAILED:
|
||||
CHECK_THAT( v, UnorderedEquals( empty ) )
|
||||
with expansion:
|
||||
{ 1, 2, 3 } UnorderedEquals: { }
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="empty, UnorderedEquals( v )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( empty, UnorderedEquals( v ) )
|
||||
with expansion:
|
||||
{ } UnorderedEquals: { 1, 2, 3 }
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="permuted, UnorderedEquals( v )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( permuted, UnorderedEquals( v ) )
|
||||
with expansion:
|
||||
{ 1, 3 } UnorderedEquals: { 1, 2, 3 }
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="permuted, UnorderedEquals( v )" type="CHECK_THAT">
|
||||
FAILED:
|
||||
CHECK_THAT( permuted, UnorderedEquals( v ) )
|
||||
with expansion:
|
||||
{ 3, 1 } UnorderedEquals: { 1, 2, 3 }
|
||||
at Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -2062,11 +1597,6 @@ at Misc.tests.cpp:<line number>
|
||||
<skipped type="SKIP">
|
||||
SKIPPED
|
||||
skipping because answer = 41
|
||||
at Skip.tests.cpp:<line number>
|
||||
</skipped>
|
||||
<skipped type="SKIP">
|
||||
SKIPPED
|
||||
skipping because answer = 43
|
||||
at Skip.tests.cpp:<line number>
|
||||
</skipped>
|
||||
</testcase>
|
||||
@@ -2085,28 +1615,12 @@ FAILED:
|
||||
CHECK( 3 == 4 )
|
||||
at Skip.tests.cpp:<line number>
|
||||
</failure>
|
||||
<skipped type="SKIP">
|
||||
SKIPPED
|
||||
at Skip.tests.cpp:<line number>
|
||||
</skipped>
|
||||
</testcase>
|
||||
<testcase classname="<exe-name>.global" name="failing for some generator values causes entire test case to fail" time="{duration}" status="run">
|
||||
<failure type="FAIL">
|
||||
FAILED:
|
||||
at Skip.tests.cpp:<line number>
|
||||
</failure>
|
||||
<skipped type="SKIP">
|
||||
SKIPPED
|
||||
at Skip.tests.cpp:<line number>
|
||||
</skipped>
|
||||
<failure type="FAIL">
|
||||
FAILED:
|
||||
at Skip.tests.cpp:<line number>
|
||||
</failure>
|
||||
<skipped type="SKIP">
|
||||
SKIPPED
|
||||
at Skip.tests.cpp:<line number>
|
||||
</skipped>
|
||||
</testcase>
|
||||
<testcase classname="<exe-name>.global" name="failing in some unskipped sections causes entire test case to fail/skipped" time="{duration}" status="run">
|
||||
<skipped type="SKIP">
|
||||
@@ -2175,46 +1689,6 @@ FAILED:
|
||||
with expansion:
|
||||
1 == 0
|
||||
Testing if fib[0] (1) is even
|
||||
at Misc.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="( fib[i] % 2 ) == 0" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( ( fib[i] % 2 ) == 0 )
|
||||
with expansion:
|
||||
1 == 0
|
||||
Testing if fib[1] (1) is even
|
||||
at Misc.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="( fib[i] % 2 ) == 0" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( ( fib[i] % 2 ) == 0 )
|
||||
with expansion:
|
||||
1 == 0
|
||||
Testing if fib[3] (3) is even
|
||||
at Misc.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="( fib[i] % 2 ) == 0" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( ( fib[i] % 2 ) == 0 )
|
||||
with expansion:
|
||||
1 == 0
|
||||
Testing if fib[4] (5) is even
|
||||
at Misc.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="( fib[i] % 2 ) == 0" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( ( fib[i] % 2 ) == 0 )
|
||||
with expansion:
|
||||
1 == 0
|
||||
Testing if fib[6] (13) is even
|
||||
at Misc.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="( fib[i] % 2 ) == 0" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( ( fib[i] % 2 ) == 0 )
|
||||
with expansion:
|
||||
1 == 0
|
||||
Testing if fib[7] (21) is even
|
||||
at Misc.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
@@ -2359,15 +1833,6 @@ Count 1 to 3...
|
||||
1
|
||||
2
|
||||
3
|
||||
at Message.tests.cpp:<line number>
|
||||
</failure>
|
||||
<failure message="false" type="CHECK">
|
||||
FAILED:
|
||||
CHECK( false )
|
||||
Count 4 to 6...
|
||||
4
|
||||
5
|
||||
6
|
||||
at Message.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
|
||||
@@ -422,16 +422,11 @@ at AssertionHandler.tests.cpp:<line number>
|
||||
<testCase name="Parsing tags with non-alphabetical characters is pass-through" duration="{duration}"/>
|
||||
</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}"/>
|
||||
<testCase name="Stringifying char arrays with statically known sizes - unsigned char" duration="{duration}"/>
|
||||
<testCase name="parseEnums" duration="{duration}"/>
|
||||
<testCase name="parseEnums/No enums" duration="{duration}"/>
|
||||
<testCase name="parseEnums/One enum value" duration="{duration}"/>
|
||||
<testCase name="parseEnums/Multiple enum values" duration="{duration}"/>
|
||||
</file>
|
||||
<file path="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp">
|
||||
<testCase name="Upcasting special member functions" duration="{duration}"/>
|
||||
@@ -1079,8 +1074,14 @@ at Decomposition.tests.cpp:<line number>
|
||||
</testCase>
|
||||
</file>
|
||||
<file path="tests/<exe-name>/UsageTests/EnumToString.tests.cpp">
|
||||
<testCase name="Directly creating an EnumInfo" duration="{duration}"/>
|
||||
<testCase name="Enum backed by larger underlying type" duration="{duration}"/>
|
||||
<testCase name="Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM" duration="{duration}"/>
|
||||
<testCase name="Enums in namespaces can quickly have stringification enabled using CATCH_REGISTER_ENUM" duration="{duration}"/>
|
||||
<testCase name="parseEnums" duration="{duration}"/>
|
||||
<testCase name="parseEnums/No enums" duration="{duration}"/>
|
||||
<testCase name="parseEnums/One enum value" duration="{duration}"/>
|
||||
<testCase name="parseEnums/Multiple enum values" duration="{duration}"/>
|
||||
<testCase name="toString(enum class w/operator<<)" duration="{duration}"/>
|
||||
<testCase name="toString(enum class)" duration="{duration}"/>
|
||||
<testCase name="toString(enum w/operator<<)" duration="{duration}"/>
|
||||
|
||||
@@ -421,16 +421,11 @@ at AssertionHandler.tests.cpp:<line number>
|
||||
<testCase name="Parsing tags with non-alphabetical characters is pass-through" duration="{duration}"/>
|
||||
</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}"/>
|
||||
<testCase name="Stringifying char arrays with statically known sizes - unsigned char" duration="{duration}"/>
|
||||
<testCase name="parseEnums" duration="{duration}"/>
|
||||
<testCase name="parseEnums/No enums" duration="{duration}"/>
|
||||
<testCase name="parseEnums/One enum value" duration="{duration}"/>
|
||||
<testCase name="parseEnums/Multiple enum values" duration="{duration}"/>
|
||||
</file>
|
||||
<file path="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp">
|
||||
<testCase name="Upcasting special member functions" duration="{duration}"/>
|
||||
@@ -1078,8 +1073,14 @@ at Decomposition.tests.cpp:<line number>
|
||||
</testCase>
|
||||
</file>
|
||||
<file path="tests/<exe-name>/UsageTests/EnumToString.tests.cpp">
|
||||
<testCase name="Directly creating an EnumInfo" duration="{duration}"/>
|
||||
<testCase name="Enum backed by larger underlying type" duration="{duration}"/>
|
||||
<testCase name="Enums can quickly have stringification enabled using CATCH_REGISTER_ENUM" duration="{duration}"/>
|
||||
<testCase name="Enums in namespaces can quickly have stringification enabled using CATCH_REGISTER_ENUM" duration="{duration}"/>
|
||||
<testCase name="parseEnums" duration="{duration}"/>
|
||||
<testCase name="parseEnums/No enums" duration="{duration}"/>
|
||||
<testCase name="parseEnums/One enum value" duration="{duration}"/>
|
||||
<testCase name="parseEnums/Multiple enum values" duration="{duration}"/>
|
||||
<testCase name="toString(enum class w/operator<<)" duration="{duration}"/>
|
||||
<testCase name="toString(enum class)" duration="{duration}"/>
|
||||
<testCase name="toString(enum w/operator<<)" duration="{duration}"/>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user