Compare commits

..

43 Commits

Author SHA1 Message Date
Martin Hořeňovský b670de4fe1 v3.14.0 2026-04-05 15:05:38 +02:00
Martin Hořeňovský 465e63dad7 Do not include chrono_clock.hpp in benchmark_stats_fwd.hpp 2026-04-05 14:57:05 +02:00
Christoph Grüninger 34f4f81947 [ci] Update GitHub Actions to latest major release
Fix warning that Node.js 20 is disconinued in June
2026-04-04 22:28:48 +02:00
Martin Hořeňovský 57f738b380 JUnit reporter output single failed assertion node per test case
Ideally JUnit tools would handle multiple failures per test case,
but they don't, so here we are.

Closes #1919
2026-04-04 15:12:56 +02:00
Martin Hořeňovský 1df10d28ae Don't write semicolon after failed expression in separate call 2026-04-03 10:28:32 +02:00
Martin Hořeňovský 9f1b48a94f Inline SKIP/FAIL in RunContext to fix build failure with prefixed macros
Closes #3087
2026-04-03 10:19:05 +02:00
Sung, Po Han f4e83daa18 Fix catch_discover_tests PRE_TEST failure with zero discoverable tests
When using catch_discover_tests() with DISCOVERY_MODE PRE_TEST and a
multi-config generator (e.g. Ninja Multi-Config), if a test target has
zero discoverable tests (e.g. all tests tagged with [.]), ctest fails:

  CMake Error: include could not find requested file:
    .../test-hidden-b12d07c_tests-Release.cmake

The early return added in #2962 (76f70b14) correctly prevented a JSON
parsing crash for zero tests, but skipped writing the ctest file. The
PRE_TEST include script unconditionally includes this file, so the
missing file causes a hard error that aborts all test discovery.

Write an empty file before returning early so the include always
succeeds.
2026-04-02 10:24:46 +02:00
Jan Niklas Hasse 572f96b8fe Fix counting of UTF-8 codepoints in TextFlow
For line-wrapping bytes were counted instead of codepoints. This
resulted in line-breaks being inserted at the wrong position and also
breaking UTF-8 characters.

Fixes #1022.
2026-04-01 16:12:08 +02:00
Martin Hořeňovský 8492fd444e Ignore Wunreachable-code-return in Generators.tests.cpp 2026-04-01 11:02:56 +02:00
Martin Hořeňovský fe2a20ab55 Fix warning suppression block in Condition.tests straddling includes 2026-04-01 10:56:21 +02:00
Martin Hořeňovský 51b0532d1f Suppress __COUNTER__ warning from newest Clang versions
Ideally we could suppress the warning locally in the `UNIQUE_NAME` macro,
but that runs into at least 2 issues:

1) Clang actually does not consider the warning as coming from inside the
   `UNIQUE_NAME` macro, even though it correctly points to its expansion
   as the problem. This means that adding `_Pragma`s inside the macro
   around the __COUNTER__ usage does not actually silence the warning.

2) Adding the local suppressions anyway breaks the expansion of
   `MAKE_NAMESPACE` macro inside the templated test case macros. This can
   be fixed for the newest clang version by removing its use and using
   the uniqued `TestName` for the namespace name directly, but this breaks
   compilation on GCC, and older Clang versions.

Because of these issues, we introduce global warning suppression for
`-Wc2y-extensions` to be done with it. We should revisit this if Clang 23
fixes the local pragma based suppression, when it might be worth the effort
to rework the templated test case macros to support it.

Closes #3076
2026-04-01 10:34:58 +02:00
Joseph Edwards 2ec64d12b1 fix: add missing backslash in macro definition 2026-03-30 14:23:17 +02:00
Martin Hořeňovský ccc49ba664 Merge pull request #3078 from e-kwsm/cstdint
fix: add missed <cstdint> inclusion
2026-03-11 13:44:52 +01:00
Eisuke Kawashima 6f036244e9 fix: add missed <cstdint> inclusion 2026-03-08 19:34:59 +09:00
Vertexwahn 50e9dbfc4e Update bazel_skylib and rules_cc dependencies 2026-02-18 20:14:05 +01:00
Martin Hořeňovský a404f37cec Add quiet verbosity variant to the default listener and tag listing 2026-02-16 22:52:39 +01:00
Martin Hořeňovský 29c9844f68 v3.13.0 2026-02-15 22:55:48 +01:00
Martin Hořeňovský 56024c04e4 More tests for MapGenerator 2026-02-15 21:53:10 +01:00
Martin Hořeňovský edfed6c04e Efficient skipToNthElementImpl for Take and Map generators 2026-02-15 21:43:54 +01:00
Martin Hořeňovský 75bfcc3f30 Expose skipToNthElement in the GeneratorWrapper 2026-02-15 21:38:14 +01:00
Martin Hořeňovský 056e4fe88d MapGenerator only calls mapping function if the result is used
Previously the mapping was eager on construction and calls to
`next()`. This was fine when generators were always exhausted fully,
but with the new generator filtering, we might not want to call
the map function eagerly; rather we want to call it only once,
after the generator is moved to the target element.
2026-02-15 20:44:21 +01:00
Martin Hořeňovský 3a0cf7e75f Support filtering on both sections and generators (#3069)
Not being able to filter generators to specific element has been regularly
causing problems. It was possible to use a dynamic section to run tests
for specific element in a generator, at least if the element had a nice
string representation, but the test case would still run once per element
in the generator.

With this change, it is possible to have the generator return only one
specific element, and do so based on the index, rather than the string
representation of the element. This enables simple debugging of tests
that fail for specific generator element.
2026-02-15 20:27:15 +01:00
Martin Hořeňovský b6c7b217d4 Improve test for --warn InfiniteGenerators 2026-02-13 21:30:26 +01:00
Martin Hořeňovský 045ac7acce Simplify IGeneratorTracker
* Removed `IGeneratorTracker::hasGenerator`, as it was never used.
* Removed `IGeneratorTracker::setGenerator`, as actually using it
  after the tracker was used would lead to inconsistent behaviour.
  Instead, the tracker is given the generator it guards during
  construction.
2026-02-13 21:17:37 +01:00
Martin Hořeňovský 72671fdbdf Check for infinite generators before we construct generator's tracker 2026-02-13 21:17:06 +01:00
Martin Hořeňovský 120827d4d6 Fix formatting in catch_commandline.cpp 2026-02-13 21:16:03 +01:00
Martin Hořeňovský daadf42a0e Add --warn InfiniteGenerators 2026-02-10 09:37:19 +01:00
Martin Hořeňovský d079ee13ab Allow generators to declare themselves (infinite)
This will be useful later to implement warning on infinitely
running `GENERATE` expressions.
2026-02-10 09:37:15 +01:00
Martin Hořeňovský 0056cd4efb Remove Tuple sponsorship banner - sponsorship has ended 2026-02-09 10:23:43 +01:00
ThePhD de7e863013 🐛 Clang on Windows will define _MSC_VER and trip up these checks -- make it actually Visual C++-specific 2026-01-19 15:14:53 +01:00
Martin Hořeňovský 024aec9729 Add efficient skip forward to Values, Map and Take generators 2026-01-12 22:39:59 +01:00
Martin Hořeňovský 9eca713a1f Add option to skip forward to the generator interface 2026-01-12 16:58:15 +01:00
Martin Hořeňovský 44c597f074 Add Concat generator for combining multiple generators 2026-01-12 14:27:49 +01:00
Martin Hořeňovský 6aedc79870 Remove unused m_used_up member in the ChunkGenerator 2026-01-12 14:27:44 +01:00
dragon-archer fcbf006c78 Fix _NullFile for MinGW 2026-01-12 09:29:19 +01:00
Martin Hořeňovský 2580eadc42 Add UNSCOPED_CAPTURE
Closes #2954
Closes #3010
2026-01-11 14:53:08 +01:00
Martin Hořeňovský b59f4f3522 Rename DEPRECATED -> CATCH_DEPRECATED
Closes #3058
2026-01-06 20:26:08 +01:00
bigmoonbit cd4fc88e2a chore: fix some typos in comments (#3048)
Signed-off-by: bigmoonbit <bigmoonbit@outlook.com>
Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
2026-01-03 16:05:18 +01:00
Martin Hořeňovský a50ac2f681 Add ASan and TSan builds on Mac 2026-01-03 14:30:07 +01:00
Martin Hořeňovský b81ef2aa2e Add OUTPUT_ON_FAILURE and NO_TESTS_ACTIONS=error to CTest GHA actions 2026-01-03 14:07:25 +01:00
Martin Hořeňovský ec4dcbf9cb Fix Wweak-vtables in benchmarks/assertion_listener.cpp 2026-01-03 13:43:27 +01:00
qerased b66b89374e Add validation for --benchmark-samples to prevent crash with zero value (#3056)
* Add validation for --benchmark-samples to prevent crash with zero samples
* Add automated test for benchmark samples validation
* Update baselines for benchmark-samples validation
* Add missing test for benchmark samples validation

---------

Co-authored-by: Chan Aung <chan@Thinkpad.localdomain>
2026-01-02 23:15:13 +01:00
OliverBeeckAVM b7e31c9ab3 Suppress static analysis warning 26426 for Windows/MSVC builds (#3057)
Suppress `Global initializer calls a non-constexpr function 'Catch::makeTestInvoker' (i.22).`,
which is issued when using macro `TEST_CASE` for windows/MSVC builds.


---------

Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
2026-01-01 22:56:14 +01:00
104 changed files with 7123 additions and 1677 deletions
+6 -2
View File
@@ -2,6 +2,10 @@ name: Linux Builds (Bazel)
on: [push, pull_request]
env:
CTEST_OUTPUT_ON_FAILURE: 1
CTEST_NO_TESTS_ACTION: error
jobs:
build_and_test_ubuntu:
name: Linux Ubuntu 22.04 Bazel build <GCC 11.2.0>
@@ -12,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
+5 -1
View File
@@ -2,6 +2,10 @@ name: Linux Builds (Meson)
on: [push, pull_request]
env:
CTEST_OUTPUT_ON_FAILURE: 1
CTEST_NO_TESTS_ACTION: error
jobs:
build:
name: meson ${{matrix.cxx}}, C++${{matrix.std}}, ${{matrix.build_type}}
@@ -19,7 +23,7 @@ jobs:
other_pkgs: clang-11
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Prepare environment
run: |
+7 -3
View File
@@ -5,6 +5,10 @@ name: Linux Builds (Complex)
on: [push, pull_request]
env:
CTEST_OUTPUT_ON_FAILURE: 1
CTEST_NO_TESTS_ACTION: error
jobs:
build:
name: ${{matrix.build_description}}, ${{matrix.cxx}}, C++${{matrix.std}} ${{matrix.build_type}}
@@ -71,7 +75,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Prepare environment
run: |
@@ -90,13 +94,13 @@ jobs:
run: cmake --build build
- name: Test
run: ctest --test-dir build -j --output-on-failure
run: ctest --test-dir build -j
clang-tidy:
name: clang-tidy
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Prepare environment
run: |
+6 -2
View File
@@ -2,6 +2,10 @@ name: Linux Builds (Basic)
on: [push, pull_request]
env:
CTEST_OUTPUT_ON_FAILURE: 1
CTEST_NO_TESTS_ACTION: error
jobs:
build:
name: ${{matrix.cxx}}, C++${{matrix.std}}, ${{matrix.build_type}}
@@ -79,7 +83,7 @@ jobs:
other_pkgs: g++-11
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Add repositories for older compilers
run: |
@@ -102,4 +106,4 @@ jobs:
run: cmake --build build
- name: Test
run: ctest --test-dir build -j --output-on-failure
run: ctest --test-dir build -j
+6 -2
View File
@@ -2,6 +2,10 @@ name: Mac Builds
on: [push, pull_request]
env:
CTEST_OUTPUT_ON_FAILURE: 1
CTEST_NO_TESTS_ACTION: error
jobs:
build:
runs-on: ${{matrix.image}}
@@ -13,7 +17,7 @@ jobs:
std: [14, 17]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Configure
run: |
@@ -27,4 +31,4 @@ jobs:
run: cmake --build build
- name: Test
run: ctest --test-dir build -j --output-on-failure
run: ctest --test-dir build -j
@@ -0,0 +1,43 @@
name: Mac Sanitizer Builds
on: [push, pull_request]
env:
CTEST_OUTPUT_ON_FAILURE: 1
CTEST_NO_TESTS_ACTION: error
jobs:
build:
runs-on: ${{matrix.image}}
strategy:
fail-fast: false
matrix:
image: [macos-15, macos-15-intel]
build_type: [Debug]
std: [17]
sanitizer: [thread, address]
include:
- sanitizer: thread
preset: basic-tests
filter: -R ThreadSafetyTests
- sanitizer: address
preset: most-tests
filter:
steps:
- uses: actions/checkout@v6
- name: Configure
run: |
CFXXFLAGS=-fsanitize=${{matrix.sanitizer}},undefined
cmake --preset ${{matrix.preset}} -GNinja \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
-DCATCH_BUILD_EXTRA_TESTS=ON
- name: Build
run: cmake --build build
- name: Test
run: ctest --test-dir build ${{matrix.filter}}
@@ -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}}
+2 -2
View File
@@ -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
+6 -2
View File
@@ -2,6 +2,10 @@ name: Windows Builds (Basic)
on: [push, pull_request]
env:
CTEST_OUTPUT_ON_FAILURE: 1
CTEST_NO_TESTS_ACTION: error
jobs:
build:
name: ${{matrix.os}}, ${{matrix.std}}, ${{matrix.build_type}}, ${{matrix.platform}}
@@ -14,7 +18,7 @@ jobs:
build_type: [Debug, Release]
std: [14, 17]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Configure build
run: |
@@ -27,5 +31,5 @@ jobs:
shell: cmd
- name: Run tests
run: ctest --test-dir build -C ${{matrix.build_type}} -j %NUMBER_OF_PROCESSORS% --output-on-failure
run: ctest --test-dir build -C ${{matrix.build_type}} -j %NUMBER_OF_PROCESSORS%
shell: cmd
+1 -1
View File
@@ -35,7 +35,7 @@ if(CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
endif()
project(Catch2
VERSION 3.12.0 # CML version placeholder, don't delete
VERSION 3.14.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
View File
@@ -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")
+1 -12
View File
@@ -1,16 +1,5 @@
<a id="top"></a>
<table width="100%">
<tr>
<td align="center" width="50%"><img src="/data/artwork/catch2-logo-full-with-background.svg" width="100%"></td>
<td align="center" width="50%">
<figure>
<figcaption>Special thanks to:</figcaption>
<a href="https://tuple.app/catch2"><img src="/data/sponsors/github_repo_sponsorship.png" width="100%"></a>
</figure>
</td>
</tr>
</table>
![Catch2 logo](data/artwork/catch2-logo-full-with-background.svg)
[![Github Releases](https://img.shields.io/github/release/catchorg/catch2.svg)](https://github.com/catchorg/catch2/releases)
[![Linux build status](https://github.com/catchorg/Catch2/actions/workflows/linux-simple-builds.yml/badge.svg)](https://github.com/catchorg/Catch2/actions/workflows/linux-simple-builds.yml)
+2
View File
@@ -12,6 +12,7 @@
/**
* Event listener that listens to all assertions, forcing assertion slow path
*/
namespace {
class AssertionSlowPathListener : public Catch::EventListenerBase {
public:
static std::string getDescription() {
@@ -26,3 +27,4 @@ public:
};
CATCH_REGISTER_LISTENER( AssertionSlowPathListener )
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 KiB

+2 -1
View File
@@ -24,7 +24,8 @@ Once you're up and running consider the following reference material.
* [String Conversions](tostring.md#top)
**Running:**
* [Command line](command-line.md#top)
* [Command line reference](command-line.md#top)
* [Running specific section/generator](filtering-execution-path.md#top)
**Odds and ends:**
* [Frequently Asked Questions (FAQ)](faq.md#top)
+17 -37
View File
@@ -52,6 +52,8 @@ Click one of the following links to take you straight to that option - or scroll
<a href="#reporting-timings"> ` -d, --durations`</a><br />
<a href="#input-file"> ` -f, --input-file`</a><br />
<a href="#run-section"> ` -c, --section`</a><br />
<a href="#path-filtering"> ` -g, --generator-index`</a><br />
<a href="#path-filtering"> ` -p, --path-filter`</a><br />
<a href="#filenames-as-tags"> ` -#, --filenames-as-tags`</a><br />
@@ -287,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
@@ -358,10 +361,13 @@ There are currently two warnings implemented:
// (e.g. `REQUIRE`) is encountered.
UnmatchedTestSpec // Fail test run if any of the CLI test specs did
// not match any tests.
InfiniteGenerators // Fail if GENERATE would run infinitely
```
> `UnmatchedTestSpec` was introduced in Catch2 3.0.1.
> `InfiniteGenerators` was introduced in Catch2 3.13.0
<a id="reporting-timings"></a>
## Reporting timings
@@ -529,45 +535,19 @@ Prints the command line arguments to stdout
<a id="run-section"></a>
## Specify the section to run
<a id="path-filtering"></a>
## Specify the section/generator element to run
<pre>-c, --section &lt;section name&gt;</pre>
<pre>-g, --generator-index &lt;index in generator&gt;</pre>
<pre>-p, --path-filter &lt;path filter spec&gt;</pre>
To limit execution to a specific section within a test case, use this option one or more times.
To narrow to sub-sections use multiple instances, where each subsequent instance specifies a deeper nesting level.
> The generator and generic path filtering was added in Catch2 3.13.0
E.g. if you have:
These arguments allow you to run specific section(s) in a test case, or
only get specific element from a generator. All the variants form a shared
stack of filters.
<pre>
TEST_CASE( "Test" ) {
SECTION( "sa" ) {
SECTION( "sb" ) {
/*...*/
}
SECTION( "sc" ) {
/*...*/
}
}
SECTION( "sd" ) {
/*...*/
}
}
</pre>
Then you can run `sb` with:
<pre>./MyExe Test -c sa -c sb</pre>
Or run just `sd` with:
<pre>./MyExe Test -c sd</pre>
To run all of `sa`, including `sb` and `sc` use:
<pre>./MyExe Test -c sa</pre>
There are some limitations of this feature to be aware of:
- Code outside of sections being skipped will still be executed - e.g. any set-up code in the TEST_CASE before the
start of the first section.</br>
- At time of writing, wildcards are not supported in section names.
- If you specify a section without narrowing to a test case first then all test cases will be executed
(but only matching sections within them).
[See the full documentation of path filtering for more details](filtering-execution-path.md#top)
<a id="filenames-as-tags"></a>
+1 -1
View File
@@ -29,7 +29,7 @@ with the same name.
## Prefixing Catch macros
CATCH_CONFIG_PREFIX_ALL // Prefix all macros with CATCH_
CATCH_CONFIG_PREFIX_MESSAGES // Prefix only INFO, UNSCOPED_INFO, WARN and CAPTURE
CATCH_CONFIG_PREFIX_MESSAGES // Prefix only message macros ((UNSCOPED_)INFO, WARN, (UNSCOPED_)CAPTURE)
To keep test code clean and uncluttered Catch uses short macro names (e.g. ```TEST_CASE``` and ```REQUIRE```). Occasionally these may conflict with identifiers from platform headers or the system under test. In this case the above identifier can be defined. This will cause all the Catch user macros to be prefixed with ```CATCH_``` (e.g. ```CATCH_TEST_CASE``` and ```CATCH_REQUIRE```).
+26
View File
@@ -48,6 +48,32 @@ If you are mutating the fixture instance from within the test case, and
want to keep doing so in the future, mark the mutated members as `mutable`.
### Section-only filtering with `-c/--section`
> Deprecated in Catch2 3.13.0
Currently, if you use only `-c/--section` parameters to decide which
sections to enter, the filtering ignores generators completely. In the
future, using only `-c/--section` will behave the same way as if you
specified the filters through the new `-p/--path-filter` parameter, which
means that generators are taken into account.
### Generator interfaces
#### Defaulted `UntypedGeneratorBase::isFinite()`
> Deprecated in Catch2 3.13.0
The `UntypedGeneratorBase` currently provides a default implementation
for `isFinite` that always returns `true`. This was done to keep backwards
compatibility with pre-existing generators, as infinite generators can
be diagnosed as errors in some cases.
In the future, all generators will be expected to override `isFinite`.
---
[Home](Readme.md#top)
+222
View File
@@ -0,0 +1,222 @@
<a id="top"></a>
# How to run specific section/generator
> The generator and generic path filtering was added in Catch2 3.13.0
Catch2 supports picking specific path through a test case by filtering
sections and generator indices to run through. This is done by using one
of the three commandline parameters, one or more times.
```
-c, --section <section name>
-g, --generator-index <index in generator>
-p, --path-filter <path filter spec>
```
All the variants form a shared stack of filters, but if you use only
`-c`/`--section` form to specify section filters, you will get the old
behaviour, which does not affect generators at all. If you also use either
`-g`/`--generator-index`, or `-p`/`--path-filter`, you will get the new
behaviour, which can also filter generator elements.
Both the new and old filter behaviours include some potentially surprising
things:
* Code outside of sections being skipped will still be executed. E.g.
any setup code in the TEST_CASE that lives outside of sections.
* Path filters filter the prefix of the path. So if you specify single
filter, it affects only the top level sections/generator, with their
child sections/generators being unfiltered.
* Path filters are independent of test case selection, Catch2 will try
to follow the path filters in all selected test cases. This means
that if you specify path filters without a test case filter, Catch2
will try to apply the path filters inside every registered test case.
## Old behaviour
> The old behaviour was deprecated in Catch2 3.13.0
```
-c, --section <section name>
```
The argument to `-c`/`--section` can be any arbitrary string. When Catch2
is deciding whether to enter a section, it will check its trimmed name
against the appropriate trimmed section filter. If they are the same,
the section can be opened. If not, Catch2 will skip over that section.
### Examples
#### Simple section nesting
Given
```cpp
TEST_CASE( "foo" ) {
REQUIRE( true );
SECTION( "A" ) {
SECTION( "A1" ) { REQUIRE( true ); }
SECTION( "A2" ) { REQUIRE( true ); }
}
SECTION( "B" ) {
SECTION( "B1" ) { REQUIRE( true ); }
SECTION( "B2" ) { REQUIRE( true ); }
}
}
```
* `./tests foo -c A` runs section "A" and both of its subsections,
resulting in 4 assertions.
* `./tests foo -c A -c B` runs section "A", but none of its subsections,
resulting in 1 assertion (the one before "A").
* `./tests foo -c A -c A1` runs section "A" and only the "A1" subsection,
resulting in 2 assertions.
#### Sections with nested generators
Note that old behaviour completely _ignores_ generators. This means both
that they can't be filtered, but also that they aren't taken into account
for the filter depth. In other words, given
```cpp
TEST_CASE( "bar" ) {
REQUIRE( true );
SECTION( "A" ) { REQUIRE( true ); }
SECTION( "B" ) {
auto i = GENERATE( 1, 2, 3 );
DYNAMIC_SECTION( "i=" << i ) {
REQUIRE( true );
}
}
}
```
* `./tests bar -c A` results in 2 assertions.
* `./tests bar -c B -c i=2` results in 4 assertions, because the whole
generator in section "B" has to be used up, but the dynamic section is
only entered when the generator returns 2 as the value for `i`.
* `./tests bar -c B -c i=4` results in 3 assertions, because the assertion
outside of section is executed every time the test case is entered, and
the generator forces the test case to rerun 3 times before it is used up,
even though the dynamic section will never be entered.
#### Section with sibling generators
For cases where sections have sibling generators, the filtering can get
even more surprising.
```cpp
TEST_CASE( "qux" ) {
REQUIRE( true );
SECTION( "A" ) { REQUIRE( true ); }
auto i = GENERATE( 1, 2, 3 );
DYNAMIC_SECTION( "i=" << i ) {
REQUIRE( true );
}
}
```
* `./tests qux -c A` results in **4** assertions, because section "A" is
entered once, but the sibling generator has to be exhausted, and
the first assertion is executed once per generator element.
* `./tests qux -c i=2` also results in 4 assertions. Once again,
the generator has to be exhausted and the dynamic section is entered
once.
## New behaviour
> The new behaviour was introduced in Catch2 3.13.0
```
-g, --generator-index <index in generator>
-p, --path-filter <path filter spec>
```
The argument to `-g`/`--generator-index` must be either a non-negative
number, which is interpreted as the index of the desired element from
the generator, or "\*", which allows all elements from the generator.
Providing index outside of the generator is an error.
The argument to `-p`/`--path-filter` must start with either "c:" for
a section filter, or with "g:" for a generator filter. Everything past
the colon is then parsed as either a section filter, or a generator filter.
Note that using `p`/`--path-filter` enables new filtering behaviour, even
if it is only used to add section filters.
There is another important difference between filtering out sections and
generators. A section can be left un-entered, but a generator always has
to be active. For this reason, if generator fails a filter
(e.g. there is a section filter at given depth instead), it has to stop
the execution of the test case. Currently, this is done via `SKIP()`
equivalent, causing the section to be considered skipped.
### Examples
#### Nested generators
```cpp
TEST_CASE( "waldo" ) {
auto i = GENERATE( 1, 10, 100 );
auto j = GENERATE( 2, 20, 200 );
CAPTURE( i, j );
REQUIRE( true );
}
```
* `./tests waldo -g 1` results in 3 assertions, with `i := 10`, because
the second nested generator is unfiltered.
* `./tests waldo -g 1 -g 2` results in 1 assertion, with `i := 10, j := 200`.
* `./tests waldo -g * -g 2` results in 3 assertions, all with `j := 200`.
* `./tests waldo -g 1 -g *` results in 3 assertions, all with `i := 10`.
* `./tests waldo -g 3` results in 1 **failed** assertion, because the first
generator does not have 3rd element.
* `./tests waldo -g * -g 3` results in 3 **failed** assertions, as the
second generator does not have 3rd element, but we have to exhaust the
first generator.
#### Generator with a nested dynamic section
```cpp
TEST_CASE( "grault" ) {
REQUIRE( true );
auto i = GENERATE( 1, 2, 3 );
DYNAMIC_SECTION( "i=" << i ) {
REQUIRE( true );
}
}
```
* `./tests grault -p g:1` results in 2 assertions, as there is no filter
on the dynamic section.
* `./tests grault -p g:1 -p c:i=2` results in 2 assertions, as the filter
on the dynamic section matches the element given from the generator.
* `./tests grault -p g:1 -p c:i=3` results in 1 assertion, as the generator
is limited to only try `i := 2` and the dynamic section is filtered out.
#### Section with a sibling generator
Because generators have to stop test execution when they don't pass filter,
it is impossible to run only a section with sibling generator without
triggering a test case skip. Consider this test case from an earlier example:
```cpp
TEST_CASE( "qux" ) {
REQUIRE( true );
SECTION( "A" ) { REQUIRE( true ); }
auto i = GENERATE( 1, 2, 3 );
DYNAMIC_SECTION( "i=" << i ) {
REQUIRE( true );
}
}
```
* `./tests qux -p g:1` results in 2 assertions, as the dynamic section is
entered only once.
* `./tests qux -p g:1 -p c:i=1` results in 1 assertion, as the dynamic
section filter is incompatible with the generator filter.
* `./tests qux -p c:A` results in 2 assertions **and a skipped test case**.
This is because the generator is sibling to section "A", and thus reads
the same section filter. However, it is not a section and as thus cannot
proceed.
* `./tests qux -p c:i=2` results in 1 assertion **and a skipped test case**.
Once again, the first filter in the filter stack is a section filter,
and thus the generator cannot proceed.
Compare this with the old filter behaviour, where `./tests qux -c i=2`
would instead result in 4 assertions, because the generator would go
through all elements.
---
[Home](Readme.md#top)
+64 -1
View File
@@ -1,6 +1,12 @@
<a id="top"></a>
# Data Generators
**Contents**<br>
[Combining `GENERATE` and `SECTION`.](#combining-generate-and-section)<br>
[Provided generators](#provided-generators)<br>
[Generator interface](#generator-interface)<br>
[Other usage examples](#other-usage-examples)<br>
> Introduced in Catch2 2.6.0.
Data generators (also known as _data driven/parametrized test cases_)
@@ -106,7 +112,7 @@ a test case,
* 2 fundamental generators
* `SingleValueGenerator<T>` -- contains only single element
* `FixedValuesGenerator<T>` -- contains multiple elements
* 5 generic generators that modify other generators (defined in `catch2/generators/catch_generators_adapters.hpp`)
* 6 generic generators that modify other generators (defined in `catch2/generators/catch_generators_adapters.hpp`)
* `FilterGenerator<T, Predicate>` -- filters out elements from a generator
for which the predicate returns "false"
* `TakeGenerator<T>` -- takes first `n` elements from a generator
@@ -114,6 +120,7 @@ a test case,
* `MapGenerator<T, U, Func>` -- returns the result of applying `Func`
on elements from a different generator
* `ChunkGenerator<T>` -- returns chunks (inside `std::vector`) of n elements from a generator
* `ConcatGenerator<T>` -- returns elements from multiple generators as if they were one
* 2 random generators (defined in `catch2/generators/catch_generators_random.hpp`)
* `RandomIntegerGenerator<Integral>` -- generates random Integrals from range
* `RandomFloatGenerator<Float>` -- generates random Floats from range
@@ -125,6 +132,8 @@ a test case,
> `IteratorGenerator<T>` was introduced in Catch2 2.10.0.
> `ConcatGenerator<T>` was introduced in Catch2 3.13.0
The generators also have associated helper functions that infer their
type, making their usage much nicer. These are
@@ -142,6 +151,7 @@ type, making their usage much nicer. These are
* `range(Arithmetic start, Arithmetic end, Arithmetic step)` for `RangeGenerator<Arithmetic>` with a custom step size
* `from_range(InputIterator from, InputIterator to)` for `IteratorGenerator<T>`
* `from_range(Container const&)` for `IteratorGenerator<T>`
* `cat(GeneratorWrapper<T>&&...)` for `ConcatGenerator<T>`
> `chunk()`, `random()` and both `range()` functions were introduced in Catch2 2.7.0.
@@ -149,6 +159,8 @@ type, making their usage much nicer. These are
> `range()` for floating point numbers has been introduced in Catch2 2.11.0
> `cat` has been introduced in Catch2 3.13.0
And can be used as shown in the example below to create a generator
that returns 100 odd random number:
@@ -252,9 +264,34 @@ struct IGenerator : GeneratorUntypedBase {
// Returns user-friendly string showing the current generator element
// Does not have to be overridden, IGenerator provides default implementation
virtual std::string stringifyImpl() const;
/**
* Customization point for `skipToNthElement`
*
* Does not have to be overridden, there is a default implementation.
* Can be overridden for better performance.
*
* If there are not enough elements, shall throw an error.
*
* Going backwards is not supported.
*/
virtual void skipToNthElementImpl( std::size_t n );
/**
* Returns true if calls to `next` will eventually return false
*
* Note that for backwards compatibility this is currently defaulted
* to return `true`, but in the future all generators will have to
* provide their own implementation.
*/
virtual bool isFinite() const = 0;
};
```
> `skipToNthElementImpl` was added in Catch2 3.13.0
> `isFinite` was added in Catch2 3.13.0
However, to be able to use your custom generator inside `GENERATE`, it
will need to be wrapped inside a `GeneratorWrapper<T>`.
`GeneratorWrapper<T>` is a value wrapper around a
@@ -278,6 +315,32 @@ to be an error or not.
* If empty generator **is not** an error, use the [`SKIP` macro](skipping-passing-failing.md#skipping-test-cases-at-runtime) in constructor.
## Other usage examples
### Adding a reproducer to random tests
If you use generators to generate random inputs for testing, you might
want to combine them with specific inputs, e.g. reproducers for previously
found issues.
Because `GENERATE` accepts multiple values/generators, the basic case is simple:
```cpp
const int input = GENERATE(1, 2, take(10, random(10, 10'000'000)));
```
This will set `input` first to "1", then to "2", and then to 10 random
integers.
But if you process the random inputs further (e.g. via `map`), you can't
rely on `GENERATE`'s support for multiple generators. In that case, you
have to use the `cat` generator combinator.
```cpp
const auto input = GENERATE(
map( foo,
cat( value( 4 ), take( 10, random( 10, 10'000'000 ) ) ) ) );
```
This will set `input` first to `foo(4)`, before transforming the 10 random
integers through `foo`.
---
+22 -11
View File
@@ -26,19 +26,22 @@ started" and "Section B", while the third one will only report "Test case
started" as the extra info.
## Logging without local scope
## Logging outside of current scope
> [Introduced](https://github.com/catchorg/Catch2/issues/1522) in Catch2 2.7.0.
> `UNSCOPED_INFO` was [introduced](https://github.com/catchorg/Catch2/issues/1522) in Catch2 2.7.0.
`UNSCOPED_INFO` is similar to `INFO` with two key differences:
> `UNSCOPED_CAPTURE` was introduced in Catch2 3.13.0.
- Lifetime of an unscoped message is not tied to its own scope.
The `UNSCOPED_X` macros are similar to their plain `X` macro counterparts,
with two key differences:
- The lifetime of an unscoped message is not tied to its own scope.
- An unscoped message can be reported by the first following assertion only, regardless of the result of that assertion.
In other words, lifetime of `UNSCOPED_INFO` is limited by the following assertion (or by the end of test case/section, whichever comes first) whereas lifetime of `INFO` is limited by its own scope.
These differences make this macro useful for reporting information from helper functions or inner scopes. An example:
In other words, the `UNSCOPED_X` macros are useful to add extra information
to the next assertion, e.g. from helper functions or inner scopes.
An example:
```cpp
void print_some_info() {
UNSCOPED_INFO("Info from helper");
@@ -83,9 +86,16 @@ Second info
Second unscoped info
```
Note that unscoped messages are not passed between test cases, even if
there were no assertions between them.
## Streaming macros
All these macros allow heterogeneous sequences of values to be streaming using the insertion operator (```<<```) in the same way that std::ostream, std::cout, etc support it.
Apart from `CAPTURE` (and its close sibling, `UNSCOPED_CAPTURE`), message
macros support gradual streaming of messages and values in the same way
that the standard streams do.
E.g.:
```c++
@@ -99,9 +109,6 @@ These macros come in three forms:
The message is logged to a buffer, but only reported with next assertions that are logged. This allows you to log contextual information in case of failures which is not shown during a successful test run (for the console reporter, without -s). Messages are removed from the buffer at the end of their scope, so may be used, for example, in loops.
_Note that in Catch2 2.x.x `INFO` can be used without a trailing semicolon as there is a trailing semicolon inside macro.
This semicolon will be removed with next major version. It is highly advised to use a trailing semicolon after `INFO` macro._
**UNSCOPED_INFO(** _message expression_ **)**
> [Introduced](https://github.com/catchorg/Catch2/issues/1522) in Catch2 2.7.0.
@@ -128,6 +135,10 @@ AS `FAIL`, but does not abort the test
**CAPTURE(** _expression1_, _expression2_, ... **)**
**UNSCOPED_CAPTURE(** _expression1_, _expression2_, ... **)**
> `UNSCOPED_CAPTURE` was introduced in Catch2 3.13.0.
Sometimes you just want to log a value of variable, or expression. For
convenience, we provide the `CAPTURE` macro, that can take a variable,
or an expression, and prints out that variable/expression and its value
+1 -1
View File
@@ -65,7 +65,7 @@ int main( int argc, char* argv[] ) {
returnCode = session.run();
// returnCode encodes the type of error that occured. See the
// returnCode encodes the type of error that occurred. See the
// integer constants in catch_session.hpp for more information
// on what each return code means.
+43
View File
@@ -2,6 +2,8 @@
# Release notes
**Contents**<br>
[3.14.0](#3140)<br>
[3.13.0](#3130)<br>
[3.12.0](#3120)<br>
[3.11.0](#3110)<br>
[3.10.0](#3100)<br>
@@ -72,6 +74,47 @@
[Even Older versions](#even-older-versions)<br>
## 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
* `--benchmark-samples 0` no longer hard crashes (#3056)
* 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)
* Added `UNSCOPED_CAPTURE` macro (#2954)
* Added `ConcatGenerator` to combine multiple separate generator into one
* The short form is `cat`
* Generators can now jump forward to nth element efficiently
* Custom generators that can jump forward efficiently should override `skipToNthElementImpl`
* Generators can declare themselves infinite
* The generator base defaults to declaring itself finite for backwards compatibility
* Custom generators should override `isFinite()` to return the proper value
* Added `--warn InfiniteGenerators` to error out on `GENERATE` being given an infinite generator
* Extended options for section filtering from CLI to include generators
* The user can specify which element from the generator to use in the test case
* See documentation for how the new filters work and how they can be specified
* `MapGenerator` only calls the mapping function if the output will be used
## 3.12.0
### Fixes
+18
View File
@@ -39,6 +39,24 @@ public:
current_number = m_dist(m_rand);
return true;
}
bool isFinite() const override { return false; }
// Note: this improves the performance only a bit, but it is here
// to show how you can override the skip functionality.
void skipToNthElementImpl( std::size_t n ) override {
auto current_index = currentElementIndex();
assert(current_index <= n);
// We cannot jump forward the underlying generator directly,
// because we do not know how many bits each distributed number
// would consume to be generated.
for (; current_index < n; ++current_index) {
(void)m_dist(m_rand);
}
// We do not have to touch the current element index; it is handled
// by the base class.
}
};
// Avoids -Wweak-vtables
+2
View File
@@ -40,6 +40,8 @@ public:
bool next() override {
return !!std::getline(m_stream, m_line);
}
bool isFinite() const override { return true; }
};
std::string const& LineGenerator::get() const {
+1
View File
@@ -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()
+359 -145
View File
@@ -6,8 +6,8 @@
// SPDX-License-Identifier: BSL-1.0
// Catch v3.12.0
// Generated: 2025-12-28 22:27:25.828797
// Catch v3.14.0
// Generated: 2026-04-05 15:03:01.631668
// ----------------------------------------------------------
// This file is an amalgamation of multiple different files.
// You probably shouldn't edit it directly.
@@ -798,6 +798,10 @@ namespace Catch {
lhs.customOptions == rhs.customOptions;
}
bool operator==( PathFilter const& lhs, PathFilter const& rhs ) {
return lhs.type == rhs.type && lhs.filter == rhs.filter;
}
Config::Config( ConfigData const& data ):
m_data( data ) {
// We need to trim filter specs to avoid trouble with superfluous
@@ -807,9 +811,6 @@ namespace Catch {
for (auto& elem : m_data.testsOrTags) {
elem = trim(elem);
}
for (auto& elem : m_data.sectionsToRun) {
elem = trim(elem);
}
// Insert the default reporter if user hasn't asked for a specific one
if ( m_data.reporterSpecifications.empty() ) {
@@ -875,7 +876,8 @@ namespace Catch {
bool Config::listListeners() const { return m_data.listListeners; }
std::vector<std::string> const& Config::getTestsOrTags() const { return m_data.testsOrTags; }
std::vector<std::string> const& Config::getSectionsToRun() const { return m_data.sectionsToRun; }
std::vector<PathFilter> const& Config::getPathFilters() const { return m_data.pathFilters; }
bool Config::useNewFilterBehaviour() const { return m_data.useNewPathFilteringBehaviour; }
std::vector<ReporterSpec> const& Config::getReporterSpecs() const {
return m_data.reporterSpecifications;
@@ -903,6 +905,9 @@ namespace Catch {
bool Config::warnAboutUnmatchedTestSpecs() const {
return !!( m_data.warnings & WarnAbout::UnmatchedTestSpec );
}
bool Config::warnAboutInfiniteGenerators() const {
return !!( m_data.warnings & WarnAbout::InfiniteGenerator );
}
bool Config::zeroTestsCountAsSuccess() const { return m_data.allowZeroTests; }
ShowDurations Config::showDurations() const { return m_data.showDurations; }
double Config::minDuration() const { return m_data.minDuration; }
@@ -1018,7 +1023,9 @@ namespace Catch {
Capturer::Capturer( StringRef macroName,
SourceLineInfo const& lineInfo,
ResultWas::OfType resultType,
StringRef names ) {
StringRef names,
bool isScoped):
m_isScoped(isScoped) {
auto trimmed = [&] (size_t start, size_t end) {
while (names[start] == ',' || isspace(static_cast<unsigned char>(names[start]))) {
++start;
@@ -1079,15 +1086,21 @@ namespace Catch {
}
Capturer::~Capturer() {
assert( m_captured == m_messages.size() );
for (auto const& message : m_messages) {
IResultCapture::popScopedMessage( message.sequence );
if ( m_isScoped ) {
for ( auto const& message : m_messages ) {
IResultCapture::popScopedMessage( message.sequence );
}
}
}
void Capturer::captureValue( size_t index, std::string const& value ) {
assert( index < m_messages.size() );
m_messages[index].message += value;
IResultCapture::pushScopedMessage( CATCH_MOVE( m_messages[index] ) );
if ( m_isScoped ) {
IResultCapture::pushScopedMessage( CATCH_MOVE( m_messages[index] ) );
} else {
IResultCapture::addUnscopedMessage( CATCH_MOVE( m_messages[index] ) );
}
m_captured++;
}
@@ -2384,7 +2397,7 @@ namespace Catch {
}
Version const& libraryVersion() {
static Version version( 3, 12, 0, "", 0 );
static Version version( 3, 14, 0, "", 0 );
return version;
}
@@ -2410,14 +2423,6 @@ namespace Catch {
namespace Generators {
namespace Detail {
[[noreturn]]
void throw_generator_exception(char const* msg) {
Catch::throw_exception(GeneratorException{ msg });
}
} // end namespace Detail
GeneratorUntypedBase::~GeneratorUntypedBase() = default;
IGeneratorTracker* acquireGeneratorTracker(StringRef generatorName, SourceLineInfo const& lineInfo ) {
@@ -2465,6 +2470,27 @@ namespace Catch {
m_current_number = m_pimpl->dist( m_pimpl->rng );
return true;
}
bool RandomFloatingGenerator<long double>::isFinite() const {
return false;
}
} // namespace Generators
} // namespace Catch
namespace Catch {
namespace Generators {
namespace Detail {
[[noreturn]]
void throw_generator_exception( char const* msg ) {
Catch::throw_exception( GeneratorException{ msg } );
}
} // namespace Detail
} // namespace Generators
} // namespace Catch
@@ -2498,6 +2524,7 @@ namespace Catch {
#include <string>
namespace Catch {
@@ -2512,6 +2539,31 @@ namespace Catch {
return ret;
}
void GeneratorUntypedBase::skipToNthElementImpl( std::size_t n ) {
for ( size_t i = m_currentElementIndex; i < n; ++i ) {
bool isValid = next();
if ( !isValid ) {
Detail::throw_generator_exception(
"Coud not jump to Nth element: not enough elements" );
}
}
}
void GeneratorUntypedBase::skipToNthElement( std::size_t n ) {
if ( n < m_currentElementIndex ) {
Detail::throw_generator_exception(
"Tried to jump generator backwards" );
}
if ( n == m_currentElementIndex ) { return; }
skipToNthElementImpl(n);
// Fixup tracking after moving the generator forward
// * Ensure that the correct element index is set after skipping
// * Invalidate cache
m_currentElementIndex = n;
m_stringReprCache.clear();
}
StringRef GeneratorUntypedBase::currentElementAsString() const {
if ( m_stringReprCache.empty() ) {
m_stringReprCache = stringifyImpl();
@@ -2519,6 +2571,8 @@ namespace Catch {
return m_stringReprCache;
}
bool GeneratorUntypedBase::isFinite() const { return true; }
} // namespace Generators
} // namespace Catch
@@ -3199,6 +3253,9 @@ namespace Catch {
} else if ( warning == "UnmatchedTestSpec" ) {
config.warnings = static_cast<WarnAbout::What>(config.warnings | WarnAbout::UnmatchedTestSpec);
return ParserResult::ok( ParseResultType::Matched );
} else if ( warning == "InfiniteGenerators" ) {
config.warnings = static_cast<WarnAbout::What>(config.warnings | WarnAbout::InfiniteGenerator);
return ParserResult::ok( ParseResultType::Matched );
}
return ParserResult ::runtimeError(
@@ -3356,6 +3413,19 @@ namespace Catch {
config.shardCount = *parsedCount;
return ParserResult::ok( ParseResultType::Matched );
};
auto const setBenchmarkSamples = [&]( std::string const& samples ) {
auto parsedSamples = parseUInt( samples );
if ( !parsedSamples ) {
return ParserResult::runtimeError(
"Could not parse '" + samples + "' as benchmark samples" );
}
if ( *parsedSamples == 0 ) {
return ParserResult::runtimeError(
"Benchmark samples must be greater than 0" );
}
config.benchmarkSamples = *parsedSamples;
return ParserResult::ok( ParseResultType::Matched );
};
auto const setShardIndex = [&](std::string const& shardIndex) {
auto parsedIndex = parseUInt( shardIndex );
@@ -3367,6 +3437,43 @@ namespace Catch {
return ParserResult::ok( ParseResultType::Matched );
};
auto const setSectionFilter = [&]( std::string const& sectionFilter ) {
config.pathFilters.emplace_back( PathFilter::For::Section, trim(sectionFilter) );
return ParserResult::ok( ParseResultType::Matched );
};
auto const setGeneratorFilter = [&]( std::string const& generatorFilter ) {
if (generatorFilter != "*") {
// TODO: avoid re-parsing the index?
auto parsedIndex = parseUInt( generatorFilter );
if ( !parsedIndex ) {
return ParserResult::runtimeError( "Could not parse '" +
generatorFilter +
"' as generator index" );
}
}
config.useNewPathFilteringBehaviour = true;
config.pathFilters.emplace_back( PathFilter::For::Generator, trim(generatorFilter) );
return ParserResult::ok( ParseResultType::Matched );
};
// Copy-capturing other `setFoo` functions enables calling them later,
// as the config ref remains valid, but the local lambda vars won't.
auto const setPathFilter = [=, &config]( std::string const& pathFilter ) {
config.useNewPathFilteringBehaviour = true;
if ( pathFilter.size() < 3 ) {
return ParserResult::runtimeError(
"Path filter '" + pathFilter + "' is too short" );
}
if ( startsWith( pathFilter, "g:" ) ) {
return setGeneratorFilter( pathFilter.substr( 2 ) );
}
if ( startsWith( pathFilter, "c:" ) ) {
return setSectionFilter( pathFilter.substr( 2 ) );
}
return ParserResult::runtimeError( "Path filter '" + pathFilter +
"' has unknown type prefix" );
};
auto cli
= ExeName( config.processName )
| Help( config.showHelp )
@@ -3412,9 +3519,15 @@ namespace Catch {
| Opt( config.filenamesAsTags )
["-#"]["--filenames-as-tags"]
( "adds a tag for the filename" )
| Opt( config.sectionsToRun, "section name" )
| Opt( accept_many, setSectionFilter, "section name" )
["-c"]["--section"]
( "specify section to run" )
| Opt( accept_many, setGeneratorFilter, "index spec" )
["-g"]["--generator-index"]
( "specify generator elements to try" )
| Opt( accept_many, setPathFilter, "path filter spec" )
["-p"]["--path-filter"]
( "qualified path filter" )
| Opt( setVerbosity, "quiet|normal|high" )
["-v"]["--verbosity"]
( "set output verbosity" )
@@ -3448,7 +3561,7 @@ namespace Catch {
| Opt( config.skipBenchmarks)
["--skip-benchmarks"]
( "disable running benchmarks")
| Opt( config.benchmarkSamples, "samples" )
| Opt( setBenchmarkSamples, "samples" )
["--benchmark-samples"]
( "number of samples to collect (default: 100)" )
| Opt( config.benchmarkResamples, "resamples" )
@@ -5752,12 +5865,51 @@ namespace Catch {
struct GeneratorTracker final : TestCaseTracking::TrackerBase,
IGeneratorTracker {
GeneratorBasePtr m_generator;
// Filtered generator has moved to specific index due to
// a filter, it needs special handling of `countedNext()`
bool m_isFiltered = false;
GeneratorTracker(
TestCaseTracking::NameAndLocation&& nameAndLocation,
TrackerContext& ctx,
ITracker* parent ):
TrackerBase( CATCH_MOVE( nameAndLocation ), ctx, parent ) {}
ITracker* parent,
GeneratorBasePtr&& generator ):
TrackerBase( CATCH_MOVE( nameAndLocation ), ctx, parent ),
m_generator( CATCH_MOVE( generator ) ) {
assert( m_generator &&
"Cannot create tracker without generator" );
// Handle potential filter and move forward here...
// Old style filters do not affect generators at all
if (m_newStyleFilters && m_allTrackerDepth < m_filterRef->size()) {
auto const& filter =
( *m_filterRef )[m_allTrackerDepth];
// Generator cannot be un-entered the way a section
// can be, so the tracker has to throw for a wrong
// filter to stop the execution flow.
if (filter.type == PathFilter::For::Section) {
// 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
// not the generator itself.
if ( filter.filter != "*" ) {
m_isFiltered = true;
// TBD: We assume that the filter was validated as
// number during parsing. We should pass it
// as number from the CLI parser.
size_t targetIndex = std::stoul( filter.filter );
m_generator->skipToNthElement( targetIndex );
}
}
}
static GeneratorTracker*
acquire( TrackerContext& ctx,
@@ -5801,9 +5953,6 @@ namespace Catch {
// TrackerBase interface
bool isGeneratorTracker() const override { return true; }
auto hasGenerator() const -> bool override {
return !!m_generator;
}
void close() override {
TrackerBase::close();
// If a generator has a child (it is followed by a section)
@@ -5832,25 +5981,24 @@ namespace Catch {
// _can_ start, and thus we should wait for them, or
// they cannot start (due to filters), and we shouldn't
// wait for them
ITracker* parent = m_parent;
// This is safe: there is always at least one section
// tracker in a test case tracking tree
while ( !parent->isSectionTracker() ) {
parent = parent->parent();
// No filters left -> no restrictions on running sections
size_t childDepth = 1 + (m_newStyleFilters ? m_allTrackerDepth : m_sectionOnlyDepth);
if ( childDepth >= m_filterRef->size() ) {
return true;
}
assert( parent &&
"Missing root (test case) level section" );
auto const& parentSection =
static_cast<SectionTracker const&>( *parent );
auto const& filters = parentSection.getFilters();
// No filters -> no restrictions on running sections
if ( filters.empty() ) { return true; }
// If we are using the new style filters, we need to check
// whether the successive filter is for section or a generator.
if ( m_newStyleFilters
&& (*m_filterRef)[childDepth].type != PathFilter::For::Section ) {
return false;
}
// Look for any child section that could match the remaining filters
for ( auto const& child : m_children ) {
if ( child->isSectionTracker() &&
static_cast<SectionTracker const&>( *child )
.trimmedName() == filters[0] ) {
.trimmedName() == StringRef((*m_filterRef)[childDepth].filter) ) {
return true;
}
}
@@ -5862,9 +6010,10 @@ namespace Catch {
// value, but we do not want to invoke the side-effect if
// this generator is still waiting for any child to start.
assert( m_generator && "Tracker without generator" );
if ( should_wait_for_child ||
( m_runState == CompletedSuccessfully &&
m_generator->countedNext() ) ) {
if ( should_wait_for_child
|| ( m_runState == CompletedSuccessfully
&& !m_isFiltered // filtered generators cannot meaningfully move forward, as they would get past the filter
&& m_generator->countedNext() ) ) {
m_children.clear();
m_runState = Executing;
}
@@ -5874,9 +6023,6 @@ namespace Catch {
auto getGenerator() const -> GeneratorBasePtr const& override {
return m_generator;
}
void setGenerator( GeneratorBasePtr&& generator ) override {
m_generator = CATCH_MOVE( generator );
}
};
} // namespace
}
@@ -5930,15 +6076,18 @@ namespace Catch {
// we only keep around the raw msg ids.
~MessageHolder() = default;
void addUnscopedMessage(MessageBuilder&& builder) {
void addUnscopedMessage( MessageInfo&& info ) {
repairUnscopedMessageInvariant();
MessageInfo info( CATCH_MOVE( builder.m_info ) );
info.message = builder.m_stream.str();
unscoped_ids.push_back( info.sequence );
messages.push_back( CATCH_MOVE( info ) );
}
void addUnscopedMessage(MessageBuilder&& builder) {
MessageInfo info( CATCH_MOVE( builder.m_info ) );
info.message = builder.m_stream.str();
addUnscopedMessage( CATCH_MOVE( info ) );
}
void addScopedMessage(MessageInfo&& info) {
messages.push_back( CATCH_MOVE( info ) );
}
@@ -6027,7 +6176,8 @@ namespace Catch {
ITracker& rootTracker = m_trackerContext.startRun();
assert(rootTracker.isSectionTracker());
static_cast<SectionTracker&>(rootTracker).addInitialFilters(m_config->getSectionsToRun());
rootTracker.setFilters( &m_config->getPathFilters(),
m_config->useNewFilterBehaviour() );
// We intentionally only seed the internal RNG once per test case,
// before it is first invoked. The reason for that is a complex
@@ -6199,18 +6349,32 @@ namespace Catch {
SourceLineInfo lineInfo,
Generators::GeneratorBasePtr&& generator ) {
// TBD: Do we want to avoid the warning if the generator is filtered?
if ( m_config->warnAboutInfiniteGenerators() &&
!generator->isFinite() ) {
// 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 );
auto& currentTracker = m_trackerContext.currentTracker();
assert(
currentTracker.nameAndLocation() != nameAndLoc &&
"Trying to create tracker for a generator that already has one" );
auto newTracker = Catch::Detail::make_unique<Generators::GeneratorTracker>(
CATCH_MOVE(nameAndLoc), m_trackerContext, &currentTracker );
auto newTracker =
Catch::Detail::make_unique<Generators::GeneratorTracker>(
CATCH_MOVE( nameAndLoc ),
m_trackerContext,
&currentTracker,
CATCH_MOVE( generator ) );
auto ret = newTracker.get();
currentTracker.addChild( CATCH_MOVE( newTracker ) );
ret->setGenerator( CATCH_MOVE( generator ) );
ret->open();
return ret;
}
@@ -6613,6 +6777,10 @@ namespace Catch {
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());
}
@@ -7171,6 +7339,17 @@ namespace TestCaseTracking {
location( _location )
{}
ITracker::ITracker( NameAndLocation&& nameAndLoc, ITracker* parent ):
m_nameAndLocation( CATCH_MOVE( nameAndLoc ) ), m_parent( parent ) {
if ( m_parent ) {
m_allTrackerDepth = m_parent->m_allTrackerDepth + 1;
// We leave section trackers to bump themselves up, as
// we cannot use `isSectionTracker` in constructor
m_sectionOnlyDepth = m_parent->m_sectionOnlyDepth;
m_filterRef = m_parent->m_filterRef;
m_newStyleFilters = m_parent->m_newStyleFilters;
}
}
ITracker::~ITracker() = default;
@@ -7303,25 +7482,32 @@ namespace TestCaseTracking {
: TrackerBase( CATCH_MOVE(nameAndLocation), ctx, parent ),
m_trimmed_name(trim(StringRef(ITracker::nameAndLocation().name)))
{
if( parent ) {
while ( !parent->isSectionTracker() ) {
parent = parent->parent();
}
SectionTracker& parentSection = static_cast<SectionTracker&>( *parent );
addNextFilters( parentSection.m_filters );
if( m_parent ) {
++m_sectionOnlyDepth;
}
}
bool SectionTracker::isComplete() const {
bool complete = true;
if ( m_filters.empty()
|| m_filters[0].empty()
|| m_filters[0] == m_trimmed_name ) {
complete = TrackerBase::isComplete();
// If there are active filters AND we do not pass them,
// the section is always "completed"
const size_t filterIndex =
m_newStyleFilters ? m_allTrackerDepth : m_sectionOnlyDepth;
if ( filterIndex < m_filterRef->size() ) {
// There is active filter, check it
// 1) New style filter must explicitly target section
if ( m_newStyleFilters && ( *m_filterRef )[filterIndex].type !=
PathFilter::For::Section ) {
return true;
}
// 2) Both style filters must match the trimmed name exactly
if ( m_trimmed_name !=
StringRef( ( *m_filterRef )[filterIndex].filter ) ) {
return true;
}
}
return complete;
// Otherwise we delegate to the generic processing
return TrackerBase::isComplete();
}
bool SectionTracker::isSectionTracker() const { return true; }
@@ -7357,19 +7543,6 @@ namespace TestCaseTracking {
open();
}
void SectionTracker::addInitialFilters( std::vector<std::string> const& filters ) {
if( !filters.empty() ) {
m_filters.reserve( m_filters.size() + filters.size() + 2 );
m_filters.emplace_back(StringRef{}); // Root - should never be consulted
m_filters.emplace_back(StringRef{}); // Test Case - not a section filter
m_filters.insert( m_filters.end(), filters.begin(), filters.end() );
}
}
void SectionTracker::addNextFilters( std::vector<StringRef> const& filters ) {
if( filters.size() > 1 )
m_filters.insert( m_filters.end(), filters.begin()+1, filters.end() );
}
StringRef SectionTracker::trimmedName() const {
return m_trimmed_name;
}
@@ -7729,6 +7902,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 {
@@ -7755,6 +7932,11 @@ namespace Catch {
if ( it != m_string.end() ) {
++m_size;
++it;
// Skip UTF-8 continuation bytes
while ( it != m_string.end() &&
isUtf8ContinuationByte( *it ) ) {
++it;
}
}
}
}
@@ -7817,6 +7999,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();
}
@@ -7836,6 +8023,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,
@@ -8988,12 +9180,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) {
@@ -9005,7 +9197,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
@@ -10216,7 +10408,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()) {
@@ -10249,7 +10449,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 {
@@ -10268,7 +10475,7 @@ 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 ) );
@@ -11025,70 +11232,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
+315 -86
View File
@@ -6,8 +6,8 @@
// SPDX-License-Identifier: BSL-1.0
// Catch v3.12.0
// Generated: 2025-12-28 22:27:25.408132
// Catch v3.14.0
// Generated: 2026-04-05 15:03:01.150393
// ----------------------------------------------------------
// This file is an amalgamation of multiple different files.
// You probably shouldn't edit it directly.
@@ -201,10 +201,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\"" )
@@ -299,7 +304,7 @@
////////////////////////////////////////////////////////////////////////////////
// Visual C++
#if defined(_MSC_VER)
#if defined(_MSC_VER) && !defined(__clang__)
// We want to defer to nvcc-specific warning suppression if we are compiled
// with nvcc masquerading for MSVC.
@@ -310,6 +315,11 @@
__pragma( warning( pop ) )
# endif
// Suppress MSVC C++ Core Guidelines checker warning 26426:
// "Global initializer calls a non-constexpr function (i.22)"
# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
__pragma( warning( disable : 26426 ) )
// Universal Windows platform does not support SEH
# if !defined(CATCH_PLATFORM_WINDOWS_UWP)
# define CATCH_INTERNAL_CONFIG_WINDOWS_SEH
@@ -515,6 +525,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
@@ -673,8 +686,20 @@ namespace Catch {
#endif // CATCH_CONFIG_COUNTER_HPP_INCLUDED
// 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
@@ -1006,35 +1031,16 @@ namespace Detail {
#ifndef CATCH_BENCHMARK_STATS_FWD_HPP_INCLUDED
#define CATCH_BENCHMARK_STATS_FWD_HPP_INCLUDED
// Adapted from donated nonius code.
#ifndef CATCH_CLOCK_HPP_INCLUDED
#define CATCH_CLOCK_HPP_INCLUDED
#include <chrono>
namespace Catch {
namespace Benchmark {
using IDuration = std::chrono::nanoseconds;
using FDuration = std::chrono::duration<double, std::nano>;
template <typename Clock>
using TimePoint = typename Clock::time_point;
using default_clock = std::chrono::steady_clock;
} // namespace Benchmark
} // namespace Catch
#endif // CATCH_CLOCK_HPP_INCLUDED
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 dependees
template <typename Duration = Benchmark::FDuration>
// we can prevent multiple declarations in dependencies
template <typename Duration = Detail::DummyTemplateArgPlaceholder>
struct BenchmarkStats;
} // end namespace Catch
@@ -1090,6 +1096,7 @@ namespace Catch {
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;
@@ -1189,6 +1196,8 @@ namespace Catch {
NoAssertions = 0x01,
//! A command line test spec matched no test cases
UnmatchedTestSpec = 0x02,
//! The resulting generator in GENERATE is infinite
InfiniteGenerator = 0x04,
}; };
enum class ShowDurations {
@@ -1220,6 +1229,7 @@ namespace Catch {
class TestSpec;
class IStream;
struct PathFilter;
class IConfig : public Detail::NonCopyable {
public:
@@ -1231,6 +1241,7 @@ namespace Catch {
virtual bool shouldDebugBreak() const = 0;
virtual bool warnAboutMissingAssertions() const = 0;
virtual bool warnAboutUnmatchedTestSpecs() const = 0;
virtual bool warnAboutInfiniteGenerators() const = 0;
virtual bool zeroTestsCountAsSuccess() const = 0;
virtual int abortAfter() const = 0;
virtual bool showInvisibles() const = 0;
@@ -1244,7 +1255,9 @@ namespace Catch {
virtual unsigned int shardCount() const = 0;
virtual unsigned int shardIndex() const = 0;
virtual ColourMode defaultColourMode() const = 0;
virtual std::vector<std::string> const& getSectionsToRun() const = 0;
virtual std::vector<PathFilter> const& getPathFilters() const = 0;
virtual bool useNewFilterBehaviour() const = 0;
virtual Verbosity verbosity() const = 0;
virtual bool skipBenchmarks() const = 0;
@@ -1324,6 +1337,28 @@ namespace Catch {
// Adapted from donated nonius code.
#ifndef CATCH_CLOCK_HPP_INCLUDED
#define CATCH_CLOCK_HPP_INCLUDED
#include <chrono>
namespace Catch {
namespace Benchmark {
using IDuration = std::chrono::nanoseconds;
using FDuration = std::chrono::duration<double, std::nano>;
template <typename Clock>
using TimePoint = typename Clock::time_point;
using default_clock = std::chrono::steady_clock;
} // namespace Benchmark
} // namespace Catch
#endif // CATCH_CLOCK_HPP_INCLUDED
// Adapted from donated nonius code.
#ifndef CATCH_ESTIMATE_HPP_INCLUDED
@@ -3630,6 +3665,33 @@ namespace Catch {
#endif // CATCH_OPTIONAL_HPP_INCLUDED
#ifndef CATCH_PATH_FILTER_HPP_INCLUDED
#define CATCH_PATH_FILTER_HPP_INCLUDED
#include <string>
namespace Catch {
struct PathFilter {
enum class For {
Section,
Generator,
};
PathFilter( For type_, std::string filter_ ):
type( type_ ), filter( CATCH_MOVE( filter_ ) ) {}
For type;
std::string filter;
friend bool operator==( PathFilter const& lhs, PathFilter const& rhs );
};
} // end namespace Catch
#endif // CATCH_PATH_FILTER_HPP_INCLUDED
#ifndef CATCH_RANDOM_SEED_GENERATION_HPP_INCLUDED
#define CATCH_RANDOM_SEED_GENERATION_HPP_INCLUDED
@@ -3797,7 +3859,8 @@ namespace Catch {
std::vector<ReporterSpec> reporterSpecifications;
std::vector<std::string> testsOrTags;
std::vector<std::string> sectionsToRun;
std::vector<PathFilter> pathFilters;
bool useNewPathFilteringBehaviour = false;
std::string prematureExitGuardFilePath;
};
@@ -3820,7 +3883,8 @@ namespace Catch {
getProcessedReporterSpecs() const;
std::vector<std::string> const& getTestsOrTags() const override;
std::vector<std::string> const& getSectionsToRun() const override;
std::vector<PathFilter> const& getPathFilters() const override;
bool useNewFilterBehaviour() const override;
TestSpec const& testSpec() const override;
bool hasTestFilters() const override;
@@ -3835,6 +3899,7 @@ namespace Catch {
bool includeSuccessfulResults() const override;
bool warnAboutMissingAssertions() const override;
bool warnAboutUnmatchedTestSpecs() const override;
bool warnAboutInfiniteGenerators() const override;
bool zeroTestsCountAsSuccess() const override;
ShowDurations showDurations() const override;
double minDuration() const override;
@@ -3943,9 +4008,9 @@ namespace Catch {
#if !defined( CATCH_CONFIG_NO_DEPRECATION_ANNOTATIONS )
# define DEPRECATED( msg ) [[deprecated( msg )]]
# define CATCH_DEPRECATED( msg ) [[deprecated( msg )]]
#else
# define DEPRECATED( msg )
# define CATCH_DEPRECATED( msg )
#endif
#endif // CATCH_DEPRECATION_MACRO_HPP_INCLUDED
@@ -3966,11 +4031,11 @@ namespace Catch {
// The "ID" of the message, used to know when to remove it from reporter context.
unsigned int sequence;
DEPRECATED( "Explicitly use the 'sequence' member instead" )
CATCH_DEPRECATED( "Explicitly use the 'sequence' member instead" )
bool operator == (MessageInfo const& other) const {
return sequence == other.sequence;
}
DEPRECATED( "Explicitly use the 'sequence' member instead" )
CATCH_DEPRECATED( "Explicitly use the 'sequence' member instead" )
bool operator < (MessageInfo const& other) const {
return sequence < other.sequence;
}
@@ -4028,8 +4093,9 @@ namespace Catch {
class Capturer {
std::vector<MessageInfo> m_messages;
size_t m_captured = 0;
bool m_isScoped = false;
public:
Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names );
Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names, bool isScoped );
Capturer(Capturer const&) = delete;
Capturer& operator=(Capturer const&) = delete;
@@ -4061,11 +4127,12 @@ namespace Catch {
} while( false )
///////////////////////////////////////////////////////////////////////////////
#define INTERNAL_CATCH_CAPTURE( varName, macroName, ... ) \
Catch::Capturer varName( macroName##_catch_sr, \
CATCH_INTERNAL_LINEINFO, \
Catch::ResultWas::Info, \
#__VA_ARGS__##_catch_sr ); \
#define INTERNAL_CATCH_CAPTURE( varName, macroName, scopedCapture, ... ) \
Catch::Capturer varName( macroName##_catch_sr, \
CATCH_INTERNAL_LINEINFO, \
Catch::ResultWas::Info, \
#__VA_ARGS__##_catch_sr, \
scopedCapture ); \
varName.captureValues( 0, __VA_ARGS__ )
///////////////////////////////////////////////////////////////////////////////
@@ -4082,28 +4149,32 @@ namespace Catch {
#define CATCH_INFO( msg ) INTERNAL_CATCH_INFO( "CATCH_INFO", msg )
#define CATCH_UNSCOPED_INFO( msg ) INTERNAL_CATCH_UNSCOPED_INFO( "CATCH_UNSCOPED_INFO", msg )
#define CATCH_WARN( msg ) INTERNAL_CATCH_MSG( "CATCH_WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg )
#define CATCH_CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CATCH_CAPTURE", __VA_ARGS__ )
#define CATCH_CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CATCH_CAPTURE", true, __VA_ARGS__ )
#define CATCH_UNSCOPED_CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CATCH_UNSCOPED_CAPTURE", false, __VA_ARGS__ )
#elif defined(CATCH_CONFIG_PREFIX_MESSAGES) && defined(CATCH_CONFIG_DISABLE)
#define CATCH_INFO( msg ) (void)(0)
#define CATCH_UNSCOPED_INFO( msg ) (void)(0)
#define CATCH_WARN( msg ) (void)(0)
#define CATCH_CAPTURE( ... ) (void)(0)
#define CATCH_INFO( msg ) (void)(0)
#define CATCH_UNSCOPED_INFO( msg ) (void)(0)
#define CATCH_WARN( msg ) (void)(0)
#define CATCH_CAPTURE( ... ) (void)(0)
#define CATCH_UNSCOPED_CAPTURE( ... ) (void)(0)
#elif !defined(CATCH_CONFIG_PREFIX_MESSAGES) && !defined(CATCH_CONFIG_DISABLE)
#define INFO( msg ) INTERNAL_CATCH_INFO( "INFO", msg )
#define UNSCOPED_INFO( msg ) INTERNAL_CATCH_UNSCOPED_INFO( "UNSCOPED_INFO", msg )
#define WARN( msg ) INTERNAL_CATCH_MSG( "WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg )
#define CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CAPTURE", __VA_ARGS__ )
#define CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CAPTURE", true, __VA_ARGS__ )
#define UNSCOPED_CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "UNSCOPED_CAPTURE", false, __VA_ARGS__ )
#elif !defined(CATCH_CONFIG_PREFIX_MESSAGES) && defined(CATCH_CONFIG_DISABLE)
#define INFO( msg ) (void)(0)
#define UNSCOPED_INFO( msg ) (void)(0)
#define WARN( msg ) (void)(0)
#define CAPTURE( ... ) (void)(0)
#define INFO( msg ) (void)(0)
#define UNSCOPED_INFO( msg ) (void)(0)
#define WARN( msg ) (void)(0)
#define CAPTURE( ... ) (void)(0)
#define UNSCOPED_CAPTURE( ... ) (void)(0)
#endif // end of user facing macro declarations
@@ -7466,7 +7537,7 @@ namespace Catch {
#define CATCH_VERSION_MACROS_HPP_INCLUDED
#define CATCH_VERSION_MAJOR 3
#define CATCH_VERSION_MINOR 12
#define CATCH_VERSION_MINOR 14
#define CATCH_VERSION_PATCH 0
#endif // CATCH_VERSION_MACROS_HPP_INCLUDED
@@ -7521,6 +7592,24 @@ namespace Catch {
#ifndef CATCH_GENERATORS_THROW_HPP_INCLUDED
#define CATCH_GENERATORS_THROW_HPP_INCLUDED
namespace Catch {
namespace Generators {
namespace Detail {
//! Throws GeneratorException with the provided message
[[noreturn]]
void throw_generator_exception( char const* msg );
} // namespace Detail
} // namespace Generators
} // namespace Catch
#endif // CATCH_GENERATORS_THROW_HPP_INCLUDED
#ifndef CATCH_INTERFACES_GENERATORTRACKER_HPP_INCLUDED
#define CATCH_INTERFACES_GENERATORTRACKER_HPP_INCLUDED
@@ -7549,6 +7638,15 @@ namespace Catch {
//! Customization point for `currentElementAsString`
virtual std::string stringifyImpl() const = 0;
/**
* Customization point for skipping to the n-th element
*
* Defaults to successively calling `countedNext`. If there
* are not enough elements to reach the nth one, will throw
* an error.
*/
virtual void skipToNthElementImpl( std::size_t n );
public:
GeneratorUntypedBase() = default;
// Generation of copy ops is deprecated (and Clang will complain)
@@ -7572,6 +7670,13 @@ namespace Catch {
std::size_t currentElementIndex() const { return m_currentElementIndex; }
/**
* Moves the generator forward **to** the n-th element
*
* Cannot move backwards. Can stay in place.
*/
void skipToNthElement( std::size_t n );
/**
* Returns generator's current element as user-friendly string.
*
@@ -7586,6 +7691,15 @@ namespace Catch {
* comes first.
*/
StringRef currentElementAsString() const;
/**
* Returns true if calls to `next` will eventually return false
*
* Note that for backwards compatibility this is currently defaulted
* to return `true`, but in the future all generators will have to
* provide their own implementation.
*/
virtual bool isFinite() const;
};
using GeneratorBasePtr = Catch::Detail::unique_ptr<GeneratorUntypedBase>;
@@ -7594,9 +7708,7 @@ namespace Catch {
class IGeneratorTracker {
public:
virtual ~IGeneratorTracker(); // = default;
virtual auto hasGenerator() const -> bool = 0;
virtual auto getGenerator() const -> Generators::GeneratorBasePtr const& = 0;
virtual void setGenerator( Generators::GeneratorBasePtr&& generator ) = 0;
};
} // namespace Catch
@@ -7610,14 +7722,6 @@ namespace Catch {
namespace Generators {
namespace Detail {
//! Throws GeneratorException with the provided message
[[noreturn]]
void throw_generator_exception(char const * msg);
} // end namespace detail
template<typename T>
class IGenerator : public GeneratorUntypedBase {
std::string stringifyImpl() const override {
@@ -7652,6 +7756,9 @@ namespace Detail {
bool next() {
return m_generator->countedNext();
}
bool isFinite() const { return m_generator->isFinite(); }
void skipToNthElement( size_t n ) { m_generator->skipToNthElement(n); }
};
@@ -7672,6 +7779,8 @@ namespace Detail {
bool next() override {
return false;
}
bool isFinite() const override { return true; }
};
template<typename T>
@@ -7681,6 +7790,15 @@ namespace Detail {
"specialization, use SingleValue Generator instead.");
std::vector<T> m_values;
size_t m_idx = 0;
void skipToNthElementImpl( std::size_t n ) override {
if ( n >= m_values.size() ) {
Detail::throw_generator_exception(
"Coud not jump to Nth element: not enough elements" );
}
m_idx = n;
}
public:
FixedValuesGenerator( std::initializer_list<T> values ) : m_values( values ) {}
@@ -7691,6 +7809,8 @@ namespace Detail {
++m_idx;
return m_idx < m_values.size();
}
bool isFinite() const override { return true; }
};
template <typename T, typename DecayedT = std::decay_t<T>>
@@ -7755,6 +7875,14 @@ namespace Detail {
}
return m_current < m_generators.size();
}
bool isFinite() const override {
for (auto const& gen : m_generators) {
if (!gen.isFinite()) { return false;
}
}
return true;
}
};
@@ -7846,6 +7974,17 @@ namespace Generators {
GeneratorWrapper<T> m_generator;
size_t m_returned = 0;
size_t m_target;
void skipToNthElementImpl( std::size_t n ) override {
if ( n >= m_target ) {
Detail::throw_generator_exception(
"Coud not jump to Nth element: not enough elements" );
}
m_generator.skipToNthElement( n );
m_returned = n;
}
public:
TakeGenerator(size_t target, GeneratorWrapper<T>&& generator):
m_generator(CATCH_MOVE(generator)),
@@ -7870,6 +8009,8 @@ namespace Generators {
}
return success;
}
bool isFinite() const override { return true; }
};
template <typename T>
@@ -7911,6 +8052,8 @@ namespace Generators {
while (!m_predicate(m_generator.get()) && (success = m_generator.next()) == true);
return success;
}
bool isFinite() const override { return m_generator.isFinite(); }
};
@@ -7935,6 +8078,9 @@ namespace Generators {
m_target_repeats(repeats)
{
assert(m_target_repeats > 0 && "Repeat generator must repeat at least once");
if (!m_generator.isFinite()) {
Detail::throw_generator_exception( "Cannot repeat infinite generator" );
}
}
T const& get() const override {
@@ -7968,6 +8114,8 @@ namespace Generators {
}
return m_current_repeat < m_target_repeats;
}
bool isFinite() const override { return m_generator.isFinite(); }
};
template <typename T>
@@ -7981,25 +8129,30 @@ namespace Generators {
GeneratorWrapper<U> m_generator;
Func m_function;
// To avoid returning dangling reference, we have to save the values
T m_cache;
mutable Optional<T> m_cache;
void skipToNthElementImpl( std::size_t n ) override {
m_generator.skipToNthElement( n );
m_cache.reset();
}
public:
template <typename F2 = Func>
MapGenerator(F2&& function, GeneratorWrapper<U>&& generator) :
m_generator(CATCH_MOVE(generator)),
m_function(CATCH_FORWARD(function)),
m_cache(m_function(m_generator.get()))
m_function(CATCH_FORWARD(function))
{}
T const& get() const override {
return m_cache;
if ( !m_cache ) { m_cache = m_function( m_generator.get() ); }
return *m_cache;
}
bool next() override {
const auto success = m_generator.next();
if (success) {
m_cache = m_function(m_generator.get());
}
return success;
m_cache.reset();
return m_generator.next();
}
bool isFinite() const override { return m_generator.isFinite(); }
};
template <typename Func, typename U, typename T = FunctionReturnType<Func, U>>
@@ -8021,7 +8174,6 @@ namespace Generators {
std::vector<T> m_chunk;
size_t m_chunk_size;
GeneratorWrapper<T> m_generator;
bool m_used_up = false;
public:
ChunkGenerator(size_t size, GeneratorWrapper<T> generator) :
m_chunk_size(size), m_generator(CATCH_MOVE(generator))
@@ -8050,6 +8202,8 @@ namespace Generators {
}
return true;
}
bool isFinite() const override { return m_generator.isFinite(); }
};
template <typename T>
@@ -8059,6 +8213,56 @@ namespace Generators {
);
}
template <typename T>
class ConcatGenerator final : public IGenerator<T> {
std::vector<GeneratorWrapper<T>> m_generators;
size_t m_current_generator = 0;
void InsertGenerators( GeneratorWrapper<T>&& gen ) {
m_generators.push_back( CATCH_MOVE( gen ) );
}
template <typename... Generators>
void InsertGenerators( GeneratorWrapper<T>&& gen, Generators&&... gens ) {
m_generators.push_back( CATCH_MOVE( gen ) );
InsertGenerators( CATCH_MOVE( gens )... );
}
public:
template <typename... Generators>
ConcatGenerator( Generators&&... generators ) {
InsertGenerators( CATCH_MOVE( generators )... );
}
T const& get() const override {
return m_generators[m_current_generator].get();
}
bool next() override {
const bool success = m_generators[m_current_generator].next();
if ( success ) { return true; }
// If current generator is used up, we have to move to the next one
++m_current_generator;
return m_current_generator < m_generators.size();
}
bool isFinite() const override {
for ( auto const& gen : m_generators ) {
if ( !gen.isFinite() ) { return false; }
}
return true;
}
};
template <typename T, typename... Generators>
GeneratorWrapper<T> cat( GeneratorWrapper<T>&& generator,
Generators&&... generators ) {
return GeneratorWrapper<T>(
Catch::Detail::make_unique<ConcatGenerator<T>>(
CATCH_MOVE( generator ), CATCH_MOVE( generators )... ) );
}
} // namespace Generators
} // namespace Catch
@@ -8701,6 +8905,7 @@ public:
m_current_number = m_dist(m_rng);
return true;
}
bool isFinite() const override { return false; }
};
template <>
@@ -8718,6 +8923,7 @@ public:
bool next() override;
~RandomFloatingGenerator() override; // = default
bool isFinite() const override;
};
template <typename Integer>
@@ -8739,6 +8945,7 @@ public:
m_current_number = m_dist(m_rng);
return true;
}
bool isFinite() const override { return false; }
};
template <typename T>
@@ -8808,6 +9015,8 @@ public:
m_current += m_step;
return (m_positive) ? (m_current < m_end) : (m_current > m_end);
}
bool isFinite() const override { return true; }
};
template <typename T>
@@ -8847,6 +9056,8 @@ public:
++m_current;
return m_current != m_elems.size();
}
bool isFinite() const override { return true; }
};
template <typename InputIterator,
@@ -10378,6 +10589,9 @@ namespace Catch {
#include <vector>
namespace Catch {
struct PathFilter;
namespace TestCaseTracking {
struct NameAndLocation {
@@ -10453,12 +10667,23 @@ namespace TestCaseTracking {
Children m_children;
CycleState m_runState = NotStarted;
public:
ITracker( NameAndLocation&& nameAndLoc, ITracker* parent ):
m_nameAndLocation( CATCH_MOVE(nameAndLoc) ),
m_parent( parent )
{}
// Members for path filtering
std::vector<PathFilter> const* m_filterRef = nullptr;
// Note: There are 2 dummy section trackers (root, test-case) before
// the first "real" section tracker can be encountered. We start
// the default tracker at -2, so that the first "real" section
// tracker overflows to index 0.
// Nesting depth of this tracker, used to decide which new-style filter applies.
size_t m_allTrackerDepth = static_cast<size_t>( -2 );
// Nesting depth of sections (inc. this tracker), used for old-style filters.
// Must be updated by the section tracker on its own.
size_t m_sectionOnlyDepth = static_cast<size_t>( -2 );
// Transitory: Remove once we remove backwards compatibility with old-style (v3.x) filters
bool m_newStyleFilters = false;
public:
ITracker( NameAndLocation&& nameAndLoc, ITracker* parent );
// static queries
NameAndLocation const& nameAndLocation() const {
@@ -10484,6 +10709,11 @@ namespace TestCaseTracking {
//! Returns true iff tracker has started
bool hasStarted() const;
void setFilters( std::vector<PathFilter> const* filters, bool newStyleFilters ) {
m_filterRef = filters;
m_newStyleFilters = newStyleFilters;
}
// actions
virtual void close() = 0; // Successfully complete
virtual void fail() = 0;
@@ -10569,8 +10799,7 @@ namespace TestCaseTracking {
void moveToThis();
};
class SectionTracker : public TrackerBase {
std::vector<StringRef> m_filters;
class SectionTracker final : public TrackerBase {
// Note that lifetime-wise we piggy back off the name stored in the `ITracker` parent`.
// Currently it allocates owns the name, so this is safe. If it is later refactored
// to not own the name, the name still has to outlive the `ITracker` parent, so
@@ -10587,10 +10816,6 @@ namespace TestCaseTracking {
void tryOpen();
void addInitialFilters( std::vector<std::string> const& filters );
void addNextFilters( std::vector<StringRef> const& filters );
//! Returns filters active in this tracker
std::vector<StringRef> const& getFilters() const { return m_filters; }
//! Returns whitespace-trimmed name of the tracked section
StringRef trimmedName() const;
};
@@ -13765,7 +13990,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
@@ -13774,7 +14000,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
@@ -13924,7 +14153,7 @@ namespace Catch {
bool testOkToFail );
void writeAssertions(SectionNode const& sectionNode);
void writeAssertion(AssertionStats const& stats);
bool writeAssertion(AssertionStats const& stats);
XmlWriter xml;
Timer suiteTimer;
+1
View File
@@ -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) {
+1
View File
@@ -13,6 +13,7 @@
#include <string>
#include <string_view>
#include <cstdint>
template<class Callback>
+1 -1
View File
@@ -8,7 +8,7 @@
project(
'catch2',
'cpp',
version: '3.12.0', # CML version placeholder, don't delete
version: '3.14.0', # CML version placeholder, don't delete
license: 'BSL-1.0',
meson_version: '>=0.54.1',
)
+3
View File
@@ -108,6 +108,7 @@ set(IMPL_HEADERS
${SOURCES_DIR}/internal/catch_optional.hpp
${SOURCES_DIR}/internal/catch_output_redirect.hpp
${SOURCES_DIR}/internal/catch_parse_numbers.hpp
${SOURCES_DIR}/internal/catch_path_filter.hpp
${SOURCES_DIR}/internal/catch_platform.hpp
${SOURCES_DIR}/internal/catch_polyfills.hpp
${SOURCES_DIR}/internal/catch_preprocessor.hpp
@@ -255,11 +256,13 @@ set(GENERATOR_HEADERS
${SOURCES_DIR}/generators/catch_generators_all.hpp
${SOURCES_DIR}/generators/catch_generators_random.hpp
${SOURCES_DIR}/generators/catch_generators_range.hpp
${SOURCES_DIR}/generators/catch_generators_throw.hpp
)
set(GENERATOR_SOURCES
${SOURCES_DIR}/generators/catch_generator_exception.cpp
${SOURCES_DIR}/generators/catch_generators.cpp
${SOURCES_DIR}/generators/catch_generators_random.cpp
${SOURCES_DIR}/generators/catch_generators_throw.cpp
)
set(GENERATOR_FILES ${GENERATOR_HEADERS} ${GENERATOR_SOURCES})
@@ -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 dependees
template <typename Duration = Benchmark::FDuration>
// we can prevent multiple declarations in dependencies
template <typename Duration = Detail::DummyTemplateArgPlaceholder>
struct BenchmarkStats;
} // end namespace Catch
+1
View File
@@ -89,6 +89,7 @@
#include <catch2/internal/catch_optional.hpp>
#include <catch2/internal/catch_output_redirect.hpp>
#include <catch2/internal/catch_parse_numbers.hpp>
#include <catch2/internal/catch_path_filter.hpp>
#include <catch2/internal/catch_platform.hpp>
#include <catch2/internal/catch_polyfills.hpp>
#include <catch2/internal/catch_preprocessor.hpp>
+9 -4
View File
@@ -92,6 +92,10 @@ namespace Catch {
lhs.customOptions == rhs.customOptions;
}
bool operator==( PathFilter const& lhs, PathFilter const& rhs ) {
return lhs.type == rhs.type && lhs.filter == rhs.filter;
}
Config::Config( ConfigData const& data ):
m_data( data ) {
// We need to trim filter specs to avoid trouble with superfluous
@@ -101,9 +105,6 @@ namespace Catch {
for (auto& elem : m_data.testsOrTags) {
elem = trim(elem);
}
for (auto& elem : m_data.sectionsToRun) {
elem = trim(elem);
}
// Insert the default reporter if user hasn't asked for a specific one
if ( m_data.reporterSpecifications.empty() ) {
@@ -169,7 +170,8 @@ namespace Catch {
bool Config::listListeners() const { return m_data.listListeners; }
std::vector<std::string> const& Config::getTestsOrTags() const { return m_data.testsOrTags; }
std::vector<std::string> const& Config::getSectionsToRun() const { return m_data.sectionsToRun; }
std::vector<PathFilter> const& Config::getPathFilters() const { return m_data.pathFilters; }
bool Config::useNewFilterBehaviour() const { return m_data.useNewPathFilteringBehaviour; }
std::vector<ReporterSpec> const& Config::getReporterSpecs() const {
return m_data.reporterSpecifications;
@@ -197,6 +199,9 @@ namespace Catch {
bool Config::warnAboutUnmatchedTestSpecs() const {
return !!( m_data.warnings & WarnAbout::UnmatchedTestSpec );
}
bool Config::warnAboutInfiniteGenerators() const {
return !!( m_data.warnings & WarnAbout::InfiniteGenerator );
}
bool Config::zeroTestsCountAsSuccess() const { return m_data.allowZeroTests; }
ShowDurations Config::showDurations() const { return m_data.showDurations; }
double Config::minDuration() const { return m_data.minDuration; }
+6 -2
View File
@@ -12,6 +12,7 @@
#include <catch2/interfaces/catch_interfaces_config.hpp>
#include <catch2/internal/catch_unique_ptr.hpp>
#include <catch2/internal/catch_optional.hpp>
#include <catch2/internal/catch_path_filter.hpp>
#include <catch2/internal/catch_stringref.hpp>
#include <catch2/internal/catch_random_seed_generation.hpp>
#include <catch2/internal/catch_reporter_spec_parser.hpp>
@@ -86,7 +87,8 @@ namespace Catch {
std::vector<ReporterSpec> reporterSpecifications;
std::vector<std::string> testsOrTags;
std::vector<std::string> sectionsToRun;
std::vector<PathFilter> pathFilters;
bool useNewPathFilteringBehaviour = false;
std::string prematureExitGuardFilePath;
};
@@ -109,7 +111,8 @@ namespace Catch {
getProcessedReporterSpecs() const;
std::vector<std::string> const& getTestsOrTags() const override;
std::vector<std::string> const& getSectionsToRun() const override;
std::vector<PathFilter> const& getPathFilters() const override;
bool useNewFilterBehaviour() const override;
TestSpec const& testSpec() const override;
bool hasTestFilters() const override;
@@ -124,6 +127,7 @@ namespace Catch {
bool includeSuccessfulResults() const override;
bool warnAboutMissingAssertions() const override;
bool warnAboutUnmatchedTestSpecs() const override;
bool warnAboutInfiniteGenerators() const override;
bool zeroTestsCountAsSuccess() const override;
ShowDurations showDurations() const override;
double minDuration() const override;
+12 -4
View File
@@ -38,7 +38,9 @@ namespace Catch {
Capturer::Capturer( StringRef macroName,
SourceLineInfo const& lineInfo,
ResultWas::OfType resultType,
StringRef names ) {
StringRef names,
bool isScoped):
m_isScoped(isScoped) {
auto trimmed = [&] (size_t start, size_t end) {
while (names[start] == ',' || isspace(static_cast<unsigned char>(names[start]))) {
++start;
@@ -99,15 +101,21 @@ namespace Catch {
}
Capturer::~Capturer() {
assert( m_captured == m_messages.size() );
for (auto const& message : m_messages) {
IResultCapture::popScopedMessage( message.sequence );
if ( m_isScoped ) {
for ( auto const& message : m_messages ) {
IResultCapture::popScopedMessage( message.sequence );
}
}
}
void Capturer::captureValue( size_t index, std::string const& value ) {
assert( index < m_messages.size() );
m_messages[index].message += value;
IResultCapture::pushScopedMessage( CATCH_MOVE( m_messages[index] ) );
if ( m_isScoped ) {
IResultCapture::pushScopedMessage( CATCH_MOVE( m_messages[index] ) );
} else {
IResultCapture::addUnscopedMessage( CATCH_MOVE( m_messages[index] ) );
}
m_captured++;
}
+22 -16
View File
@@ -64,8 +64,9 @@ namespace Catch {
class Capturer {
std::vector<MessageInfo> m_messages;
size_t m_captured = 0;
bool m_isScoped = false;
public:
Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names );
Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names, bool isScoped );
Capturer(Capturer const&) = delete;
Capturer& operator=(Capturer const&) = delete;
@@ -97,11 +98,12 @@ namespace Catch {
} while( false )
///////////////////////////////////////////////////////////////////////////////
#define INTERNAL_CATCH_CAPTURE( varName, macroName, ... ) \
Catch::Capturer varName( macroName##_catch_sr, \
CATCH_INTERNAL_LINEINFO, \
Catch::ResultWas::Info, \
#__VA_ARGS__##_catch_sr ); \
#define INTERNAL_CATCH_CAPTURE( varName, macroName, scopedCapture, ... ) \
Catch::Capturer varName( macroName##_catch_sr, \
CATCH_INTERNAL_LINEINFO, \
Catch::ResultWas::Info, \
#__VA_ARGS__##_catch_sr, \
scopedCapture ); \
varName.captureValues( 0, __VA_ARGS__ )
///////////////////////////////////////////////////////////////////////////////
@@ -118,28 +120,32 @@ namespace Catch {
#define CATCH_INFO( msg ) INTERNAL_CATCH_INFO( "CATCH_INFO", msg )
#define CATCH_UNSCOPED_INFO( msg ) INTERNAL_CATCH_UNSCOPED_INFO( "CATCH_UNSCOPED_INFO", msg )
#define CATCH_WARN( msg ) INTERNAL_CATCH_MSG( "CATCH_WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg )
#define CATCH_CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CATCH_CAPTURE", __VA_ARGS__ )
#define CATCH_CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CATCH_CAPTURE", true, __VA_ARGS__ )
#define CATCH_UNSCOPED_CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CATCH_UNSCOPED_CAPTURE", false, __VA_ARGS__ )
#elif defined(CATCH_CONFIG_PREFIX_MESSAGES) && defined(CATCH_CONFIG_DISABLE)
#define CATCH_INFO( msg ) (void)(0)
#define CATCH_UNSCOPED_INFO( msg ) (void)(0)
#define CATCH_WARN( msg ) (void)(0)
#define CATCH_CAPTURE( ... ) (void)(0)
#define CATCH_INFO( msg ) (void)(0)
#define CATCH_UNSCOPED_INFO( msg ) (void)(0)
#define CATCH_WARN( msg ) (void)(0)
#define CATCH_CAPTURE( ... ) (void)(0)
#define CATCH_UNSCOPED_CAPTURE( ... ) (void)(0)
#elif !defined(CATCH_CONFIG_PREFIX_MESSAGES) && !defined(CATCH_CONFIG_DISABLE)
#define INFO( msg ) INTERNAL_CATCH_INFO( "INFO", msg )
#define UNSCOPED_INFO( msg ) INTERNAL_CATCH_UNSCOPED_INFO( "UNSCOPED_INFO", msg )
#define WARN( msg ) INTERNAL_CATCH_MSG( "WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg )
#define CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CAPTURE", __VA_ARGS__ )
#define CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CAPTURE", true, __VA_ARGS__ )
#define UNSCOPED_CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "UNSCOPED_CAPTURE", false, __VA_ARGS__ )
#elif !defined(CATCH_CONFIG_PREFIX_MESSAGES) && defined(CATCH_CONFIG_DISABLE)
#define INFO( msg ) (void)(0)
#define UNSCOPED_INFO( msg ) (void)(0)
#define WARN( msg ) (void)(0)
#define CAPTURE( ... ) (void)(0)
#define INFO( msg ) (void)(0)
#define UNSCOPED_INFO( msg ) (void)(0)
#define WARN( msg ) (void)(0)
#define CAPTURE( ... ) (void)(0)
#define UNSCOPED_CAPTURE( ... ) (void)(0)
#endif // end of user facing macro declarations
+1 -1
View File
@@ -36,7 +36,7 @@ namespace Catch {
}
Version const& libraryVersion() {
static Version version( 3, 12, 0, "", 0 );
static Version version( 3, 14, 0, "", 0 );
return version;
}
+1 -1
View File
@@ -9,7 +9,7 @@
#define CATCH_VERSION_MACROS_HPP_INCLUDED
#define CATCH_VERSION_MAJOR 3
#define CATCH_VERSION_MINOR 12
#define CATCH_VERSION_MINOR 14
#define CATCH_VERSION_PATCH 0
#endif // CATCH_VERSION_MACROS_HPP_INCLUDED
@@ -7,8 +7,6 @@
// SPDX-License-Identifier: BSL-1.0
#include <catch2/generators/catch_generators.hpp>
#include <catch2/internal/catch_enforce.hpp>
#include <catch2/generators/catch_generator_exception.hpp>
#include <catch2/interfaces/catch_interfaces_capture.hpp>
namespace Catch {
@@ -17,14 +15,6 @@ namespace Catch {
namespace Generators {
namespace Detail {
[[noreturn]]
void throw_generator_exception(char const* msg) {
Catch::throw_exception(GeneratorException{ msg });
}
} // end namespace Detail
GeneratorUntypedBase::~GeneratorUntypedBase() = default;
IGeneratorTracker* acquireGeneratorTracker(StringRef generatorName, SourceLineInfo const& lineInfo ) {
+25 -8
View File
@@ -9,6 +9,7 @@
#define CATCH_GENERATORS_HPP_INCLUDED
#include <catch2/catch_tostring.hpp>
#include <catch2/generators/catch_generators_throw.hpp>
#include <catch2/interfaces/catch_interfaces_generatortracker.hpp>
#include <catch2/internal/catch_source_line_info.hpp>
#include <catch2/internal/catch_stringref.hpp>
@@ -22,14 +23,6 @@ namespace Catch {
namespace Generators {
namespace Detail {
//! Throws GeneratorException with the provided message
[[noreturn]]
void throw_generator_exception(char const * msg);
} // end namespace detail
template<typename T>
class IGenerator : public GeneratorUntypedBase {
std::string stringifyImpl() const override {
@@ -64,6 +57,9 @@ namespace Detail {
bool next() {
return m_generator->countedNext();
}
bool isFinite() const { return m_generator->isFinite(); }
void skipToNthElement( size_t n ) { m_generator->skipToNthElement(n); }
};
@@ -84,6 +80,8 @@ namespace Detail {
bool next() override {
return false;
}
bool isFinite() const override { return true; }
};
template<typename T>
@@ -93,6 +91,15 @@ namespace Detail {
"specialization, use SingleValue Generator instead.");
std::vector<T> m_values;
size_t m_idx = 0;
void skipToNthElementImpl( std::size_t n ) override {
if ( n >= m_values.size() ) {
Detail::throw_generator_exception(
"Coud not jump to Nth element: not enough elements" );
}
m_idx = n;
}
public:
FixedValuesGenerator( std::initializer_list<T> values ) : m_values( values ) {}
@@ -103,6 +110,8 @@ namespace Detail {
++m_idx;
return m_idx < m_values.size();
}
bool isFinite() const override { return true; }
};
template <typename T, typename DecayedT = std::decay_t<T>>
@@ -167,6 +176,14 @@ namespace Detail {
}
return m_current < m_generators.size();
}
bool isFinite() const override {
for (auto const& gen : m_generators) {
if (!gen.isFinite()) { return false;
}
}
return true;
}
};
@@ -11,6 +11,7 @@
#include <catch2/generators/catch_generators.hpp>
#include <catch2/internal/catch_meta.hpp>
#include <catch2/internal/catch_move_and_forward.hpp>
#include <catch2/internal/catch_optional.hpp>
#include <cassert>
@@ -22,6 +23,17 @@ namespace Generators {
GeneratorWrapper<T> m_generator;
size_t m_returned = 0;
size_t m_target;
void skipToNthElementImpl( std::size_t n ) override {
if ( n >= m_target ) {
Detail::throw_generator_exception(
"Coud not jump to Nth element: not enough elements" );
}
m_generator.skipToNthElement( n );
m_returned = n;
}
public:
TakeGenerator(size_t target, GeneratorWrapper<T>&& generator):
m_generator(CATCH_MOVE(generator)),
@@ -46,6 +58,8 @@ namespace Generators {
}
return success;
}
bool isFinite() const override { return true; }
};
template <typename T>
@@ -87,6 +101,8 @@ namespace Generators {
while (!m_predicate(m_generator.get()) && (success = m_generator.next()) == true);
return success;
}
bool isFinite() const override { return m_generator.isFinite(); }
};
@@ -111,6 +127,9 @@ namespace Generators {
m_target_repeats(repeats)
{
assert(m_target_repeats > 0 && "Repeat generator must repeat at least once");
if (!m_generator.isFinite()) {
Detail::throw_generator_exception( "Cannot repeat infinite generator" );
}
}
T const& get() const override {
@@ -144,6 +163,8 @@ namespace Generators {
}
return m_current_repeat < m_target_repeats;
}
bool isFinite() const override { return m_generator.isFinite(); }
};
template <typename T>
@@ -157,25 +178,30 @@ namespace Generators {
GeneratorWrapper<U> m_generator;
Func m_function;
// To avoid returning dangling reference, we have to save the values
T m_cache;
mutable Optional<T> m_cache;
void skipToNthElementImpl( std::size_t n ) override {
m_generator.skipToNthElement( n );
m_cache.reset();
}
public:
template <typename F2 = Func>
MapGenerator(F2&& function, GeneratorWrapper<U>&& generator) :
m_generator(CATCH_MOVE(generator)),
m_function(CATCH_FORWARD(function)),
m_cache(m_function(m_generator.get()))
m_function(CATCH_FORWARD(function))
{}
T const& get() const override {
return m_cache;
if ( !m_cache ) { m_cache = m_function( m_generator.get() ); }
return *m_cache;
}
bool next() override {
const auto success = m_generator.next();
if (success) {
m_cache = m_function(m_generator.get());
}
return success;
m_cache.reset();
return m_generator.next();
}
bool isFinite() const override { return m_generator.isFinite(); }
};
template <typename Func, typename U, typename T = FunctionReturnType<Func, U>>
@@ -197,7 +223,6 @@ namespace Generators {
std::vector<T> m_chunk;
size_t m_chunk_size;
GeneratorWrapper<T> m_generator;
bool m_used_up = false;
public:
ChunkGenerator(size_t size, GeneratorWrapper<T> generator) :
m_chunk_size(size), m_generator(CATCH_MOVE(generator))
@@ -226,6 +251,8 @@ namespace Generators {
}
return true;
}
bool isFinite() const override { return m_generator.isFinite(); }
};
template <typename T>
@@ -235,6 +262,56 @@ namespace Generators {
);
}
template <typename T>
class ConcatGenerator final : public IGenerator<T> {
std::vector<GeneratorWrapper<T>> m_generators;
size_t m_current_generator = 0;
void InsertGenerators( GeneratorWrapper<T>&& gen ) {
m_generators.push_back( CATCH_MOVE( gen ) );
}
template <typename... Generators>
void InsertGenerators( GeneratorWrapper<T>&& gen, Generators&&... gens ) {
m_generators.push_back( CATCH_MOVE( gen ) );
InsertGenerators( CATCH_MOVE( gens )... );
}
public:
template <typename... Generators>
ConcatGenerator( Generators&&... generators ) {
InsertGenerators( CATCH_MOVE( generators )... );
}
T const& get() const override {
return m_generators[m_current_generator].get();
}
bool next() override {
const bool success = m_generators[m_current_generator].next();
if ( success ) { return true; }
// If current generator is used up, we have to move to the next one
++m_current_generator;
return m_current_generator < m_generators.size();
}
bool isFinite() const override {
for ( auto const& gen : m_generators ) {
if ( !gen.isFinite() ) { return false; }
}
return true;
}
};
template <typename T, typename... Generators>
GeneratorWrapper<T> cat( GeneratorWrapper<T>&& generator,
Generators&&... generators ) {
return GeneratorWrapper<T>(
Catch::Detail::make_unique<ConcatGenerator<T>>(
CATCH_MOVE( generator ), CATCH_MOVE( generators )... ) );
}
} // namespace Generators
} // namespace Catch
@@ -26,5 +26,6 @@
#include <catch2/generators/catch_generators_adapters.hpp>
#include <catch2/generators/catch_generators_random.hpp>
#include <catch2/generators/catch_generators_range.hpp>
#include <catch2/generators/catch_generators_throw.hpp>
#endif // CATCH_GENERATORS_ALL_HPP_INCLUDED
@@ -37,5 +37,10 @@ namespace Catch {
m_current_number = m_pimpl->dist( m_pimpl->rng );
return true;
}
bool RandomFloatingGenerator<long double>::isFinite() const {
return false;
}
} // namespace Generators
} // namespace Catch
@@ -42,6 +42,7 @@ public:
m_current_number = m_dist(m_rng);
return true;
}
bool isFinite() const override { return false; }
};
template <>
@@ -59,6 +60,7 @@ public:
bool next() override;
~RandomFloatingGenerator() override; // = default
bool isFinite() const override;
};
template <typename Integer>
@@ -80,6 +82,7 @@ public:
m_current_number = m_dist(m_rng);
return true;
}
bool isFinite() const override { return false; }
};
template <typename T>
@@ -48,6 +48,8 @@ public:
m_current += m_step;
return (m_positive) ? (m_current < m_end) : (m_current > m_end);
}
bool isFinite() const override { return true; }
};
template <typename T>
@@ -87,6 +89,8 @@ public:
++m_current;
return m_current != m_elems.size();
}
bool isFinite() const override { return true; }
};
template <typename InputIterator,
@@ -0,0 +1,24 @@
// 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
#include <catch2/generators/catch_generator_exception.hpp>
#include <catch2/generators/catch_generators_throw.hpp>
#include <catch2/internal/catch_enforce.hpp>
namespace Catch {
namespace Generators {
namespace Detail {
[[noreturn]]
void throw_generator_exception( char const* msg ) {
Catch::throw_exception( GeneratorException{ msg } );
}
} // namespace Detail
} // namespace Generators
} // namespace Catch
@@ -0,0 +1,23 @@
// 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_GENERATORS_THROW_HPP_INCLUDED
#define CATCH_GENERATORS_THROW_HPP_INCLUDED
namespace Catch {
namespace Generators {
namespace Detail {
//! Throws GeneratorException with the provided message
[[noreturn]]
void throw_generator_exception( char const* msg );
} // namespace Detail
} // namespace Generators
} // namespace Catch
#endif // CATCH_GENERATORS_THROW_HPP_INCLUDED
@@ -65,6 +65,7 @@ namespace Catch {
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;
@@ -29,6 +29,8 @@ namespace Catch {
NoAssertions = 0x01,
//! A command line test spec matched no test cases
UnmatchedTestSpec = 0x02,
//! The resulting generator in GENERATE is infinite
InfiniteGenerator = 0x04,
}; };
enum class ShowDurations {
@@ -60,6 +62,7 @@ namespace Catch {
class TestSpec;
class IStream;
struct PathFilter;
class IConfig : public Detail::NonCopyable {
public:
@@ -71,6 +74,7 @@ namespace Catch {
virtual bool shouldDebugBreak() const = 0;
virtual bool warnAboutMissingAssertions() const = 0;
virtual bool warnAboutUnmatchedTestSpecs() const = 0;
virtual bool warnAboutInfiniteGenerators() const = 0;
virtual bool zeroTestsCountAsSuccess() const = 0;
virtual int abortAfter() const = 0;
virtual bool showInvisibles() const = 0;
@@ -84,7 +88,9 @@ namespace Catch {
virtual unsigned int shardCount() const = 0;
virtual unsigned int shardIndex() const = 0;
virtual ColourMode defaultColourMode() const = 0;
virtual std::vector<std::string> const& getSectionsToRun() const = 0;
virtual std::vector<PathFilter> const& getPathFilters() const = 0;
virtual bool useNewFilterBehaviour() const = 0;
virtual Verbosity verbosity() const = 0;
virtual bool skipBenchmarks() const = 0;
@@ -7,6 +7,8 @@
// SPDX-License-Identifier: BSL-1.0
#include <catch2/interfaces/catch_interfaces_generatortracker.hpp>
#include <catch2/generators/catch_generators.hpp>
#include <string>
namespace Catch {
@@ -21,6 +23,31 @@ namespace Catch {
return ret;
}
void GeneratorUntypedBase::skipToNthElementImpl( std::size_t n ) {
for ( size_t i = m_currentElementIndex; i < n; ++i ) {
bool isValid = next();
if ( !isValid ) {
Detail::throw_generator_exception(
"Coud not jump to Nth element: not enough elements" );
}
}
}
void GeneratorUntypedBase::skipToNthElement( std::size_t n ) {
if ( n < m_currentElementIndex ) {
Detail::throw_generator_exception(
"Tried to jump generator backwards" );
}
if ( n == m_currentElementIndex ) { return; }
skipToNthElementImpl(n);
// Fixup tracking after moving the generator forward
// * Ensure that the correct element index is set after skipping
// * Invalidate cache
m_currentElementIndex = n;
m_stringReprCache.clear();
}
StringRef GeneratorUntypedBase::currentElementAsString() const {
if ( m_stringReprCache.empty() ) {
m_stringReprCache = stringifyImpl();
@@ -28,5 +55,7 @@ namespace Catch {
return m_stringReprCache;
}
bool GeneratorUntypedBase::isFinite() const { return true; }
} // namespace Generators
} // namespace Catch
@@ -35,6 +35,15 @@ namespace Catch {
//! Customization point for `currentElementAsString`
virtual std::string stringifyImpl() const = 0;
/**
* Customization point for skipping to the n-th element
*
* Defaults to successively calling `countedNext`. If there
* are not enough elements to reach the nth one, will throw
* an error.
*/
virtual void skipToNthElementImpl( std::size_t n );
public:
GeneratorUntypedBase() = default;
// Generation of copy ops is deprecated (and Clang will complain)
@@ -58,6 +67,13 @@ namespace Catch {
std::size_t currentElementIndex() const { return m_currentElementIndex; }
/**
* Moves the generator forward **to** the n-th element
*
* Cannot move backwards. Can stay in place.
*/
void skipToNthElement( std::size_t n );
/**
* Returns generator's current element as user-friendly string.
*
@@ -72,6 +88,15 @@ namespace Catch {
* comes first.
*/
StringRef currentElementAsString() const;
/**
* Returns true if calls to `next` will eventually return false
*
* Note that for backwards compatibility this is currently defaulted
* to return `true`, but in the future all generators will have to
* provide their own implementation.
*/
virtual bool isFinite() const;
};
using GeneratorBasePtr = Catch::Detail::unique_ptr<GeneratorUntypedBase>;
@@ -80,9 +105,7 @@ namespace Catch {
class IGeneratorTracker {
public:
virtual ~IGeneratorTracker(); // = default;
virtual auto hasGenerator() const -> bool = 0;
virtual auto getGenerator() const -> Generators::GeneratorBasePtr const& = 0;
virtual void setGenerator( Generators::GeneratorBasePtr&& generator ) = 0;
};
} // namespace Catch
+61 -2
View File
@@ -32,6 +32,9 @@ namespace Catch {
} else if ( warning == "UnmatchedTestSpec" ) {
config.warnings = static_cast<WarnAbout::What>(config.warnings | WarnAbout::UnmatchedTestSpec);
return ParserResult::ok( ParseResultType::Matched );
} else if ( warning == "InfiniteGenerators" ) {
config.warnings = static_cast<WarnAbout::What>(config.warnings | WarnAbout::InfiniteGenerator);
return ParserResult::ok( ParseResultType::Matched );
}
return ParserResult ::runtimeError(
@@ -189,6 +192,19 @@ namespace Catch {
config.shardCount = *parsedCount;
return ParserResult::ok( ParseResultType::Matched );
};
auto const setBenchmarkSamples = [&]( std::string const& samples ) {
auto parsedSamples = parseUInt( samples );
if ( !parsedSamples ) {
return ParserResult::runtimeError(
"Could not parse '" + samples + "' as benchmark samples" );
}
if ( *parsedSamples == 0 ) {
return ParserResult::runtimeError(
"Benchmark samples must be greater than 0" );
}
config.benchmarkSamples = *parsedSamples;
return ParserResult::ok( ParseResultType::Matched );
};
auto const setShardIndex = [&](std::string const& shardIndex) {
auto parsedIndex = parseUInt( shardIndex );
@@ -200,6 +216,43 @@ namespace Catch {
return ParserResult::ok( ParseResultType::Matched );
};
auto const setSectionFilter = [&]( std::string const& sectionFilter ) {
config.pathFilters.emplace_back( PathFilter::For::Section, trim(sectionFilter) );
return ParserResult::ok( ParseResultType::Matched );
};
auto const setGeneratorFilter = [&]( std::string const& generatorFilter ) {
if (generatorFilter != "*") {
// TODO: avoid re-parsing the index?
auto parsedIndex = parseUInt( generatorFilter );
if ( !parsedIndex ) {
return ParserResult::runtimeError( "Could not parse '" +
generatorFilter +
"' as generator index" );
}
}
config.useNewPathFilteringBehaviour = true;
config.pathFilters.emplace_back( PathFilter::For::Generator, trim(generatorFilter) );
return ParserResult::ok( ParseResultType::Matched );
};
// Copy-capturing other `setFoo` functions enables calling them later,
// as the config ref remains valid, but the local lambda vars won't.
auto const setPathFilter = [=, &config]( std::string const& pathFilter ) {
config.useNewPathFilteringBehaviour = true;
if ( pathFilter.size() < 3 ) {
return ParserResult::runtimeError(
"Path filter '" + pathFilter + "' is too short" );
}
if ( startsWith( pathFilter, "g:" ) ) {
return setGeneratorFilter( pathFilter.substr( 2 ) );
}
if ( startsWith( pathFilter, "c:" ) ) {
return setSectionFilter( pathFilter.substr( 2 ) );
}
return ParserResult::runtimeError( "Path filter '" + pathFilter +
"' has unknown type prefix" );
};
auto cli
= ExeName( config.processName )
| Help( config.showHelp )
@@ -245,9 +298,15 @@ namespace Catch {
| Opt( config.filenamesAsTags )
["-#"]["--filenames-as-tags"]
( "adds a tag for the filename" )
| Opt( config.sectionsToRun, "section name" )
| Opt( accept_many, setSectionFilter, "section name" )
["-c"]["--section"]
( "specify section to run" )
| Opt( accept_many, setGeneratorFilter, "index spec" )
["-g"]["--generator-index"]
( "specify generator elements to try" )
| Opt( accept_many, setPathFilter, "path filter spec" )
["-p"]["--path-filter"]
( "qualified path filter" )
| Opt( setVerbosity, "quiet|normal|high" )
["-v"]["--verbosity"]
( "set output verbosity" )
@@ -281,7 +340,7 @@ namespace Catch {
| Opt( config.skipBenchmarks)
["--skip-benchmarks"]
( "disable running benchmarks")
| Opt( config.benchmarkSamples, "samples" )
| Opt( setBenchmarkSamples, "samples" )
["--benchmark-samples"]
( "number of samples to collect (default: 100)" )
| Opt( config.benchmarkResamples, "resamples" )
@@ -110,10 +110,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\"" )
@@ -208,7 +213,7 @@
////////////////////////////////////////////////////////////////////////////////
// Visual C++
#if defined(_MSC_VER)
#if defined(_MSC_VER) && !defined(__clang__)
// We want to defer to nvcc-specific warning suppression if we are compiled
// with nvcc masquerading for MSVC.
@@ -219,6 +224,11 @@
__pragma( warning( pop ) )
# endif
// Suppress MSVC C++ Core Guidelines checker warning 26426:
// "Global initializer calls a non-constexpr function (i.22)"
# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
__pragma( warning( disable : 26426 ) )
// Universal Windows platform does not support SEH
# if !defined(CATCH_PLATFORM_WINDOWS_UWP)
# define CATCH_INTERNAL_CONFIG_WINDOWS_SEH
@@ -424,6 +434,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
@@ -11,9 +11,9 @@
#include <catch2/catch_user_config.hpp>
#if !defined( CATCH_CONFIG_NO_DEPRECATION_ANNOTATIONS )
# define DEPRECATED( msg ) [[deprecated( msg )]]
# define CATCH_DEPRECATED( msg ) [[deprecated( msg )]]
#else
# define DEPRECATED( msg )
# define CATCH_DEPRECATED( msg )
#endif
#endif // CATCH_DEPRECATION_MACRO_HPP_INCLUDED
+2 -2
View File
@@ -29,11 +29,11 @@ namespace Catch {
// The "ID" of the message, used to know when to remove it from reporter context.
unsigned int sequence;
DEPRECATED( "Explicitly use the 'sequence' member instead" )
CATCH_DEPRECATED( "Explicitly use the 'sequence' member instead" )
bool operator == (MessageInfo const& other) const {
return sequence == other.sequence;
}
DEPRECATED( "Explicitly use the 'sequence' member instead" )
CATCH_DEPRECATED( "Explicitly use the 'sequence' member instead" )
bool operator < (MessageInfo const& other) const {
return sequence < other.sequence;
}
+33
View File
@@ -0,0 +1,33 @@
// 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_PATH_FILTER_HPP_INCLUDED
#define CATCH_PATH_FILTER_HPP_INCLUDED
#include <catch2/internal/catch_move_and_forward.hpp>
#include <string>
namespace Catch {
struct PathFilter {
enum class For {
Section,
Generator,
};
PathFilter( For type_, std::string filter_ ):
type( type_ ), filter( CATCH_MOVE( filter_ ) ) {}
For type;
std::string filter;
friend bool operator==( PathFilter const& lhs, PathFilter const& rhs );
};
} // end namespace Catch
#endif // CATCH_PATH_FILTER_HPP_INCLUDED
+92 -33
View File
@@ -8,6 +8,7 @@
#include <catch2/internal/catch_run_context.hpp>
#include <catch2/catch_user_config.hpp>
#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_reporter.hpp>
@@ -19,9 +20,12 @@
#include <catch2/catch_timer.hpp>
#include <catch2/internal/catch_output_redirect.hpp>
#include <catch2/internal/catch_assertion_handler.hpp>
#include <catch2/internal/catch_path_filter.hpp>
#include <catch2/internal/catch_test_failure_exception.hpp>
#include <catch2/internal/catch_thread_local.hpp>
#include <catch2/internal/catch_unreachable.hpp>
#include <catch2/internal/catch_result_type.hpp>
#include <catch2/catch_test_macros.hpp>
#include <cassert>
#include <algorithm>
@@ -33,12 +37,51 @@ namespace Catch {
struct GeneratorTracker final : TestCaseTracking::TrackerBase,
IGeneratorTracker {
GeneratorBasePtr m_generator;
// Filtered generator has moved to specific index due to
// a filter, it needs special handling of `countedNext()`
bool m_isFiltered = false;
GeneratorTracker(
TestCaseTracking::NameAndLocation&& nameAndLocation,
TrackerContext& ctx,
ITracker* parent ):
TrackerBase( CATCH_MOVE( nameAndLocation ), ctx, parent ) {}
ITracker* parent,
GeneratorBasePtr&& generator ):
TrackerBase( CATCH_MOVE( nameAndLocation ), ctx, parent ),
m_generator( CATCH_MOVE( generator ) ) {
assert( m_generator &&
"Cannot create tracker without generator" );
// Handle potential filter and move forward here...
// Old style filters do not affect generators at all
if (m_newStyleFilters && m_allTrackerDepth < m_filterRef->size()) {
auto const& filter =
( *m_filterRef )[m_allTrackerDepth];
// Generator cannot be un-entered the way a section
// can be, so the tracker has to throw for a wrong
// filter to stop the execution flow.
if (filter.type == PathFilter::For::Section) {
// 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
// not the generator itself.
if ( filter.filter != "*" ) {
m_isFiltered = true;
// TBD: We assume that the filter was validated as
// number during parsing. We should pass it
// as number from the CLI parser.
size_t targetIndex = std::stoul( filter.filter );
m_generator->skipToNthElement( targetIndex );
}
}
}
static GeneratorTracker*
acquire( TrackerContext& ctx,
@@ -82,9 +125,6 @@ namespace Catch {
// TrackerBase interface
bool isGeneratorTracker() const override { return true; }
auto hasGenerator() const -> bool override {
return !!m_generator;
}
void close() override {
TrackerBase::close();
// If a generator has a child (it is followed by a section)
@@ -113,25 +153,24 @@ namespace Catch {
// _can_ start, and thus we should wait for them, or
// they cannot start (due to filters), and we shouldn't
// wait for them
ITracker* parent = m_parent;
// This is safe: there is always at least one section
// tracker in a test case tracking tree
while ( !parent->isSectionTracker() ) {
parent = parent->parent();
// No filters left -> no restrictions on running sections
size_t childDepth = 1 + (m_newStyleFilters ? m_allTrackerDepth : m_sectionOnlyDepth);
if ( childDepth >= m_filterRef->size() ) {
return true;
}
assert( parent &&
"Missing root (test case) level section" );
auto const& parentSection =
static_cast<SectionTracker const&>( *parent );
auto const& filters = parentSection.getFilters();
// No filters -> no restrictions on running sections
if ( filters.empty() ) { return true; }
// If we are using the new style filters, we need to check
// whether the successive filter is for section or a generator.
if ( m_newStyleFilters
&& (*m_filterRef)[childDepth].type != PathFilter::For::Section ) {
return false;
}
// Look for any child section that could match the remaining filters
for ( auto const& child : m_children ) {
if ( child->isSectionTracker() &&
static_cast<SectionTracker const&>( *child )
.trimmedName() == filters[0] ) {
.trimmedName() == StringRef((*m_filterRef)[childDepth].filter) ) {
return true;
}
}
@@ -143,9 +182,10 @@ namespace Catch {
// value, but we do not want to invoke the side-effect if
// this generator is still waiting for any child to start.
assert( m_generator && "Tracker without generator" );
if ( should_wait_for_child ||
( m_runState == CompletedSuccessfully &&
m_generator->countedNext() ) ) {
if ( should_wait_for_child
|| ( m_runState == CompletedSuccessfully
&& !m_isFiltered // filtered generators cannot meaningfully move forward, as they would get past the filter
&& m_generator->countedNext() ) ) {
m_children.clear();
m_runState = Executing;
}
@@ -155,9 +195,6 @@ namespace Catch {
auto getGenerator() const -> GeneratorBasePtr const& override {
return m_generator;
}
void setGenerator( GeneratorBasePtr&& generator ) override {
m_generator = CATCH_MOVE( generator );
}
};
} // namespace
}
@@ -211,15 +248,18 @@ namespace Catch {
// we only keep around the raw msg ids.
~MessageHolder() = default;
void addUnscopedMessage(MessageBuilder&& builder) {
void addUnscopedMessage( MessageInfo&& info ) {
repairUnscopedMessageInvariant();
MessageInfo info( CATCH_MOVE( builder.m_info ) );
info.message = builder.m_stream.str();
unscoped_ids.push_back( info.sequence );
messages.push_back( CATCH_MOVE( info ) );
}
void addUnscopedMessage(MessageBuilder&& builder) {
MessageInfo info( CATCH_MOVE( builder.m_info ) );
info.message = builder.m_stream.str();
addUnscopedMessage( CATCH_MOVE( info ) );
}
void addScopedMessage(MessageInfo&& info) {
messages.push_back( CATCH_MOVE( info ) );
}
@@ -308,7 +348,8 @@ namespace Catch {
ITracker& rootTracker = m_trackerContext.startRun();
assert(rootTracker.isSectionTracker());
static_cast<SectionTracker&>(rootTracker).addInitialFilters(m_config->getSectionsToRun());
rootTracker.setFilters( &m_config->getPathFilters(),
m_config->useNewFilterBehaviour() );
// We intentionally only seed the internal RNG once per test case,
// before it is first invoked. The reason for that is a complex
@@ -480,18 +521,32 @@ namespace Catch {
SourceLineInfo lineInfo,
Generators::GeneratorBasePtr&& generator ) {
// TBD: Do we want to avoid the warning if the generator is filtered?
if ( m_config->warnAboutInfiniteGenerators() &&
!generator->isFinite() ) {
// 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 );
auto& currentTracker = m_trackerContext.currentTracker();
assert(
currentTracker.nameAndLocation() != nameAndLoc &&
"Trying to create tracker for a generator that already has one" );
auto newTracker = Catch::Detail::make_unique<Generators::GeneratorTracker>(
CATCH_MOVE(nameAndLoc), m_trackerContext, &currentTracker );
auto newTracker =
Catch::Detail::make_unique<Generators::GeneratorTracker>(
CATCH_MOVE( nameAndLoc ),
m_trackerContext,
&currentTracker,
CATCH_MOVE( generator ) );
auto ret = newTracker.get();
currentTracker.addChild( CATCH_MOVE( newTracker ) );
ret->setGenerator( CATCH_MOVE( generator ) );
ret->open();
return ret;
}
@@ -894,6 +949,10 @@ namespace Catch {
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());
}
+34 -28
View File
@@ -8,8 +8,9 @@
#include <catch2/internal/catch_test_case_tracker.hpp>
#include <catch2/internal/catch_enforce.hpp>
#include <catch2/internal/catch_string_manip.hpp>
#include <catch2/internal/catch_move_and_forward.hpp>
#include <catch2/internal/catch_path_filter.hpp>
#include <catch2/internal/catch_string_manip.hpp>
#include <algorithm>
#include <cassert>
@@ -27,6 +28,17 @@ namespace TestCaseTracking {
location( _location )
{}
ITracker::ITracker( NameAndLocation&& nameAndLoc, ITracker* parent ):
m_nameAndLocation( CATCH_MOVE( nameAndLoc ) ), m_parent( parent ) {
if ( m_parent ) {
m_allTrackerDepth = m_parent->m_allTrackerDepth + 1;
// We leave section trackers to bump themselves up, as
// we cannot use `isSectionTracker` in constructor
m_sectionOnlyDepth = m_parent->m_sectionOnlyDepth;
m_filterRef = m_parent->m_filterRef;
m_newStyleFilters = m_parent->m_newStyleFilters;
}
}
ITracker::~ITracker() = default;
@@ -159,25 +171,32 @@ namespace TestCaseTracking {
: TrackerBase( CATCH_MOVE(nameAndLocation), ctx, parent ),
m_trimmed_name(trim(StringRef(ITracker::nameAndLocation().name)))
{
if( parent ) {
while ( !parent->isSectionTracker() ) {
parent = parent->parent();
}
SectionTracker& parentSection = static_cast<SectionTracker&>( *parent );
addNextFilters( parentSection.m_filters );
if( m_parent ) {
++m_sectionOnlyDepth;
}
}
bool SectionTracker::isComplete() const {
bool complete = true;
if ( m_filters.empty()
|| m_filters[0].empty()
|| m_filters[0] == m_trimmed_name ) {
complete = TrackerBase::isComplete();
// If there are active filters AND we do not pass them,
// the section is always "completed"
const size_t filterIndex =
m_newStyleFilters ? m_allTrackerDepth : m_sectionOnlyDepth;
if ( filterIndex < m_filterRef->size() ) {
// There is active filter, check it
// 1) New style filter must explicitly target section
if ( m_newStyleFilters && ( *m_filterRef )[filterIndex].type !=
PathFilter::For::Section ) {
return true;
}
// 2) Both style filters must match the trimmed name exactly
if ( m_trimmed_name !=
StringRef( ( *m_filterRef )[filterIndex].filter ) ) {
return true;
}
}
return complete;
// Otherwise we delegate to the generic processing
return TrackerBase::isComplete();
}
bool SectionTracker::isSectionTracker() const { return true; }
@@ -213,19 +232,6 @@ namespace TestCaseTracking {
open();
}
void SectionTracker::addInitialFilters( std::vector<std::string> const& filters ) {
if( !filters.empty() ) {
m_filters.reserve( m_filters.size() + filters.size() + 2 );
m_filters.emplace_back(StringRef{}); // Root - should never be consulted
m_filters.emplace_back(StringRef{}); // Test Case - not a section filter
m_filters.insert( m_filters.end(), filters.begin(), filters.end() );
}
}
void SectionTracker::addNextFilters( std::vector<StringRef> const& filters ) {
if( filters.size() > 1 )
m_filters.insert( m_filters.end(), filters.begin()+1, filters.end() );
}
StringRef SectionTracker::trimmedName() const {
return m_trimmed_name;
}
+25 -11
View File
@@ -17,6 +17,9 @@
#include <vector>
namespace Catch {
struct PathFilter;
namespace TestCaseTracking {
struct NameAndLocation {
@@ -92,12 +95,23 @@ namespace TestCaseTracking {
Children m_children;
CycleState m_runState = NotStarted;
public:
ITracker( NameAndLocation&& nameAndLoc, ITracker* parent ):
m_nameAndLocation( CATCH_MOVE(nameAndLoc) ),
m_parent( parent )
{}
// Members for path filtering
std::vector<PathFilter> const* m_filterRef = nullptr;
// Note: There are 2 dummy section trackers (root, test-case) before
// the first "real" section tracker can be encountered. We start
// the default tracker at -2, so that the first "real" section
// tracker overflows to index 0.
// Nesting depth of this tracker, used to decide which new-style filter applies.
size_t m_allTrackerDepth = static_cast<size_t>( -2 );
// Nesting depth of sections (inc. this tracker), used for old-style filters.
// Must be updated by the section tracker on its own.
size_t m_sectionOnlyDepth = static_cast<size_t>( -2 );
// Transitory: Remove once we remove backwards compatibility with old-style (v3.x) filters
bool m_newStyleFilters = false;
public:
ITracker( NameAndLocation&& nameAndLoc, ITracker* parent );
// static queries
NameAndLocation const& nameAndLocation() const {
@@ -123,6 +137,11 @@ namespace TestCaseTracking {
//! Returns true iff tracker has started
bool hasStarted() const;
void setFilters( std::vector<PathFilter> const* filters, bool newStyleFilters ) {
m_filterRef = filters;
m_newStyleFilters = newStyleFilters;
}
// actions
virtual void close() = 0; // Successfully complete
virtual void fail() = 0;
@@ -208,8 +227,7 @@ namespace TestCaseTracking {
void moveToThis();
};
class SectionTracker : public TrackerBase {
std::vector<StringRef> m_filters;
class SectionTracker final : public TrackerBase {
// Note that lifetime-wise we piggy back off the name stored in the `ITracker` parent`.
// Currently it allocates owns the name, so this is safe. If it is later refactored
// to not own the name, the name still has to outlive the `ITracker` parent, so
@@ -226,10 +244,6 @@ namespace TestCaseTracking {
void tryOpen();
void addInitialFilters( std::vector<std::string> const& filters );
void addNextFilters( std::vector<StringRef> const& filters );
//! Returns filters active in this tracker
std::vector<StringRef> const& getFilters() const { return m_filters; }
//! Returns whitespace-trimmed name of the tracked section
StringRef trimmedName() const;
};
+19
View File
@@ -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,
+13
View File
@@ -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
+3
View File
@@ -61,6 +61,7 @@ internal_headers = [
'generators/catch_generators_all.hpp',
'generators/catch_generators_random.hpp',
'generators/catch_generators_range.hpp',
'generators/catch_generators_throw.hpp',
'interfaces/catch_interfaces_all.hpp',
'interfaces/catch_interfaces_capture.hpp',
'interfaces/catch_interfaces_config.hpp',
@@ -115,6 +116,7 @@ internal_headers = [
'internal/catch_optional.hpp',
'internal/catch_output_redirect.hpp',
'internal/catch_parse_numbers.hpp',
'internal/catch_path_filter.hpp',
'internal/catch_platform.hpp',
'internal/catch_polyfills.hpp',
'internal/catch_preprocessor.hpp',
@@ -203,6 +205,7 @@ internal_sources = files(
'generators/catch_generator_exception.cpp',
'generators/catch_generators.cpp',
'generators/catch_generators_random.cpp',
'generators/catch_generators_throw.cpp',
'interfaces/catch_interfaces_capture.cpp',
'interfaces/catch_interfaces_config.cpp',
'interfaces/catch_interfaces_exception.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
@@ -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 {
@@ -195,7 +210,7 @@ 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 ) );
@@ -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
+65 -58
View File
@@ -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;
+20 -11
View File
@@ -169,7 +169,7 @@ if(CATCH_ENABLE_COVERAGE)
endif()
# configure unit tests via CTest
add_test(NAME RunTests COMMAND $<TARGET_FILE:SelfTest> --order rand --rng-seed time)
add_test(NAME RunTests COMMAND $<TARGET_FILE:SelfTest> --order rand --rng-seed time --warn InfiniteGenerators)
set_tests_properties(RunTests PROPERTIES
FAIL_REGULAR_EXPRESSION "Filters:"
COST 15
@@ -327,6 +327,24 @@ set_tests_properties(FilteredSections::GeneratorsDontCauseInfiniteLoop
FAIL_REGULAR_EXPRESSION "inside with fov: 1" # This would mean there was no filtering
)
add_test(NAME "FilteredSections::DifferentSimpleFilters"
COMMAND
Python3::Interpreter "${CMAKE_CURRENT_LIST_DIR}/TestScripts/testSectionFiltering.py" $<TARGET_FILE:SelfTest>
)
set_tests_properties("FilteredSections::DifferentSimpleFilters"
PROPERTIES
LABELS "uses-python"
)
add_test(NAME "FilteredSections::HittingGeneratorsWithSectionFilterCausesSkip"
COMMAND
$<TARGET_FILE:SelfTest> "baz" -p "c:A" -r "compact"
)
set_tests_properties("FilteredSections::HittingGeneratorsWithSectionFilterCausesSkip"
PROPERTIES
PASS_REGULAR_EXPRESSION "test cases: 1 \\| 1 skipped[\r\n\t ]*assertions: 1 \\| 1 passed"
)
add_test(NAME ApprovalTests
COMMAND
Python3::Interpreter
@@ -483,7 +501,7 @@ set_tests_properties("ErrorHandling::InvalidTestSpecExitsEarly"
FAIL_REGULAR_EXPRESSION "No tests ran"
)
if(MSVC)
if(WIN32)
set(_NullFile "NUL")
else()
set(_NullFile "/dev/null")
@@ -679,14 +697,5 @@ set_tests_properties("Bazel::RngSeedEnvVar::MalformedValueIsIgnored"
PASS_REGULAR_EXPRESSION "Randomness seeded to: 17171717"
)
add_test(NAME "FilteredSections::DifferentSimpleFilters"
COMMAND
Python3::Interpreter "${CMAKE_CURRENT_LIST_DIR}/TestScripts/testSectionFiltering.py" $<TARGET_FILE:SelfTest>
)
set_tests_properties("FilteredSections::DifferentSimpleFilters"
PROPERTIES
LABELS "uses-python"
)
list(APPEND CATCH_TEST_TARGETS SelfTest)
set(CATCH_TEST_TARGETS ${CATCH_TEST_TARGETS} PARENT_SCOPE)
+18 -4
View File
@@ -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
@@ -273,7 +273,7 @@ set_tests_properties(Reporters::CapturedStdOutInEvents
FAIL_REGULAR_EXPRESSION "X27 ERROR"
)
if(MSVC)
if(WIN32)
set(_NullFile "NUL")
else()
set(_NullFile "/dev/null")
@@ -589,3 +589,17 @@ set_tests_properties(ThreadSafetyTests::UnscopedMessagesAndAssertions
PASS_REGULAR_EXPRESSION "assertions: 401 \\| 401 failed as expected"
RUN_SERIAL ON
)
add_executable(InfiniteGenerators ${TESTS_DIR}/X95-InfiniteGenerators.cpp)
target_link_libraries(InfiniteGenerators PRIVATE Catch2::Catch2WithMain)
add_test(
NAME Warnings::InfiniteGenerators
COMMAND $<TARGET_FILE:InfiniteGenerators> --warn InfiniteGenerators
)
set_tests_properties(Warnings::InfiniteGenerators
PROPERTIES
# One test case fails with infinite generator, but the other one runs
PASS_REGULAR_EXPRESSION "test cases: 2 \\| 1 passed \\| 1 failed"
TIMEOUT 5
)
+1
View File
@@ -67,6 +67,7 @@ CATCH_TEST_CASE("PrefixedMacros") {
int i = 1;
CATCH_CAPTURE( i );
CATCH_CAPTURE( i, i + 1 );
CATCH_UNSCOPED_CAPTURE( i + 2, i + 3 );
CATCH_DYNAMIC_SECTION("Dynamic section: " << i) {
CATCH_FAIL_CHECK( "failure" );
}
+2
View File
@@ -48,6 +48,7 @@ TEST_CASE( "Disabled Macros" ) {
CAPTURE( 1 );
CAPTURE( 1, "captured" );
UNSCOPED_CAPTURE( 3 );
REQUIRE_THAT( 1,
Catch::Matchers::Predicate( []( int ) { return false; } ) );
@@ -68,6 +69,7 @@ TEST_CASE_PERSISTENT_FIXTURE( DisabledFixture, "Disabled Persistent Fixture" ) {
CAPTURE( 1 );
CAPTURE( 1, "captured" );
UNSCOPED_CAPTURE( 3 );
REQUIRE_THAT( 1,
Catch::Matchers::Predicate( []( int ) { return false; } ) );
@@ -0,0 +1,40 @@
// 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
* Checks that GENERATE over infinite generator errors out when the tests are
* run with `-warn InfiniteGenerators`
*/
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
namespace {
static int ONE = 1;
class infinite_generator : public Catch::Generators::IGenerator<int> {
public:
int const& get() const override { return ONE; }
bool next() override { return true; }
auto isFinite() const -> bool override { return false; }
};
static auto make_infinite_generator()
-> Catch::Generators::GeneratorWrapper<int> {
return { new infinite_generator() };
}
} // namespace
TEST_CASE() {
auto _ = GENERATE( make_infinite_generator() );
}
TEST_CASE() {
REQUIRE(true);
}
@@ -131,6 +131,7 @@ Nor would this
:test-result: PASS Comparisons with int literals don't warn when mixing signed/ unsigned
:test-result: PASS Composed generic matchers shortcircuit
:test-result: PASS Composed matchers shortcircuit
:test-result: PASS ConcatGenerator
:test-result: FAIL Contains string matcher
:test-result: PASS Copy and then generate a range
:test-result: PASS Cout stream properly declares it writes to stdout
@@ -164,11 +165,14 @@ Nor would this
:test-result: FAIL FAIL_CHECK does not abort the test
:test-result: PASS Factorials are computed
:test-result: PASS Filter generator throws exception for empty generator
:test-result: PASS FixedValuesGenerator can be skipped forward
:test-result: PASS Floating point matchers: double
:test-result: PASS Floating point matchers: float
:test-result: PASS GENERATE can combine literals and generators
:test-result: PASS Generator adapters properly handle isFinite
:test-result: PASS Generators -- adapters
:test-result: PASS Generators -- simple
:test-result: PASS Generators can be skipped forward
:test-result: PASS Generators internals
:test-result: PASS Greater-than inequalities with different epsilons
:test-result: PASS Hashers with different seed produce different hash with same test case
@@ -188,6 +192,8 @@ Nor would this
:test-result: PASS Lambdas in assertions
:test-result: PASS Less-than inequalities with different epsilons
:test-result: PASS ManuallyRegistered
:test-result: PASS MapGenerator can be skipped forward efficiently
:test-result: PASS MapGenerator can handle not default constructible types
:test-result: PASS Matchers can be (AllOf) composed with the && operator
:test-result: PASS Matchers can be (AnyOf) composed with the || operator
:test-result: PASS Matchers can be composed with both && and ||
@@ -210,6 +216,7 @@ Nor would this
:test-result: PASS Overloaded comma or address-of operators are not used
:test-result: PASS Parse uints
:test-result: PASS Parsed tags are matched case insensitive
:test-result: PASS Parsing path filter specs
:test-result: PASS Parsing sharding-related cli flags
:test-result: PASS Parsing tags with non-alphabetical characters is pass-through
:test-result: PASS Parsing warnings
@@ -222,11 +229,15 @@ Nor would this
:test-result: PASS Product with differing arities - std::tuple<int>
:test-result: PASS Random seed generation accepts known methods
:test-result: PASS Random seed generation reports unknown methods
:test-result: PASS RandomGenerator reports itself as infinite - float
:test-result: PASS RandomGenerator reports itself as infinite - int
:test-result: PASS RandomGenerator reports itself as infinite - long double
:test-result: PASS Range type with sentinel
:test-result: FAIL Reconstruction should be based on stringification: #914
:test-result: FAIL Regex string matcher
:test-result: PASS Registering reporter with '::' in name fails
:test-result: PASS Regression test #1
:test-result: PASS RepeatGenerator refuses infinite generators
:test-result: PASS Reporter's write listings to provided stream
:test-result: PASS Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla
:test-result: PASS SUCCEED counts as a test pass
@@ -260,6 +271,7 @@ Message from section two
:test-result: FAIL Tabs and newlines show in output
:test-result: PASS Tag alias can be registered against tag patterns
:test-result: PASS Tags with spaces and non-alphanumerical characters are accepted
:test-result: PASS TakeGenerator can be skipped forward
:test-result: PASS Template test case method with test types specified inside std::tuple - MyTypes - 0
:test-result: PASS Template test case method with test types specified inside std::tuple - MyTypes - 1
:test-result: PASS Template test case method with test types specified inside std::tuple - MyTypes - 2
@@ -299,6 +311,7 @@ Message from section two
:test-result: PASS Trim strings
:test-result: PASS Type conversions of RangeEquals and similar
:test-result: FAIL Unexpected exceptions can be translated
:test-result: FAIL Unscoped capture outlives scope
:test-result: PASS Upcasting special member functions
:test-result: PASS Usage of AllMatch range matcher
:test-result: PASS Usage of AllTrue range matcher
@@ -333,6 +346,7 @@ Message from section two
:test-result: PASS array<int, N> -> toString
:test-result: PASS benchmark function call
:test-result: PASS boolean member
:test-result: PASS cat generator
:test-result: PASS checkedElse
:test-result: FAIL checkedElse, failing
:test-result: PASS checkedIf
@@ -129,6 +129,7 @@
:test-result: PASS Comparisons with int literals don't warn when mixing signed/ unsigned
:test-result: PASS Composed generic matchers shortcircuit
:test-result: PASS Composed matchers shortcircuit
:test-result: PASS ConcatGenerator
:test-result: FAIL Contains string matcher
:test-result: PASS Copy and then generate a range
:test-result: PASS Cout stream properly declares it writes to stdout
@@ -162,11 +163,14 @@
:test-result: FAIL FAIL_CHECK does not abort the test
:test-result: PASS Factorials are computed
:test-result: PASS Filter generator throws exception for empty generator
:test-result: PASS FixedValuesGenerator can be skipped forward
:test-result: PASS Floating point matchers: double
:test-result: PASS Floating point matchers: float
:test-result: PASS GENERATE can combine literals and generators
:test-result: PASS Generator adapters properly handle isFinite
:test-result: PASS Generators -- adapters
:test-result: PASS Generators -- simple
:test-result: PASS Generators can be skipped forward
:test-result: PASS Generators internals
:test-result: PASS Greater-than inequalities with different epsilons
:test-result: PASS Hashers with different seed produce different hash with same test case
@@ -186,6 +190,8 @@
:test-result: PASS Lambdas in assertions
:test-result: PASS Less-than inequalities with different epsilons
:test-result: PASS ManuallyRegistered
:test-result: PASS MapGenerator can be skipped forward efficiently
:test-result: PASS MapGenerator can handle not default constructible types
:test-result: PASS Matchers can be (AllOf) composed with the && operator
:test-result: PASS Matchers can be (AnyOf) composed with the || operator
:test-result: PASS Matchers can be composed with both && and ||
@@ -208,6 +214,7 @@
:test-result: PASS Overloaded comma or address-of operators are not used
:test-result: PASS Parse uints
:test-result: PASS Parsed tags are matched case insensitive
:test-result: PASS Parsing path filter specs
:test-result: PASS Parsing sharding-related cli flags
:test-result: PASS Parsing tags with non-alphabetical characters is pass-through
:test-result: PASS Parsing warnings
@@ -220,11 +227,15 @@
:test-result: PASS Product with differing arities - std::tuple<int>
:test-result: PASS Random seed generation accepts known methods
:test-result: PASS Random seed generation reports unknown methods
:test-result: PASS RandomGenerator reports itself as infinite - float
:test-result: PASS RandomGenerator reports itself as infinite - int
:test-result: PASS RandomGenerator reports itself as infinite - long double
:test-result: PASS Range type with sentinel
:test-result: FAIL Reconstruction should be based on stringification: #914
:test-result: FAIL Regex string matcher
:test-result: PASS Registering reporter with '::' in name fails
:test-result: PASS Regression test #1
:test-result: PASS RepeatGenerator refuses infinite generators
:test-result: PASS Reporter's write listings to provided stream
:test-result: PASS Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla
:test-result: PASS SUCCEED counts as a test pass
@@ -253,6 +264,7 @@
:test-result: FAIL Tabs and newlines show in output
:test-result: PASS Tag alias can be registered against tag patterns
:test-result: PASS Tags with spaces and non-alphanumerical characters are accepted
:test-result: PASS TakeGenerator can be skipped forward
:test-result: PASS Template test case method with test types specified inside std::tuple - MyTypes - 0
:test-result: PASS Template test case method with test types specified inside std::tuple - MyTypes - 1
:test-result: PASS Template test case method with test types specified inside std::tuple - MyTypes - 2
@@ -292,6 +304,7 @@
:test-result: PASS Trim strings
:test-result: PASS Type conversions of RangeEquals and similar
:test-result: FAIL Unexpected exceptions can be translated
:test-result: FAIL Unscoped capture outlives scope
:test-result: PASS Upcasting special member functions
:test-result: PASS Usage of AllMatch range matcher
:test-result: PASS Usage of AllTrue range matcher
@@ -326,6 +339,7 @@
:test-result: PASS array<int, N> -> toString
:test-result: PASS benchmark function call
:test-result: PASS boolean member
:test-result: PASS cat generator
:test-result: PASS checkedElse
:test-result: FAIL checkedElse, failing
:test-result: PASS checkedIf
@@ -540,6 +540,18 @@ Matchers.tests.cpp:<line number>: passed: !second.matchCalled for: true
Matchers.tests.cpp:<line number>: passed: matcher.match( 1 ) for: true
Matchers.tests.cpp:<line number>: passed: first.matchCalled for: true
Matchers.tests.cpp:<line number>: passed: !second.matchCalled for: true
GeneratorsImpl.tests.cpp:<line number>: passed: c.get() == 1 for: 1 == 1
GeneratorsImpl.tests.cpp:<line number>: passed: !(c.next()) for: !false
GeneratorsImpl.tests.cpp:<line number>: passed: c.get() == i + 1 for: 1 == 1
GeneratorsImpl.tests.cpp:<line number>: passed: c.next() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: c.get() == i + 1 for: 2 == 2
GeneratorsImpl.tests.cpp:<line number>: passed: c.next() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: c.get() == i + 1 for: 3 == 3
GeneratorsImpl.tests.cpp:<line number>: passed: c.next() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: c.get() == i + 1 for: 4 == 4
GeneratorsImpl.tests.cpp:<line number>: passed: c.next() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: c.get() == 5 for: 5 == 5
GeneratorsImpl.tests.cpp:<line number>: passed: !(c.next()) for: !false
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), ContainsSubstring( "not there", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "not there" (case insensitive)
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), ContainsSubstring( "STRING" ) for: "this string contains 'abc' as a substring" contains: "STRING"
Generators.tests.cpp:<line number>: passed: elem % 2 == 1 for: 1 == 1
@@ -666,6 +678,12 @@ Misc.tests.cpp:<line number>: passed: Factorial(2) == 2 for: 2 == 2
Misc.tests.cpp:<line number>: passed: Factorial(3) == 6 for: 6 == 6
Misc.tests.cpp:<line number>: passed: Factorial(10) == 3628800 for: 3628800 (0x<hex digits>) == 3628800 (0x<hex digits>)
GeneratorsImpl.tests.cpp:<line number>: passed: filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException
GeneratorsImpl.tests.cpp:<line number>: passed: values.currentElementIndex() == 0 for: 0 == 0
GeneratorsImpl.tests.cpp:<line number>: passed: values.currentElementIndex() == 3 for: 3 == 3
GeneratorsImpl.tests.cpp:<line number>: passed: values.get() == 3 for: 3 == 3
GeneratorsImpl.tests.cpp:<line number>: passed: values.currentElementIndex() == 4 for: 4 == 4
GeneratorsImpl.tests.cpp:<line number>: passed: values.get() == 4 for: 4 == 4
GeneratorsImpl.tests.cpp:<line number>: passed: values.skipToNthElement( 5 )
Matchers.tests.cpp:<line number>: passed: 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.09999999999999964 are within 10% of each other
Matchers.tests.cpp:<line number>: passed: 10., !WithinRel( 11.2, 0.1 ) for: 10.0 not and 11.19999999999999929 are within 10% of each other
Matchers.tests.cpp:<line number>: passed: 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0.0 are within 99% of each other
@@ -733,6 +751,16 @@ Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
GeneratorsImpl.tests.cpp:<line number>: passed: finite_cat.isFinite() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_cat.isFinite()) for: !false
GeneratorsImpl.tests.cpp:<line number>: passed: take_1.isFinite() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: take_2.isFinite() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: finite_chunk.isFinite() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_chunk.isFinite()) for: !false
GeneratorsImpl.tests.cpp:<line number>: passed: finite_map.isFinite() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_map.isFinite()) for: !false
GeneratorsImpl.tests.cpp:<line number>: passed: finite_filter.isFinite() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_filter.isFinite()) for: !false
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
@@ -789,6 +817,15 @@ Generators.tests.cpp:<line number>: passed: j < i for: -1 < 3
Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 12 > 1
Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 12 > 2
Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 12 > 3
GeneratorsImpl.tests.cpp:<line number>: passed: generator.currentElementIndex() == 0 for: 0 == 0
GeneratorsImpl.tests.cpp:<line number>: passed: generator.currentElementIndex() == 3 for: 3 == 3
GeneratorsImpl.tests.cpp:<line number>: passed: generator.get() == 3 for: 3 == 3
GeneratorsImpl.tests.cpp:<line number>: passed: generator.currentElementIndex() == 3 for: 3 == 3
GeneratorsImpl.tests.cpp:<line number>: passed: generator.get() == 3 for: 3 == 3
GeneratorsImpl.tests.cpp:<line number>: passed: generator.currentElementIndex() == 5 for: 5 == 5
GeneratorsImpl.tests.cpp:<line number>: passed: generator.get() == 5 for: 5 == 5
GeneratorsImpl.tests.cpp:<line number>: passed: generator.skipToNthElement( 3 )
GeneratorsImpl.tests.cpp:<line number>: passed: generator.skipToNthElement( 6 )
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 123 for: 123 == 123
GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 1 for: 1 == 1
@@ -1222,6 +1259,28 @@ Approx.tests.cpp:<line number>: passed: d <= Approx( 1.22 ).epsilon(0.1) for: 1.
<=
Approx( 1.21999999999999997 )
Misc.tests.cpp:<line number>: passed: with 1 message: 'was called'
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 0 for: 0 == 0
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 0 for: 0 == 0
GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.get() == 3 for: 3 == 3
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 1 for: 1 == 1
GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.get() == 3 for: 3 == 3
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 1 for: 1 == 1
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 1 for: 1 == 1
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 0 for: 0 == 0
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 0 for: 0 == 0
GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.get() == 4 for: 4 == 4
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 1 for: 1 == 1
GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.get() == 4 for: 4 == 4
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 1 for: 1 == 1
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 1 for: 1 == 1
GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.get() == 6 for: 6 == 6
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 2 for: 2 == 2
GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.skipToNthElement( 7 )
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 2 for: 2 == 2
GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.get().m_i == 1 for: 1 == 1
GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.next() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.next() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.get().m_i == 3 for: 3 == 3
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "string" ) && ContainsSubstring( "abc" ) && ContainsSubstring( "substring" ) && ContainsSubstring( "contains" ) for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" )
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" )
Matchers.tests.cpp:<line number>: passed: testStringForMatching2(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) for: "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" )
@@ -1380,6 +1439,29 @@ Parse.tests.cpp:<line number>: passed: !(parseUInt( "0x<hex digits>", 10 )) for:
TestSpecParser.tests.cpp:<line number>: passed: spec.hasFilters() for: true
TestSpecParser.tests.cpp:<line number>: passed: spec.getInvalidSpecs().empty() for: true
TestSpecParser.tests.cpp:<line number>: passed: spec.matches( testCase ) for: true
CmdLine.tests.cpp:<line number>: passed: result for: {?}
CmdLine.tests.cpp:<line number>: passed: !(config.useNewPathFilteringBehaviour) for: !false
CmdLine.tests.cpp:<line number>: passed: result for: {?}
CmdLine.tests.cpp:<line number>: passed: config.useNewPathFilteringBehaviour for: true
CmdLine.tests.cpp:<line number>: passed: !(result) for: !{?}
CmdLine.tests.cpp:<line number>: passed: result for: {?}
CmdLine.tests.cpp:<line number>: passed: config.pathFilters[0] == PathFilter( PathFilter::For::Generator, "*" ) for: {?} == {?}
CmdLine.tests.cpp:<line number>: passed: !(result) for: !{?}
CmdLine.tests.cpp:<line number>: passed: result for: {?}
CmdLine.tests.cpp:<line number>: passed: config.useNewPathFilteringBehaviour for: true
CmdLine.tests.cpp:<line number>: passed: config.pathFilters[0] == PathFilter( PathFilter::For::Generator, "1" ) for: {?} == {?}
CmdLine.tests.cpp:<line number>: passed: config.pathFilters[1] == PathFilter( PathFilter::For::Section, "foobar" ) for: {?} == {?}
CmdLine.tests.cpp:<line number>: passed: !(result) for: !{?}
CmdLine.tests.cpp:<line number>: passed: !(result1) for: !{?}
CmdLine.tests.cpp:<line number>: passed: !(result2) for: !{?}
CmdLine.tests.cpp:<line number>: passed: result for: {?}
CmdLine.tests.cpp:<line number>: passed: config.pathFilters[0] == PathFilter( PathFilter::For::Section, "foo-bar" ) for: {?} == {?}
CmdLine.tests.cpp:<line number>: passed: config.pathFilters[1] == PathFilter( PathFilter::For::Generator, "3" ) for: {?} == {?}
CmdLine.tests.cpp:<line number>: passed: config.pathFilters[2] == PathFilter( PathFilter::For::Generator, "123" ) for: {?} == {?}
CmdLine.tests.cpp:<line number>: passed: config.pathFilters[3] == PathFilter( PathFilter::For::Section, "baz" ) for: {?} == {?}
CmdLine.tests.cpp:<line number>: passed: result for: {?}
CmdLine.tests.cpp:<line number>: passed: config.pathFilters[0] == PathFilter(PathFilter::For::Section, "untrimmed" ) for: {?} == {?}
CmdLine.tests.cpp:<line number>: passed: config.pathFilters[1] == PathFilter(PathFilter::For::Generator, "42" ) for: {?} == {?}
CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "--shard-count=8" }) for: {?}
CmdLine.tests.cpp:<line number>: passed: config.shardCount == 8 for: 8 == 8
CmdLine.tests.cpp:<line number>: passed: !(result) for: !{?}
@@ -1401,8 +1483,8 @@ TestSpecParser.tests.cpp:<line number>: passed: spec.matches( testCase ) for: tr
CmdLine.tests.cpp:<line number>: passed: cli.parse( { "test", "-w", "NoAssertions" } ) for: {?}
CmdLine.tests.cpp:<line number>: passed: config.warnings == WarnAbout::NoAssertions for: 1 == 1
CmdLine.tests.cpp:<line number>: passed: !(cli.parse( { "test", "-w", "NoTests" } )) for: !{?}
CmdLine.tests.cpp:<line number>: passed: cli.parse( { "test", "--warn", "NoAssertions", "--warn", "UnmatchedTestSpec" } ) for: {?}
CmdLine.tests.cpp:<line number>: passed: config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec ) for: 3 == 3
CmdLine.tests.cpp:<line number>: passed: cli.parse( { "test", "--warn", "NoAssertions", "--warn", "UnmatchedTestSpec", "--warn", "InfiniteGenerators" } ) for: {?}
CmdLine.tests.cpp:<line number>: passed: config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec | WarnAbout::InfiniteGenerator ) for: 7 == 7
Condition.tests.cpp:<line number>: passed: p == 0 for: 0 == 0
Condition.tests.cpp:<line number>: passed: p == pNULL for: 0 == 0
Condition.tests.cpp:<line number>: passed: p != 0 for: 0x<hex digits> != 0
@@ -1503,6 +1585,10 @@ CmdLine.tests.cpp:<line number>: passed: !result for: true
CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), ContainsSubstring( "colour mode must be one of" ) for: "colour mode must be one of: default, ansi, win32, or none. 'wrong' is not recognised" contains: "colour mode must be one of"
CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "--benchmark-samples=200" }) for: {?}
CmdLine.tests.cpp:<line number>: passed: config.benchmarkSamples == 200 for: 200 == 200
CmdLine.tests.cpp:<line number>: passed: !(result) for: !{?}
CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), ContainsSubstring("Benchmark samples must be greater than 0") for: "Benchmark samples must be greater than 0" contains: "Benchmark samples must be greater than 0"
CmdLine.tests.cpp:<line number>: passed: !(result) for: !{?}
CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), ContainsSubstring("Could not parse 'abc' as benchmark samples") for: "Could not parse 'abc' as benchmark samples" contains: "Could not parse 'abc' as benchmark samples"
CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "--benchmark-resamples=20000" }) for: {?}
CmdLine.tests.cpp:<line number>: passed: config.benchmarkResamples == 20000 for: 20000 (0x<hex digits>) == 20000 (0x<hex digits>)
CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "--benchmark-confidence-interval=0.99" }) for: {?}
@@ -1520,6 +1606,9 @@ RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSee
RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method)
RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method)
RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77))
GeneratorsImpl.tests.cpp:<line number>: passed: !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
GeneratorsImpl.tests.cpp:<line number>: passed: !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
GeneratorsImpl.tests.cpp:<line number>: passed: !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
ToString.tests.cpp:<line number>: passed: Catch::Detail::stringify(UsesSentinel{}) == "{ }" for: "{ }" == "{ }"
Decomposition.tests.cpp:<line number>: failed: truthy(false) for: Hey, its truthy!
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches( "this STRING contains 'abc' as a substring" ) for: "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively
@@ -1527,6 +1616,7 @@ Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches( "con
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches( "this string contains 'abc' as a" ) for: "this string contains 'abc' as a substring" matches "this string contains 'abc' as a" case sensitively
Reporters.tests.cpp:<line number>: passed: registry.registerReporter( "with::doublecolons", Catch::Detail::make_unique<TestReporterFactory>() ), "'::' is not allowed in reporter name: 'with::doublecolons'" for: "'::' is not allowed in reporter name: 'with::doublecolons'" equals: "'::' is not allowed in reporter name: 'with::doublecolons'"
Matchers.tests.cpp:<line number>: passed: actual, !UnorderedEquals( expected ) for: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' }
GeneratorsImpl.tests.cpp:<line number>: passed: RepeatGenerator<int>( 2, random( 1, 100 ) )
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "All available tags:
1 [fakeTag]
@@ -1905,6 +1995,14 @@ Tag.tests.cpp:<line number>: passed: registry.add( "@no square bracket at start]
Tag.tests.cpp:<line number>: passed: registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) )
Tag.tests.cpp:<line number>: passed: testCase.tags.size() == 2 for: 2 == 2
Tag.tests.cpp:<line number>: passed: testCase.tags, VectorContains( Tag( "tag with spaces" ) ) && VectorContains( Tag( "I said \"good day\" sir!"_catch_sr ) ) for: { {?}, {?} } ( Contains: {?} and Contains: {?} )
GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 0 for: 0 == 0
GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 2 for: 2 == 2
GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 5 for: 5 == 5
GeneratorsImpl.tests.cpp:<line number>: passed: take.skipToNthElement( 6 )
GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 0 for: 0 == 0
GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 2 for: 2 == 2
GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 5 for: 5 == 5
GeneratorsImpl.tests.cpp:<line number>: passed: take.skipToNthElement( 6 )
Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1 == 1
Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1 == 1
Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1.0 == 1
@@ -2201,6 +2299,7 @@ MatchersRanges.tests.cpp:<line number>: passed: a, UnorderedRangeEquals( b ) for
MatchersRanges.tests.cpp:<line number>: passed: vector_a, RangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } elements are { 2, 3, 4 }
MatchersRanges.tests.cpp:<line number>: passed: vector_a, UnorderedRangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } unordered elements are { 2, 3, 4 }
Exception.tests.cpp:<line number>: failed: unexpected exception with message: '3.14000000000000012'
Message.tests.cpp:<line number>: failed: false with 3 messages: 'i := 1' and 'j := 2' and 'i + j := 3'
UniquePtr.tests.cpp:<line number>: passed: bptr->i == 3 for: 3 == 3
UniquePtr.tests.cpp:<line number>: passed: bptr->i == 3 for: 3 == 3
MatchersRanges.tests.cpp:<line number>: passed: data, AllMatch(SizeIs(5)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } all match has size == 5
@@ -2478,6 +2577,14 @@ InternalBenchmark.tests.cpp:<line number>: passed: model.started == 0 for: 0 ==
InternalBenchmark.tests.cpp:<line number>: passed: model.finished == 0 for: 0 == 0
InternalBenchmark.tests.cpp:<line number>: passed: called == 1 for: 1 == 1
Tricky.tests.cpp:<line number>: passed: obj.prop != 0 for: 0x<hex digits> != 0
Generators.tests.cpp:<line number>: passed: input < 3 for: 0 < 3
Generators.tests.cpp:<line number>: passed: input < 3 for: 1 < 3
Generators.tests.cpp:<line number>: passed: input < 3 for: 2 < 3
Generators.tests.cpp:<line number>: passed: input % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: input % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: input % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: input % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: input % 2 == 0 for: 0 == 0
Misc.tests.cpp:<line number>: passed: flag for: true
Misc.tests.cpp:<line number>: passed: testCheckedElse( true ) for: true
Misc.tests.cpp:<line number>: failed - but was ok: flag for: false
@@ -2890,7 +2997,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: 436 | 317 passed | 95 failed | 6 skipped | 18 failed as expected
assertions: 2305 | 2106 passed | 157 failed | 42 failed as expected
test cases: 450 | 330 passed | 96 failed | 6 skipped | 18 failed as expected
assertions: 2413 | 2212 passed | 158 failed | 43 failed as expected
@@ -538,6 +538,18 @@ Matchers.tests.cpp:<line number>: passed: !second.matchCalled for: true
Matchers.tests.cpp:<line number>: passed: matcher.match( 1 ) for: true
Matchers.tests.cpp:<line number>: passed: first.matchCalled for: true
Matchers.tests.cpp:<line number>: passed: !second.matchCalled for: true
GeneratorsImpl.tests.cpp:<line number>: passed: c.get() == 1 for: 1 == 1
GeneratorsImpl.tests.cpp:<line number>: passed: !(c.next()) for: !false
GeneratorsImpl.tests.cpp:<line number>: passed: c.get() == i + 1 for: 1 == 1
GeneratorsImpl.tests.cpp:<line number>: passed: c.next() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: c.get() == i + 1 for: 2 == 2
GeneratorsImpl.tests.cpp:<line number>: passed: c.next() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: c.get() == i + 1 for: 3 == 3
GeneratorsImpl.tests.cpp:<line number>: passed: c.next() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: c.get() == i + 1 for: 4 == 4
GeneratorsImpl.tests.cpp:<line number>: passed: c.next() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: c.get() == 5 for: 5 == 5
GeneratorsImpl.tests.cpp:<line number>: passed: !(c.next()) for: !false
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), ContainsSubstring( "not there", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "not there" (case insensitive)
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), ContainsSubstring( "STRING" ) for: "this string contains 'abc' as a substring" contains: "STRING"
Generators.tests.cpp:<line number>: passed: elem % 2 == 1 for: 1 == 1
@@ -664,6 +676,12 @@ Misc.tests.cpp:<line number>: passed: Factorial(2) == 2 for: 2 == 2
Misc.tests.cpp:<line number>: passed: Factorial(3) == 6 for: 6 == 6
Misc.tests.cpp:<line number>: passed: Factorial(10) == 3628800 for: 3628800 (0x<hex digits>) == 3628800 (0x<hex digits>)
GeneratorsImpl.tests.cpp:<line number>: passed: filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException
GeneratorsImpl.tests.cpp:<line number>: passed: values.currentElementIndex() == 0 for: 0 == 0
GeneratorsImpl.tests.cpp:<line number>: passed: values.currentElementIndex() == 3 for: 3 == 3
GeneratorsImpl.tests.cpp:<line number>: passed: values.get() == 3 for: 3 == 3
GeneratorsImpl.tests.cpp:<line number>: passed: values.currentElementIndex() == 4 for: 4 == 4
GeneratorsImpl.tests.cpp:<line number>: passed: values.get() == 4 for: 4 == 4
GeneratorsImpl.tests.cpp:<line number>: passed: values.skipToNthElement( 5 )
Matchers.tests.cpp:<line number>: passed: 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.09999999999999964 are within 10% of each other
Matchers.tests.cpp:<line number>: passed: 10., !WithinRel( 11.2, 0.1 ) for: 10.0 not and 11.19999999999999929 are within 10% of each other
Matchers.tests.cpp:<line number>: passed: 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0.0 are within 99% of each other
@@ -731,6 +749,16 @@ Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
GeneratorsImpl.tests.cpp:<line number>: passed: finite_cat.isFinite() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_cat.isFinite()) for: !false
GeneratorsImpl.tests.cpp:<line number>: passed: take_1.isFinite() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: take_2.isFinite() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: finite_chunk.isFinite() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_chunk.isFinite()) for: !false
GeneratorsImpl.tests.cpp:<line number>: passed: finite_map.isFinite() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_map.isFinite()) for: !false
GeneratorsImpl.tests.cpp:<line number>: passed: finite_filter.isFinite() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_filter.isFinite()) for: !false
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
@@ -787,6 +815,15 @@ Generators.tests.cpp:<line number>: passed: j < i for: -1 < 3
Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 12 > 1
Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 12 > 2
Generators.tests.cpp:<line number>: passed: 4u * i > str.size() for: 12 > 3
GeneratorsImpl.tests.cpp:<line number>: passed: generator.currentElementIndex() == 0 for: 0 == 0
GeneratorsImpl.tests.cpp:<line number>: passed: generator.currentElementIndex() == 3 for: 3 == 3
GeneratorsImpl.tests.cpp:<line number>: passed: generator.get() == 3 for: 3 == 3
GeneratorsImpl.tests.cpp:<line number>: passed: generator.currentElementIndex() == 3 for: 3 == 3
GeneratorsImpl.tests.cpp:<line number>: passed: generator.get() == 3 for: 3 == 3
GeneratorsImpl.tests.cpp:<line number>: passed: generator.currentElementIndex() == 5 for: 5 == 5
GeneratorsImpl.tests.cpp:<line number>: passed: generator.get() == 5 for: 5 == 5
GeneratorsImpl.tests.cpp:<line number>: passed: generator.skipToNthElement( 3 )
GeneratorsImpl.tests.cpp:<line number>: passed: generator.skipToNthElement( 6 )
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 123 for: 123 == 123
GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 1 for: 1 == 1
@@ -1220,6 +1257,28 @@ Approx.tests.cpp:<line number>: passed: d <= Approx( 1.22 ).epsilon(0.1) for: 1.
<=
Approx( 1.21999999999999997 )
Misc.tests.cpp:<line number>: passed: with 1 message: 'was called'
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 0 for: 0 == 0
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 0 for: 0 == 0
GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.get() == 3 for: 3 == 3
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 1 for: 1 == 1
GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.get() == 3 for: 3 == 3
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 1 for: 1 == 1
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 1 for: 1 == 1
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 0 for: 0 == 0
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 0 for: 0 == 0
GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.get() == 4 for: 4 == 4
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 1 for: 1 == 1
GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.get() == 4 for: 4 == 4
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 1 for: 1 == 1
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 1 for: 1 == 1
GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.get() == 6 for: 6 == 6
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 2 for: 2 == 2
GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.skipToNthElement( 7 )
GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == 2 for: 2 == 2
GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.get().m_i == 1 for: 1 == 1
GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.next() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.next() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.get().m_i == 3 for: 3 == 3
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "string" ) && ContainsSubstring( "abc" ) && ContainsSubstring( "substring" ) && ContainsSubstring( "contains" ) for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" )
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" )
Matchers.tests.cpp:<line number>: passed: testStringForMatching2(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) for: "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" )
@@ -1378,6 +1437,29 @@ Parse.tests.cpp:<line number>: passed: !(parseUInt( "0x<hex digits>", 10 )) for:
TestSpecParser.tests.cpp:<line number>: passed: spec.hasFilters() for: true
TestSpecParser.tests.cpp:<line number>: passed: spec.getInvalidSpecs().empty() for: true
TestSpecParser.tests.cpp:<line number>: passed: spec.matches( testCase ) for: true
CmdLine.tests.cpp:<line number>: passed: result for: {?}
CmdLine.tests.cpp:<line number>: passed: !(config.useNewPathFilteringBehaviour) for: !false
CmdLine.tests.cpp:<line number>: passed: result for: {?}
CmdLine.tests.cpp:<line number>: passed: config.useNewPathFilteringBehaviour for: true
CmdLine.tests.cpp:<line number>: passed: !(result) for: !{?}
CmdLine.tests.cpp:<line number>: passed: result for: {?}
CmdLine.tests.cpp:<line number>: passed: config.pathFilters[0] == PathFilter( PathFilter::For::Generator, "*" ) for: {?} == {?}
CmdLine.tests.cpp:<line number>: passed: !(result) for: !{?}
CmdLine.tests.cpp:<line number>: passed: result for: {?}
CmdLine.tests.cpp:<line number>: passed: config.useNewPathFilteringBehaviour for: true
CmdLine.tests.cpp:<line number>: passed: config.pathFilters[0] == PathFilter( PathFilter::For::Generator, "1" ) for: {?} == {?}
CmdLine.tests.cpp:<line number>: passed: config.pathFilters[1] == PathFilter( PathFilter::For::Section, "foobar" ) for: {?} == {?}
CmdLine.tests.cpp:<line number>: passed: !(result) for: !{?}
CmdLine.tests.cpp:<line number>: passed: !(result1) for: !{?}
CmdLine.tests.cpp:<line number>: passed: !(result2) for: !{?}
CmdLine.tests.cpp:<line number>: passed: result for: {?}
CmdLine.tests.cpp:<line number>: passed: config.pathFilters[0] == PathFilter( PathFilter::For::Section, "foo-bar" ) for: {?} == {?}
CmdLine.tests.cpp:<line number>: passed: config.pathFilters[1] == PathFilter( PathFilter::For::Generator, "3" ) for: {?} == {?}
CmdLine.tests.cpp:<line number>: passed: config.pathFilters[2] == PathFilter( PathFilter::For::Generator, "123" ) for: {?} == {?}
CmdLine.tests.cpp:<line number>: passed: config.pathFilters[3] == PathFilter( PathFilter::For::Section, "baz" ) for: {?} == {?}
CmdLine.tests.cpp:<line number>: passed: result for: {?}
CmdLine.tests.cpp:<line number>: passed: config.pathFilters[0] == PathFilter(PathFilter::For::Section, "untrimmed" ) for: {?} == {?}
CmdLine.tests.cpp:<line number>: passed: config.pathFilters[1] == PathFilter(PathFilter::For::Generator, "42" ) for: {?} == {?}
CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "--shard-count=8" }) for: {?}
CmdLine.tests.cpp:<line number>: passed: config.shardCount == 8 for: 8 == 8
CmdLine.tests.cpp:<line number>: passed: !(result) for: !{?}
@@ -1399,8 +1481,8 @@ TestSpecParser.tests.cpp:<line number>: passed: spec.matches( testCase ) for: tr
CmdLine.tests.cpp:<line number>: passed: cli.parse( { "test", "-w", "NoAssertions" } ) for: {?}
CmdLine.tests.cpp:<line number>: passed: config.warnings == WarnAbout::NoAssertions for: 1 == 1
CmdLine.tests.cpp:<line number>: passed: !(cli.parse( { "test", "-w", "NoTests" } )) for: !{?}
CmdLine.tests.cpp:<line number>: passed: cli.parse( { "test", "--warn", "NoAssertions", "--warn", "UnmatchedTestSpec" } ) for: {?}
CmdLine.tests.cpp:<line number>: passed: config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec ) for: 3 == 3
CmdLine.tests.cpp:<line number>: passed: cli.parse( { "test", "--warn", "NoAssertions", "--warn", "UnmatchedTestSpec", "--warn", "InfiniteGenerators" } ) for: {?}
CmdLine.tests.cpp:<line number>: passed: config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec | WarnAbout::InfiniteGenerator ) for: 7 == 7
Condition.tests.cpp:<line number>: passed: p == 0 for: 0 == 0
Condition.tests.cpp:<line number>: passed: p == pNULL for: 0 == 0
Condition.tests.cpp:<line number>: passed: p != 0 for: 0x<hex digits> != 0
@@ -1501,6 +1583,10 @@ CmdLine.tests.cpp:<line number>: passed: !result for: true
CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), ContainsSubstring( "colour mode must be one of" ) for: "colour mode must be one of: default, ansi, win32, or none. 'wrong' is not recognised" contains: "colour mode must be one of"
CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "--benchmark-samples=200" }) for: {?}
CmdLine.tests.cpp:<line number>: passed: config.benchmarkSamples == 200 for: 200 == 200
CmdLine.tests.cpp:<line number>: passed: !(result) for: !{?}
CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), ContainsSubstring("Benchmark samples must be greater than 0") for: "Benchmark samples must be greater than 0" contains: "Benchmark samples must be greater than 0"
CmdLine.tests.cpp:<line number>: passed: !(result) for: !{?}
CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), ContainsSubstring("Could not parse 'abc' as benchmark samples") for: "Could not parse 'abc' as benchmark samples" contains: "Could not parse 'abc' as benchmark samples"
CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "--benchmark-resamples=20000" }) for: {?}
CmdLine.tests.cpp:<line number>: passed: config.benchmarkResamples == 20000 for: 20000 (0x<hex digits>) == 20000 (0x<hex digits>)
CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "--benchmark-confidence-interval=0.99" }) for: {?}
@@ -1518,6 +1604,9 @@ RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSee
RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method)
RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method)
RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77))
GeneratorsImpl.tests.cpp:<line number>: passed: !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
GeneratorsImpl.tests.cpp:<line number>: passed: !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
GeneratorsImpl.tests.cpp:<line number>: passed: !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
ToString.tests.cpp:<line number>: passed: Catch::Detail::stringify(UsesSentinel{}) == "{ }" for: "{ }" == "{ }"
Decomposition.tests.cpp:<line number>: failed: truthy(false) for: Hey, its truthy!
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches( "this STRING contains 'abc' as a substring" ) for: "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively
@@ -1525,6 +1614,7 @@ Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches( "con
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches( "this string contains 'abc' as a" ) for: "this string contains 'abc' as a substring" matches "this string contains 'abc' as a" case sensitively
Reporters.tests.cpp:<line number>: passed: registry.registerReporter( "with::doublecolons", Catch::Detail::make_unique<TestReporterFactory>() ), "'::' is not allowed in reporter name: 'with::doublecolons'" for: "'::' is not allowed in reporter name: 'with::doublecolons'" equals: "'::' is not allowed in reporter name: 'with::doublecolons'"
Matchers.tests.cpp:<line number>: passed: actual, !UnorderedEquals( expected ) for: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' }
GeneratorsImpl.tests.cpp:<line number>: passed: RepeatGenerator<int>( 2, random( 1, 100 ) )
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "All available tags:
1 [fakeTag]
@@ -1898,6 +1988,14 @@ Tag.tests.cpp:<line number>: passed: registry.add( "@no square bracket at start]
Tag.tests.cpp:<line number>: passed: registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) )
Tag.tests.cpp:<line number>: passed: testCase.tags.size() == 2 for: 2 == 2
Tag.tests.cpp:<line number>: passed: testCase.tags, VectorContains( Tag( "tag with spaces" ) ) && VectorContains( Tag( "I said \"good day\" sir!"_catch_sr ) ) for: { {?}, {?} } ( Contains: {?} and Contains: {?} )
GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 0 for: 0 == 0
GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 2 for: 2 == 2
GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 5 for: 5 == 5
GeneratorsImpl.tests.cpp:<line number>: passed: take.skipToNthElement( 6 )
GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 0 for: 0 == 0
GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 2 for: 2 == 2
GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 5 for: 5 == 5
GeneratorsImpl.tests.cpp:<line number>: passed: take.skipToNthElement( 6 )
Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1 == 1
Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1 == 1
Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1.0 == 1
@@ -2194,6 +2292,7 @@ MatchersRanges.tests.cpp:<line number>: passed: a, UnorderedRangeEquals( b ) for
MatchersRanges.tests.cpp:<line number>: passed: vector_a, RangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } elements are { 2, 3, 4 }
MatchersRanges.tests.cpp:<line number>: passed: vector_a, UnorderedRangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } unordered elements are { 2, 3, 4 }
Exception.tests.cpp:<line number>: failed: unexpected exception with message: '3.14000000000000012'
Message.tests.cpp:<line number>: failed: false with 3 messages: 'i := 1' and 'j := 2' and 'i + j := 3'
UniquePtr.tests.cpp:<line number>: passed: bptr->i == 3 for: 3 == 3
UniquePtr.tests.cpp:<line number>: passed: bptr->i == 3 for: 3 == 3
MatchersRanges.tests.cpp:<line number>: passed: data, AllMatch(SizeIs(5)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } all match has size == 5
@@ -2471,6 +2570,14 @@ InternalBenchmark.tests.cpp:<line number>: passed: model.started == 0 for: 0 ==
InternalBenchmark.tests.cpp:<line number>: passed: model.finished == 0 for: 0 == 0
InternalBenchmark.tests.cpp:<line number>: passed: called == 1 for: 1 == 1
Tricky.tests.cpp:<line number>: passed: obj.prop != 0 for: 0x<hex digits> != 0
Generators.tests.cpp:<line number>: passed: input < 3 for: 0 < 3
Generators.tests.cpp:<line number>: passed: input < 3 for: 1 < 3
Generators.tests.cpp:<line number>: passed: input < 3 for: 2 < 3
Generators.tests.cpp:<line number>: passed: input % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: input % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: input % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: input % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: input % 2 == 0 for: 0 == 0
Misc.tests.cpp:<line number>: passed: flag for: true
Misc.tests.cpp:<line number>: passed: testCheckedElse( true ) for: true
Misc.tests.cpp:<line number>: failed - but was ok: flag for: false
@@ -2879,7 +2986,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: 436 | 317 passed | 95 failed | 6 skipped | 18 failed as expected
assertions: 2305 | 2106 passed | 157 failed | 42 failed as expected
test cases: 450 | 330 passed | 96 failed | 6 skipped | 18 failed as expected
assertions: 2413 | 2212 passed | 158 failed | 43 failed as expected
@@ -1203,6 +1203,19 @@ Exception.tests.cpp:<line number>: FAILED:
due to unexpected exception with message:
3.14000000000000012
-------------------------------------------------------------------------------
Unscoped capture outlives scope
-------------------------------------------------------------------------------
Message.tests.cpp:<line number>
...............................................................................
Message.tests.cpp:<line number>: FAILED:
REQUIRE( false )
with messages:
i := 1
j := 2
i + j := 3
-------------------------------------------------------------------------------
Vector Approx matcher -- failing
Empty and non empty vectors are not approx equal
@@ -1730,6 +1743,6 @@ due to unexpected exception with message:
Why would you throw a std::string?
===============================================================================
test cases: 436 | 335 passed | 76 failed | 7 skipped | 18 failed as expected
assertions: 2284 | 2106 passed | 136 failed | 42 failed as expected
test cases: 450 | 348 passed | 76 failed | 7 skipped | 19 failed as expected
assertions: 2391 | 2212 passed | 136 failed | 43 failed as expected
@@ -3911,6 +3911,80 @@ Matchers.tests.cpp:<line number>: PASSED:
with expansion:
true
-------------------------------------------------------------------------------
ConcatGenerator
Cat support single-generator construction
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( c.get() == 1 )
with expansion:
1 == 1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( c.next() )
with expansion:
!false
-------------------------------------------------------------------------------
ConcatGenerator
Iterating over multiple generators
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( c.get() == i + 1 )
with expansion:
1 == 1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( c.next() )
with expansion:
true
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( c.get() == i + 1 )
with expansion:
2 == 2
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( c.next() )
with expansion:
true
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( c.get() == i + 1 )
with expansion:
3 == 3
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( c.next() )
with expansion:
true
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( c.get() == i + 1 )
with expansion:
4 == 4
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( c.next() )
with expansion:
true
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( c.get() == 5 )
with expansion:
5 == 5
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( c.next() )
with expansion:
!false
-------------------------------------------------------------------------------
Contains string matcher
-------------------------------------------------------------------------------
@@ -4758,6 +4832,40 @@ GeneratorsImpl.tests.cpp:<line number>
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_THROWS_AS( filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException )
-------------------------------------------------------------------------------
FixedValuesGenerator can be skipped forward
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( values.currentElementIndex() == 0 )
with expansion:
0 == 0
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( values.currentElementIndex() == 3 )
with expansion:
3 == 3
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( values.get() == 3 )
with expansion:
3 == 3
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( values.currentElementIndex() == 4 )
with expansion:
4 == 4
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( values.get() == 4 )
with expansion:
4 == 4
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_THROWS( values.skipToNthElement( 5 ) )
-------------------------------------------------------------------------------
Floating point matchers: double
Relative
@@ -5206,6 +5314,91 @@ Generators.tests.cpp:<line number>: PASSED:
with expansion:
0 == 0
-------------------------------------------------------------------------------
Generator adapters properly handle isFinite
concat generator
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( finite_cat.isFinite() )
with expansion:
true
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( infinite_cat.isFinite() )
with expansion:
!false
-------------------------------------------------------------------------------
Generator adapters properly handle isFinite
take generator
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( take_1.isFinite() )
with expansion:
true
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( take_2.isFinite() )
with expansion:
true
-------------------------------------------------------------------------------
Generator adapters properly handle isFinite
chunk generator
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( finite_chunk.isFinite() )
with expansion:
true
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( infinite_chunk.isFinite() )
with expansion:
!false
-------------------------------------------------------------------------------
Generator adapters properly handle isFinite
map
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( finite_map.isFinite() )
with expansion:
true
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( infinite_map.isFinite() )
with expansion:
!false
-------------------------------------------------------------------------------
Generator adapters properly handle isFinite
filter
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( finite_filter.isFinite() )
with expansion:
true
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( infinite_filter.isFinite() )
with expansion:
!false
-------------------------------------------------------------------------------
Generators -- adapters
Filtering by predicate
@@ -5847,6 +6040,53 @@ Generators.tests.cpp:<line number>: PASSED:
with expansion:
12 > 3
-------------------------------------------------------------------------------
Generators can be skipped forward
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( generator.currentElementIndex() == 0 )
with expansion:
0 == 0
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( generator.currentElementIndex() == 3 )
with expansion:
3 == 3
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( generator.get() == 3 )
with expansion:
3 == 3
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( generator.currentElementIndex() == 3 )
with expansion:
3 == 3
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( generator.get() == 3 )
with expansion:
3 == 3
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( generator.currentElementIndex() == 5 )
with expansion:
5 == 5
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( generator.get() == 5 )
with expansion:
5 == 5
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_THROWS( generator.skipToNthElement( 3 ) )
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_THROWS( generator.skipToNthElement( 6 ) )
-------------------------------------------------------------------------------
Generators internals
Single value
@@ -8013,6 +8253,134 @@ Misc.tests.cpp:<line number>: PASSED:
with message:
was called
-------------------------------------------------------------------------------
MapGenerator can be skipped forward efficiently
via calls to next()
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 0 )
with expansion:
0 == 0
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 0 )
with expansion:
0 == 0
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_generator.get() == 3 )
with expansion:
3 == 3
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 1 )
with expansion:
1 == 1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_generator.get() == 3 )
with expansion:
3 == 3
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 1 )
with expansion:
1 == 1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 1 )
with expansion:
1 == 1
-------------------------------------------------------------------------------
MapGenerator can be skipped forward efficiently
via calls to skipToNthElement()
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 0 )
with expansion:
0 == 0
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 0 )
with expansion:
0 == 0
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_generator.get() == 4 )
with expansion:
4 == 4
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 1 )
with expansion:
1 == 1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_generator.get() == 4 )
with expansion:
4 == 4
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 1 )
with expansion:
1 == 1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 1 )
with expansion:
1 == 1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_generator.get() == 6 )
with expansion:
6 == 6
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 2 )
with expansion:
2 == 2
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_THROWS( map_generator.skipToNthElement( 7 ) )
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 2 )
with expansion:
2 == 2
-------------------------------------------------------------------------------
MapGenerator can handle not default constructible types
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_generator.get().m_i == 1 )
with expansion:
1 == 1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_generator.next() )
with expansion:
true
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_generator.next() )
with expansion:
true
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_generator.get().m_i == 3 )
with expansion:
3 == 3
-------------------------------------------------------------------------------
Matchers can be (AllOf) composed with the && operator
-------------------------------------------------------------------------------
@@ -8946,6 +9314,191 @@ TestSpecParser.tests.cpp:<line number>: PASSED:
with expansion:
true
-------------------------------------------------------------------------------
Parsing path filter specs
Only section specs leads to old filter behaviour
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( result )
with expansion:
{?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( config.useNewPathFilteringBehaviour )
with expansion:
!false
-------------------------------------------------------------------------------
Parsing path filter specs
Generator specs enable new filter behaviour
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( result )
with expansion:
{?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.useNewPathFilteringBehaviour )
with expansion:
true
-------------------------------------------------------------------------------
Parsing path filter specs
Generator specs do not accept stringish arguments
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( result )
with expansion:
!{?}
-------------------------------------------------------------------------------
Parsing path filter specs
Generator specs accept star as argument
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( result )
with expansion:
{?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.pathFilters[0] == PathFilter( PathFilter::For::Generator, "*" ) )
with expansion:
{?} == {?}
-------------------------------------------------------------------------------
Parsing path filter specs
Generator specs do not accept negative numbers
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( result )
with expansion:
!{?}
-------------------------------------------------------------------------------
Parsing path filter specs
Generic path spec enables new filter behaviour
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( result )
with expansion:
{?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.useNewPathFilteringBehaviour )
with expansion:
true
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.pathFilters[0] == PathFilter( PathFilter::For::Generator, "1" ) )
with expansion:
{?} == {?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.pathFilters[1] == PathFilter( PathFilter::For::Section, "foobar" ) )
with expansion:
{?} == {?}
-------------------------------------------------------------------------------
Parsing path filter specs
Generic path spec for generator is validated
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( result )
with expansion:
!{?}
-------------------------------------------------------------------------------
Parsing path filter specs
Generic path spec without colon is rejected
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( result1 )
with expansion:
!{?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( result2 )
with expansion:
!{?}
-------------------------------------------------------------------------------
Parsing path filter specs
Using both section and generator filters creates filter stack
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( result )
with expansion:
{?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.pathFilters[0] == PathFilter( PathFilter::For::Section, "foo-bar" ) )
with expansion:
{?} == {?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.pathFilters[1] == PathFilter( PathFilter::For::Generator, "3" ) )
with expansion:
{?} == {?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.pathFilters[2] == PathFilter( PathFilter::For::Generator, "123" ) )
with expansion:
{?} == {?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.pathFilters[3] == PathFilter( PathFilter::For::Section, "baz" ) )
with expansion:
{?} == {?}
-------------------------------------------------------------------------------
Parsing path filter specs
Section/generator filters are whitespace trimmed
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( result )
with expansion:
{?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.pathFilters[0] == PathFilter(PathFilter::For::Section, "untrimmed" ) )
with expansion:
{?} == {?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.pathFilters[1] == PathFilter(PathFilter::For::Generator, "42" ) )
with expansion:
{?} == {?}
-------------------------------------------------------------------------------
Parsing sharding-related cli flags
shard-count
@@ -9141,14 +9694,14 @@ CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( cli.parse( { "test", "--warn", "NoAssertions", "--warn", "UnmatchedTestSpec" } ) )
REQUIRE( cli.parse( { "test", "--warn", "NoAssertions", "--warn", "UnmatchedTestSpec", "--warn", "InfiniteGenerators" } ) )
with expansion:
{?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec ) )
REQUIRE( config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec | WarnAbout::InfiniteGenerator ) )
with expansion:
3 == 3
7 == 7
-------------------------------------------------------------------------------
Pointers can be compared to null
@@ -9987,6 +10540,44 @@ CmdLine.tests.cpp:<line number>: PASSED:
with expansion:
200 == 200
-------------------------------------------------------------------------------
Process can be configured on command line
Benchmark options
samples must be greater than zero
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
CHECK_FALSE( result )
with expansion:
!{?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( result.errorMessage(), ContainsSubstring("Benchmark samples must be greater than 0") )
with expansion:
"Benchmark samples must be greater than 0" contains: "Benchmark samples must
be greater than 0"
-------------------------------------------------------------------------------
Process can be configured on command line
Benchmark options
samples must be parseable
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
CHECK_FALSE( result )
with expansion:
!{?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( result.errorMessage(), ContainsSubstring("Could not parse 'abc' as benchmark samples") )
with expansion:
"Could not parse 'abc' as benchmark samples" contains: "Could not parse 'abc'
as benchmark samples"
-------------------------------------------------------------------------------
Process can be configured on command line
Benchmark options
@@ -10130,6 +10721,39 @@ RandomNumberGeneration.tests.cpp:<line number>
RandomNumberGeneration.tests.cpp:<line number>: PASSED:
REQUIRE_THROWS( Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77)) )
-------------------------------------------------------------------------------
RandomGenerator reports itself as infinite - float
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite() )
with expansion:
!false
-------------------------------------------------------------------------------
RandomGenerator reports itself as infinite - int
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite() )
with expansion:
!false
-------------------------------------------------------------------------------
RandomGenerator reports itself as infinite - long double
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite() )
with expansion:
!false
-------------------------------------------------------------------------------
Range type with sentinel
-------------------------------------------------------------------------------
@@ -10199,6 +10823,15 @@ Matchers.tests.cpp:<line number>: PASSED:
with expansion:
{ 'a', 'b' } not UnorderedEquals: { 'c', 'b' }
-------------------------------------------------------------------------------
RepeatGenerator refuses infinite generators
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_THROWS( RepeatGenerator<int>( 2, random( 1, 100 ) ) )
-------------------------------------------------------------------------------
Reporter's write listings to provided stream
-------------------------------------------------------------------------------
@@ -12078,6 +12711,56 @@ Tag.tests.cpp:<line number>: PASSED:
with expansion:
{ {?}, {?} } ( Contains: {?} and Contains: {?} )
-------------------------------------------------------------------------------
TakeGenerator can be skipped forward
take is shorter than underlying
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( take.get() == 0 )
with expansion:
0 == 0
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( take.get() == 2 )
with expansion:
2 == 2
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( take.get() == 5 )
with expansion:
5 == 5
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_THROWS( take.skipToNthElement( 6 ) )
-------------------------------------------------------------------------------
TakeGenerator can be skipped forward
take is longer than underlying
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( take.get() == 0 )
with expansion:
0 == 0
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( take.get() == 2 )
with expansion:
2 == 2
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( take.get() == 5 )
with expansion:
5 == 5
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_THROWS( take.skipToNthElement( 6 ) )
-------------------------------------------------------------------------------
Template test case method with test types specified inside std::tuple - MyTypes
- 0
@@ -14286,6 +14969,29 @@ Exception.tests.cpp:<line number>: FAILED:
due to unexpected exception with message:
3.14000000000000012
-------------------------------------------------------------------------------
Unscoped capture outlives scope
A
-------------------------------------------------------------------------------
Message.tests.cpp:<line number>
...............................................................................
No assertions in section 'A'
-------------------------------------------------------------------------------
Unscoped capture outlives scope
-------------------------------------------------------------------------------
Message.tests.cpp:<line number>
...............................................................................
Message.tests.cpp:<line number>: FAILED:
REQUIRE( false )
with messages:
i := 1
j := 2
i + j := 3
-------------------------------------------------------------------------------
Upcasting special member functions
Move constructor
@@ -16379,6 +17085,102 @@ Tricky.tests.cpp:<line number>: PASSED:
with expansion:
0x<hex digits> != 0
-------------------------------------------------------------------------------
cat generator
Simple usage
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( input < 3 )
with expansion:
0 < 3
-------------------------------------------------------------------------------
cat generator
Simple usage
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( input < 3 )
with expansion:
1 < 3
-------------------------------------------------------------------------------
cat generator
Simple usage
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( input < 3 )
with expansion:
2 < 3
-------------------------------------------------------------------------------
cat generator
Used in map
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( input % 2 == 0 )
with expansion:
0 == 0
-------------------------------------------------------------------------------
cat generator
Used in map
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( input % 2 == 0 )
with expansion:
0 == 0
-------------------------------------------------------------------------------
cat generator
Used in map
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( input % 2 == 0 )
with expansion:
0 == 0
-------------------------------------------------------------------------------
cat generator
Used in map
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( input % 2 == 0 )
with expansion:
0 == 0
-------------------------------------------------------------------------------
cat generator
Used in map
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( input % 2 == 0 )
with expansion:
0 == 0
-------------------------------------------------------------------------------
checkedElse
-------------------------------------------------------------------------------
@@ -19311,6 +20113,6 @@ Misc.tests.cpp:<line number>
Misc.tests.cpp:<line number>: PASSED:
===============================================================================
test cases: 436 | 317 passed | 95 failed | 6 skipped | 18 failed as expected
assertions: 2305 | 2106 passed | 157 failed | 42 failed as expected
test cases: 450 | 330 passed | 96 failed | 6 skipped | 18 failed as expected
assertions: 2413 | 2212 passed | 158 failed | 43 failed as expected
@@ -3909,6 +3909,80 @@ Matchers.tests.cpp:<line number>: PASSED:
with expansion:
true
-------------------------------------------------------------------------------
ConcatGenerator
Cat support single-generator construction
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( c.get() == 1 )
with expansion:
1 == 1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( c.next() )
with expansion:
!false
-------------------------------------------------------------------------------
ConcatGenerator
Iterating over multiple generators
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( c.get() == i + 1 )
with expansion:
1 == 1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( c.next() )
with expansion:
true
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( c.get() == i + 1 )
with expansion:
2 == 2
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( c.next() )
with expansion:
true
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( c.get() == i + 1 )
with expansion:
3 == 3
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( c.next() )
with expansion:
true
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( c.get() == i + 1 )
with expansion:
4 == 4
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( c.next() )
with expansion:
true
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( c.get() == 5 )
with expansion:
5 == 5
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( c.next() )
with expansion:
!false
-------------------------------------------------------------------------------
Contains string matcher
-------------------------------------------------------------------------------
@@ -4756,6 +4830,40 @@ GeneratorsImpl.tests.cpp:<line number>
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_THROWS_AS( filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException )
-------------------------------------------------------------------------------
FixedValuesGenerator can be skipped forward
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( values.currentElementIndex() == 0 )
with expansion:
0 == 0
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( values.currentElementIndex() == 3 )
with expansion:
3 == 3
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( values.get() == 3 )
with expansion:
3 == 3
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( values.currentElementIndex() == 4 )
with expansion:
4 == 4
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( values.get() == 4 )
with expansion:
4 == 4
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_THROWS( values.skipToNthElement( 5 ) )
-------------------------------------------------------------------------------
Floating point matchers: double
Relative
@@ -5204,6 +5312,91 @@ Generators.tests.cpp:<line number>: PASSED:
with expansion:
0 == 0
-------------------------------------------------------------------------------
Generator adapters properly handle isFinite
concat generator
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( finite_cat.isFinite() )
with expansion:
true
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( infinite_cat.isFinite() )
with expansion:
!false
-------------------------------------------------------------------------------
Generator adapters properly handle isFinite
take generator
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( take_1.isFinite() )
with expansion:
true
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( take_2.isFinite() )
with expansion:
true
-------------------------------------------------------------------------------
Generator adapters properly handle isFinite
chunk generator
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( finite_chunk.isFinite() )
with expansion:
true
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( infinite_chunk.isFinite() )
with expansion:
!false
-------------------------------------------------------------------------------
Generator adapters properly handle isFinite
map
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( finite_map.isFinite() )
with expansion:
true
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( infinite_map.isFinite() )
with expansion:
!false
-------------------------------------------------------------------------------
Generator adapters properly handle isFinite
filter
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( finite_filter.isFinite() )
with expansion:
true
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( infinite_filter.isFinite() )
with expansion:
!false
-------------------------------------------------------------------------------
Generators -- adapters
Filtering by predicate
@@ -5845,6 +6038,53 @@ Generators.tests.cpp:<line number>: PASSED:
with expansion:
12 > 3
-------------------------------------------------------------------------------
Generators can be skipped forward
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( generator.currentElementIndex() == 0 )
with expansion:
0 == 0
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( generator.currentElementIndex() == 3 )
with expansion:
3 == 3
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( generator.get() == 3 )
with expansion:
3 == 3
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( generator.currentElementIndex() == 3 )
with expansion:
3 == 3
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( generator.get() == 3 )
with expansion:
3 == 3
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( generator.currentElementIndex() == 5 )
with expansion:
5 == 5
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( generator.get() == 5 )
with expansion:
5 == 5
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_THROWS( generator.skipToNthElement( 3 ) )
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_THROWS( generator.skipToNthElement( 6 ) )
-------------------------------------------------------------------------------
Generators internals
Single value
@@ -8011,6 +8251,134 @@ Misc.tests.cpp:<line number>: PASSED:
with message:
was called
-------------------------------------------------------------------------------
MapGenerator can be skipped forward efficiently
via calls to next()
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 0 )
with expansion:
0 == 0
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 0 )
with expansion:
0 == 0
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_generator.get() == 3 )
with expansion:
3 == 3
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 1 )
with expansion:
1 == 1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_generator.get() == 3 )
with expansion:
3 == 3
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 1 )
with expansion:
1 == 1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 1 )
with expansion:
1 == 1
-------------------------------------------------------------------------------
MapGenerator can be skipped forward efficiently
via calls to skipToNthElement()
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 0 )
with expansion:
0 == 0
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 0 )
with expansion:
0 == 0
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_generator.get() == 4 )
with expansion:
4 == 4
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 1 )
with expansion:
1 == 1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_generator.get() == 4 )
with expansion:
4 == 4
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 1 )
with expansion:
1 == 1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 1 )
with expansion:
1 == 1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_generator.get() == 6 )
with expansion:
6 == 6
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 2 )
with expansion:
2 == 2
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_THROWS( map_generator.skipToNthElement( 7 ) )
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_calls == 2 )
with expansion:
2 == 2
-------------------------------------------------------------------------------
MapGenerator can handle not default constructible types
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_generator.get().m_i == 1 )
with expansion:
1 == 1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_generator.next() )
with expansion:
true
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_generator.next() )
with expansion:
true
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( map_generator.get().m_i == 3 )
with expansion:
3 == 3
-------------------------------------------------------------------------------
Matchers can be (AllOf) composed with the && operator
-------------------------------------------------------------------------------
@@ -8944,6 +9312,191 @@ TestSpecParser.tests.cpp:<line number>: PASSED:
with expansion:
true
-------------------------------------------------------------------------------
Parsing path filter specs
Only section specs leads to old filter behaviour
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( result )
with expansion:
{?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( config.useNewPathFilteringBehaviour )
with expansion:
!false
-------------------------------------------------------------------------------
Parsing path filter specs
Generator specs enable new filter behaviour
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( result )
with expansion:
{?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.useNewPathFilteringBehaviour )
with expansion:
true
-------------------------------------------------------------------------------
Parsing path filter specs
Generator specs do not accept stringish arguments
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( result )
with expansion:
!{?}
-------------------------------------------------------------------------------
Parsing path filter specs
Generator specs accept star as argument
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( result )
with expansion:
{?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.pathFilters[0] == PathFilter( PathFilter::For::Generator, "*" ) )
with expansion:
{?} == {?}
-------------------------------------------------------------------------------
Parsing path filter specs
Generator specs do not accept negative numbers
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( result )
with expansion:
!{?}
-------------------------------------------------------------------------------
Parsing path filter specs
Generic path spec enables new filter behaviour
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( result )
with expansion:
{?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.useNewPathFilteringBehaviour )
with expansion:
true
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.pathFilters[0] == PathFilter( PathFilter::For::Generator, "1" ) )
with expansion:
{?} == {?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.pathFilters[1] == PathFilter( PathFilter::For::Section, "foobar" ) )
with expansion:
{?} == {?}
-------------------------------------------------------------------------------
Parsing path filter specs
Generic path spec for generator is validated
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( result )
with expansion:
!{?}
-------------------------------------------------------------------------------
Parsing path filter specs
Generic path spec without colon is rejected
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( result1 )
with expansion:
!{?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( result2 )
with expansion:
!{?}
-------------------------------------------------------------------------------
Parsing path filter specs
Using both section and generator filters creates filter stack
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( result )
with expansion:
{?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.pathFilters[0] == PathFilter( PathFilter::For::Section, "foo-bar" ) )
with expansion:
{?} == {?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.pathFilters[1] == PathFilter( PathFilter::For::Generator, "3" ) )
with expansion:
{?} == {?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.pathFilters[2] == PathFilter( PathFilter::For::Generator, "123" ) )
with expansion:
{?} == {?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.pathFilters[3] == PathFilter( PathFilter::For::Section, "baz" ) )
with expansion:
{?} == {?}
-------------------------------------------------------------------------------
Parsing path filter specs
Section/generator filters are whitespace trimmed
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( result )
with expansion:
{?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.pathFilters[0] == PathFilter(PathFilter::For::Section, "untrimmed" ) )
with expansion:
{?} == {?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.pathFilters[1] == PathFilter(PathFilter::For::Generator, "42" ) )
with expansion:
{?} == {?}
-------------------------------------------------------------------------------
Parsing sharding-related cli flags
shard-count
@@ -9139,14 +9692,14 @@ CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( cli.parse( { "test", "--warn", "NoAssertions", "--warn", "UnmatchedTestSpec" } ) )
REQUIRE( cli.parse( { "test", "--warn", "NoAssertions", "--warn", "UnmatchedTestSpec", "--warn", "InfiniteGenerators" } ) )
with expansion:
{?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE( config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec ) )
REQUIRE( config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec | WarnAbout::InfiniteGenerator ) )
with expansion:
3 == 3
7 == 7
-------------------------------------------------------------------------------
Pointers can be compared to null
@@ -9985,6 +10538,44 @@ CmdLine.tests.cpp:<line number>: PASSED:
with expansion:
200 == 200
-------------------------------------------------------------------------------
Process can be configured on command line
Benchmark options
samples must be greater than zero
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
CHECK_FALSE( result )
with expansion:
!{?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( result.errorMessage(), ContainsSubstring("Benchmark samples must be greater than 0") )
with expansion:
"Benchmark samples must be greater than 0" contains: "Benchmark samples must
be greater than 0"
-------------------------------------------------------------------------------
Process can be configured on command line
Benchmark options
samples must be parseable
-------------------------------------------------------------------------------
CmdLine.tests.cpp:<line number>
...............................................................................
CmdLine.tests.cpp:<line number>: PASSED:
CHECK_FALSE( result )
with expansion:
!{?}
CmdLine.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( result.errorMessage(), ContainsSubstring("Could not parse 'abc' as benchmark samples") )
with expansion:
"Could not parse 'abc' as benchmark samples" contains: "Could not parse 'abc'
as benchmark samples"
-------------------------------------------------------------------------------
Process can be configured on command line
Benchmark options
@@ -10128,6 +10719,39 @@ RandomNumberGeneration.tests.cpp:<line number>
RandomNumberGeneration.tests.cpp:<line number>: PASSED:
REQUIRE_THROWS( Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77)) )
-------------------------------------------------------------------------------
RandomGenerator reports itself as infinite - float
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite() )
with expansion:
!false
-------------------------------------------------------------------------------
RandomGenerator reports itself as infinite - int
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite() )
with expansion:
!false
-------------------------------------------------------------------------------
RandomGenerator reports itself as infinite - long double
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite() )
with expansion:
!false
-------------------------------------------------------------------------------
Range type with sentinel
-------------------------------------------------------------------------------
@@ -10197,6 +10821,15 @@ Matchers.tests.cpp:<line number>: PASSED:
with expansion:
{ 'a', 'b' } not UnorderedEquals: { 'c', 'b' }
-------------------------------------------------------------------------------
RepeatGenerator refuses infinite generators
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_THROWS( RepeatGenerator<int>( 2, random( 1, 100 ) ) )
-------------------------------------------------------------------------------
Reporter's write listings to provided stream
-------------------------------------------------------------------------------
@@ -12071,6 +12704,56 @@ Tag.tests.cpp:<line number>: PASSED:
with expansion:
{ {?}, {?} } ( Contains: {?} and Contains: {?} )
-------------------------------------------------------------------------------
TakeGenerator can be skipped forward
take is shorter than underlying
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( take.get() == 0 )
with expansion:
0 == 0
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( take.get() == 2 )
with expansion:
2 == 2
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( take.get() == 5 )
with expansion:
5 == 5
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_THROWS( take.skipToNthElement( 6 ) )
-------------------------------------------------------------------------------
TakeGenerator can be skipped forward
take is longer than underlying
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( take.get() == 0 )
with expansion:
0 == 0
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( take.get() == 2 )
with expansion:
2 == 2
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( take.get() == 5 )
with expansion:
5 == 5
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_THROWS( take.skipToNthElement( 6 ) )
-------------------------------------------------------------------------------
Template test case method with test types specified inside std::tuple - MyTypes
- 0
@@ -14279,6 +14962,29 @@ Exception.tests.cpp:<line number>: FAILED:
due to unexpected exception with message:
3.14000000000000012
-------------------------------------------------------------------------------
Unscoped capture outlives scope
A
-------------------------------------------------------------------------------
Message.tests.cpp:<line number>
...............................................................................
No assertions in section 'A'
-------------------------------------------------------------------------------
Unscoped capture outlives scope
-------------------------------------------------------------------------------
Message.tests.cpp:<line number>
...............................................................................
Message.tests.cpp:<line number>: FAILED:
REQUIRE( false )
with messages:
i := 1
j := 2
i + j := 3
-------------------------------------------------------------------------------
Upcasting special member functions
Move constructor
@@ -16372,6 +17078,102 @@ Tricky.tests.cpp:<line number>: PASSED:
with expansion:
0x<hex digits> != 0
-------------------------------------------------------------------------------
cat generator
Simple usage
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( input < 3 )
with expansion:
0 < 3
-------------------------------------------------------------------------------
cat generator
Simple usage
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( input < 3 )
with expansion:
1 < 3
-------------------------------------------------------------------------------
cat generator
Simple usage
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( input < 3 )
with expansion:
2 < 3
-------------------------------------------------------------------------------
cat generator
Used in map
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( input % 2 == 0 )
with expansion:
0 == 0
-------------------------------------------------------------------------------
cat generator
Used in map
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( input % 2 == 0 )
with expansion:
0 == 0
-------------------------------------------------------------------------------
cat generator
Used in map
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( input % 2 == 0 )
with expansion:
0 == 0
-------------------------------------------------------------------------------
cat generator
Used in map
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( input % 2 == 0 )
with expansion:
0 == 0
-------------------------------------------------------------------------------
cat generator
Used in map
-------------------------------------------------------------------------------
Generators.tests.cpp:<line number>
...............................................................................
Generators.tests.cpp:<line number>: PASSED:
REQUIRE( input % 2 == 0 )
with expansion:
0 == 0
-------------------------------------------------------------------------------
checkedElse
-------------------------------------------------------------------------------
@@ -19300,6 +20102,6 @@ Misc.tests.cpp:<line number>
Misc.tests.cpp:<line number>: PASSED:
===============================================================================
test cases: 436 | 317 passed | 95 failed | 6 skipped | 18 failed as expected
assertions: 2305 | 2106 passed | 157 failed | 42 failed as expected
test cases: 450 | 330 passed | 96 failed | 6 skipped | 18 failed as expected
assertions: 2413 | 2212 passed | 158 failed | 43 failed as expected
+51 -537
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuitesloose text artifact
>
<testsuite name="<exe-name>" errors="17" failures="140" skipped="12" tests="2317" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<testsuite name="<exe-name>" errors="17" failures="141" skipped="12" tests="2425" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<properties>
<property name="random-seed" value="1"/>
<property name="filters" value="&quot;*&quot; ~[!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( &amp;o1 == &amp;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"/>
@@ -501,6 +437,9 @@ at Message.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Composed matchers shortcircuit" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Composed matchers shortcircuit/MatchAllOf" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Composed matchers shortcircuit/MatchAnyOf" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="ConcatGenerator" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="ConcatGenerator/Cat support single-generator construction" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="ConcatGenerator/Iterating over multiple generators" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Contains string matcher" time="{duration}" status="run">
<failure message="testStringForMatching(), ContainsSubstring( &quot;not there&quot;, Catch::CaseSensitive::No )" type="CHECK_THAT">
FAILED:
@@ -508,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( &quot;STRING&quot; )" 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>
@@ -571,14 +503,6 @@ 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( &quot;this&quot;, 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>
@@ -592,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 == &quot;goodbye&quot;" type="CHECK">
FAILED:
CHECK( data.str_hello == "goodbye" )
with expansion:
"hello" == "goodbye"
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.str_hello == &quot;hell&quot;" type="CHECK">
FAILED:
CHECK( data.str_hello == "hell" )
with expansion:
"hello" == "hell"
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.str_hello == &quot;hello1&quot;" 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>
@@ -694,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( &quot;something else&quot;, 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>
@@ -710,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>
@@ -723,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>
@@ -738,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>
@@ -761,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>
@@ -789,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">
@@ -811,6 +602,7 @@ at Message.tests.cpp:<line number>
</testcase>
<testcase classname="<exe-name>.global" name="Factorials are computed" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Filter generator throws exception for empty generator" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="FixedValuesGenerator can be skipped forward" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Floating point matchers: double" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Floating point matchers: double/Relative" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Floating point matchers: double/Relative/Some subnormal values" time="{duration}" status="run"/>
@@ -828,6 +620,12 @@ at Message.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Floating point matchers: float/Constructor validation" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Floating point matchers: float/IsNaN" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="GENERATE can combine literals and generators" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/concat generator" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/take generator" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/chunk generator" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/map" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/filter" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators -- adapters" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators -- adapters/Filtering by predicate" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators -- adapters/Filtering by predicate/Basic usage" time="{duration}" status="run"/>
@@ -846,6 +644,7 @@ at Message.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Generators -- simple" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators -- simple/one" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators -- simple/two" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators can be skipped forward" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators internals" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators internals/Single value" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators internals/Preset values" time="{duration}" status="run"/>
@@ -920,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>
@@ -960,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 != &quot;hello&quot;" 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>
@@ -1019,6 +776,10 @@ at Condition.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Lambdas in assertions" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Less-than inequalities with different epsilons" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="ManuallyRegistered" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="MapGenerator can be skipped forward efficiently" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="MapGenerator can be skipped forward efficiently/via calls to next()" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="MapGenerator can be skipped forward efficiently/via calls to skipToNthElement()" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="MapGenerator can handle not default constructible types" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Matchers can be (AllOf) composed with the &amp;&amp; operator" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Matchers can be (AnyOf) composed with the || operator" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Matchers can be composed with both &amp;&amp; and ||" time="{duration}" status="run"/>
@@ -1112,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 &lt; 7" type="CHECK">
FAILED:
CHECK( data.int_seven &lt; 7 )
with expansion:
7 &lt; 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 &lt; 6" type="CHECK">
FAILED:
CHECK( data.int_seven &lt; 6 )
with expansion:
7 &lt; 6
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.int_seven &lt; 0" type="CHECK">
FAILED:
CHECK( data.int_seven &lt; 0 )
with expansion:
7 &lt; 0
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.int_seven &lt; -1" type="CHECK">
FAILED:
CHECK( data.int_seven &lt; -1 )
with expansion:
7 &lt; -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 &lt;= 6" type="CHECK">
FAILED:
CHECK( data.int_seven &lt;= 6 )
with expansion:
7 &lt;= 6
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.float_nine_point_one &lt; 9" type="CHECK">
FAILED:
CHECK( data.float_nine_point_one &lt; 9 )
with expansion:
9.100000381f &lt; 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 > &quot;hello&quot;" type="CHECK">
FAILED:
CHECK( data.str_hello > "hello" )
with expansion:
"hello" > "hello"
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.str_hello &lt; &quot;hello&quot;" type="CHECK">
FAILED:
CHECK( data.str_hello &lt; "hello" )
with expansion:
"hello" &lt; "hello"
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.str_hello > &quot;hellp&quot;" type="CHECK">
FAILED:
CHECK( data.str_hello > "hellp" )
with expansion:
"hello" > "hellp"
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.str_hello > &quot;z&quot;" type="CHECK">
FAILED:
CHECK( data.str_hello > "z" )
with expansion:
"hello" > "z"
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.str_hello &lt; &quot;hellm&quot;" type="CHECK">
FAILED:
CHECK( data.str_hello &lt; "hellm" )
with expansion:
"hello" &lt; "hellm"
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.str_hello &lt; &quot;a&quot;" type="CHECK">
FAILED:
CHECK( data.str_hello &lt; "a" )
with expansion:
"hello" &lt; "a"
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.str_hello >= &quot;z&quot;" type="CHECK">
FAILED:
CHECK( data.str_hello >= "z" )
with expansion:
"hello" >= "z"
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.str_hello &lt;= &quot;a&quot;" type="CHECK">
FAILED:
CHECK( data.str_hello &lt;= "a" )
with expansion:
"hello" &lt;= "a"
at Condition.tests.cpp:<line number>
</failure>
</testcase>
@@ -1264,6 +899,17 @@ at Message.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Parse uints/proper inputs" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parse uints/Bad inputs" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsed tags are matched case insensitive" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing path filter specs" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing path filter specs/Only section specs leads to old filter behaviour" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing path filter specs/Generator specs enable new filter behaviour" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing path filter specs/Generator specs do not accept stringish arguments" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing path filter specs/Generator specs accept star as argument" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing path filter specs/Generator specs do not accept negative numbers" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing path filter specs/Generic path spec enables new filter behaviour" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing path filter specs/Generic path spec for generator is validated" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing path filter specs/Generic path spec without colon is rejected" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing path filter specs/Using both section and generator filters creates filter stack" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing path filter specs/Section/generator filters are whitespace trimmed" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing sharding-related cli flags" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing sharding-related cli flags/shard-count" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing sharding-related cli flags/Negative shard count reports error" time="{duration}" status="run"/>
@@ -1325,6 +971,8 @@ at Message.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Process can be configured on command line/use-colour/error" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options/samples" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options/samples must be greater than zero" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options/samples must be parseable" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options/resamples" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options/confidence-interval" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options/no-analysis" time="{duration}" status="run"/>
@@ -1334,6 +982,9 @@ at Message.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple&lt;int>" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Random seed generation accepts known methods" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Random seed generation reports unknown methods" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="RandomGenerator reports itself as infinite - float" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="RandomGenerator reports itself as infinite - int" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="RandomGenerator reports itself as infinite - long double" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Range type with sentinel" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Reconstruction should be based on stringification: #914" time="{duration}" status="run">
<failure message="truthy(false)" type="CHECK">
@@ -1351,27 +1002,12 @@ 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( &quot;contains 'abc' as a substring&quot; )" 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( &quot;this string contains 'abc' as a&quot; )" 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>
<testcase classname="<exe-name>.global" name="Registering reporter with '::' in name fails" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Regression test #1" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="RepeatGenerator refuses infinite generators" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/Automake reporter lists tags" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/Automake reporter lists reporters" time="{duration}" status="run"/>
@@ -1430,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>
@@ -1480,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( &quot;string&quot;, 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>
@@ -1549,6 +1171,9 @@ at Misc.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Tag alias can be registered against tag patterns/The same tag alias can only be registered once" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Tag alias can be registered against tag patterns/Tag aliases must be of the form [@name]" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Tags with spaces and non-alphanumerical characters are accepted" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="TakeGenerator can be skipped forward" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="TakeGenerator can be skipped forward/take is shorter than underlying" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="TakeGenerator can be skipped forward/take is longer than underlying" time="{duration}" status="run"/>
<testcase classname="<exe-name>.Template_Fixture" name="Template test case method with test types specified inside std::tuple - MyTypes - 0" time="{duration}" status="run"/>
<testcase classname="<exe-name>.Template_Fixture" name="Template test case method with test types specified inside std::tuple - MyTypes - 1" time="{duration}" status="run"/>
<testcase classname="<exe-name>.Template_Fixture" name="Template test case method with test types specified inside std::tuple - MyTypes - 2" time="{duration}" status="run"/>
@@ -1692,6 +1317,18 @@ FAILED:
at Exception.tests.cpp:<line number>
</error>
</testcase>
<testcase classname="<exe-name>.global" name="Unscoped capture outlives scope" time="{duration}" status="run">
<skipped message="TEST_CASE tagged with !mayfail"/>
<failure message="false" type="REQUIRE">
FAILED:
REQUIRE( false )
i := 1
j := 2
i + j := 3
at Message.tests.cpp:<line number>
</failure>
</testcase>
<testcase classname="<exe-name>.global" name="Unscoped capture outlives scope/A" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Upcasting special member functions" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Upcasting special member functions/Move constructor" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Upcasting special member functions/move assignment" time="{duration}" status="run"/>
@@ -1826,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>
@@ -1842,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>
@@ -1858,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>
@@ -1888,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>
@@ -1979,6 +1560,9 @@ at Skip.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="benchmark function call/without chronometer" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="benchmark function call/with chronometer" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="boolean member" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="cat generator" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="cat generator/Simple usage" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="cat generator/Used in map" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="checkedElse" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="checkedElse, failing" time="{duration}" status="run">
<failure message="testCheckedElse( false )" type="REQUIRE">
@@ -2013,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>
@@ -2036,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">
@@ -2126,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>
@@ -2310,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>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="<exe-name>" errors="17" failures="140" skipped="12" tests="2317" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<testsuite name="<exe-name>" errors="17" failures="141" skipped="12" tests="2425" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<properties>
<property name="random-seed" value="1"/>
<property name="filters" value="&quot;*&quot; ~[!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( &amp;o1 == &amp;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"/>
@@ -500,6 +436,9 @@ at Message.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Composed matchers shortcircuit" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Composed matchers shortcircuit/MatchAllOf" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Composed matchers shortcircuit/MatchAnyOf" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="ConcatGenerator" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="ConcatGenerator/Cat support single-generator construction" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="ConcatGenerator/Iterating over multiple generators" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Contains string matcher" time="{duration}" status="run">
<failure message="testStringForMatching(), ContainsSubstring( &quot;not there&quot;, Catch::CaseSensitive::No )" type="CHECK_THAT">
FAILED:
@@ -507,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( &quot;STRING&quot; )" 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>
@@ -570,14 +502,6 @@ 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( &quot;this&quot;, 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>
@@ -591,96 +515,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 == &quot;goodbye&quot;" type="CHECK">
FAILED:
CHECK( data.str_hello == "goodbye" )
with expansion:
"hello" == "goodbye"
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.str_hello == &quot;hell&quot;" type="CHECK">
FAILED:
CHECK( data.str_hello == "hell" )
with expansion:
"hello" == "hell"
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.str_hello == &quot;hello1&quot;" 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>
@@ -693,14 +527,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( &quot;something else&quot;, 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>
@@ -709,11 +535,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>
@@ -722,12 +543,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>
@@ -737,13 +552,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>
@@ -760,17 +568,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>
@@ -788,12 +585,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">
@@ -810,6 +601,7 @@ at Message.tests.cpp:<line number>
</testcase>
<testcase classname="<exe-name>.global" name="Factorials are computed" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Filter generator throws exception for empty generator" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="FixedValuesGenerator can be skipped forward" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Floating point matchers: double" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Floating point matchers: double/Relative" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Floating point matchers: double/Relative/Some subnormal values" time="{duration}" status="run"/>
@@ -827,6 +619,12 @@ at Message.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Floating point matchers: float/Constructor validation" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Floating point matchers: float/IsNaN" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="GENERATE can combine literals and generators" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/concat generator" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/take generator" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/chunk generator" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/map" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/filter" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators -- adapters" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators -- adapters/Filtering by predicate" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators -- adapters/Filtering by predicate/Basic usage" time="{duration}" status="run"/>
@@ -845,6 +643,7 @@ at Message.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Generators -- simple" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators -- simple/one" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators -- simple/two" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators can be skipped forward" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators internals" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators internals/Single value" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators internals/Preset values" time="{duration}" status="run"/>
@@ -919,16 +718,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>
@@ -959,38 +748,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 != &quot;hello&quot;" 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>
@@ -1018,6 +775,10 @@ at Condition.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Lambdas in assertions" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Less-than inequalities with different epsilons" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="ManuallyRegistered" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="MapGenerator can be skipped forward efficiently" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="MapGenerator can be skipped forward efficiently/via calls to next()" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="MapGenerator can be skipped forward efficiently/via calls to skipToNthElement()" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="MapGenerator can handle not default constructible types" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Matchers can be (AllOf) composed with the &amp;&amp; operator" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Matchers can be (AnyOf) composed with the || operator" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Matchers can be composed with both &amp;&amp; and ||" time="{duration}" status="run"/>
@@ -1111,132 +872,6 @@ FAILED:
CHECK( data.int_seven > 7 )
with expansion:
7 > 7
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.int_seven &lt; 7" type="CHECK">
FAILED:
CHECK( data.int_seven &lt; 7 )
with expansion:
7 &lt; 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 &lt; 6" type="CHECK">
FAILED:
CHECK( data.int_seven &lt; 6 )
with expansion:
7 &lt; 6
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.int_seven &lt; 0" type="CHECK">
FAILED:
CHECK( data.int_seven &lt; 0 )
with expansion:
7 &lt; 0
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.int_seven &lt; -1" type="CHECK">
FAILED:
CHECK( data.int_seven &lt; -1 )
with expansion:
7 &lt; -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 &lt;= 6" type="CHECK">
FAILED:
CHECK( data.int_seven &lt;= 6 )
with expansion:
7 &lt;= 6
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.float_nine_point_one &lt; 9" type="CHECK">
FAILED:
CHECK( data.float_nine_point_one &lt; 9 )
with expansion:
9.100000381f &lt; 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 > &quot;hello&quot;" type="CHECK">
FAILED:
CHECK( data.str_hello > "hello" )
with expansion:
"hello" > "hello"
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.str_hello &lt; &quot;hello&quot;" type="CHECK">
FAILED:
CHECK( data.str_hello &lt; "hello" )
with expansion:
"hello" &lt; "hello"
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.str_hello > &quot;hellp&quot;" type="CHECK">
FAILED:
CHECK( data.str_hello > "hellp" )
with expansion:
"hello" > "hellp"
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.str_hello > &quot;z&quot;" type="CHECK">
FAILED:
CHECK( data.str_hello > "z" )
with expansion:
"hello" > "z"
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.str_hello &lt; &quot;hellm&quot;" type="CHECK">
FAILED:
CHECK( data.str_hello &lt; "hellm" )
with expansion:
"hello" &lt; "hellm"
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.str_hello &lt; &quot;a&quot;" type="CHECK">
FAILED:
CHECK( data.str_hello &lt; "a" )
with expansion:
"hello" &lt; "a"
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.str_hello >= &quot;z&quot;" type="CHECK">
FAILED:
CHECK( data.str_hello >= "z" )
with expansion:
"hello" >= "z"
at Condition.tests.cpp:<line number>
</failure>
<failure message="data.str_hello &lt;= &quot;a&quot;" type="CHECK">
FAILED:
CHECK( data.str_hello &lt;= "a" )
with expansion:
"hello" &lt;= "a"
at Condition.tests.cpp:<line number>
</failure>
</testcase>
@@ -1263,6 +898,17 @@ at Message.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Parse uints/proper inputs" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parse uints/Bad inputs" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsed tags are matched case insensitive" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing path filter specs" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing path filter specs/Only section specs leads to old filter behaviour" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing path filter specs/Generator specs enable new filter behaviour" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing path filter specs/Generator specs do not accept stringish arguments" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing path filter specs/Generator specs accept star as argument" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing path filter specs/Generator specs do not accept negative numbers" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing path filter specs/Generic path spec enables new filter behaviour" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing path filter specs/Generic path spec for generator is validated" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing path filter specs/Generic path spec without colon is rejected" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing path filter specs/Using both section and generator filters creates filter stack" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing path filter specs/Section/generator filters are whitespace trimmed" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing sharding-related cli flags" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing sharding-related cli flags/shard-count" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Parsing sharding-related cli flags/Negative shard count reports error" time="{duration}" status="run"/>
@@ -1324,6 +970,8 @@ at Message.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Process can be configured on command line/use-colour/error" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options/samples" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options/samples must be greater than zero" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options/samples must be parseable" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options/resamples" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options/confidence-interval" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Process can be configured on command line/Benchmark options/no-analysis" time="{duration}" status="run"/>
@@ -1333,6 +981,9 @@ at Message.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple&lt;int>" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Random seed generation accepts known methods" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Random seed generation reports unknown methods" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="RandomGenerator reports itself as infinite - float" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="RandomGenerator reports itself as infinite - int" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="RandomGenerator reports itself as infinite - long double" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Range type with sentinel" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Reconstruction should be based on stringification: #914" time="{duration}" status="run">
<failure message="truthy(false)" type="CHECK">
@@ -1350,27 +1001,12 @@ 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( &quot;contains 'abc' as a substring&quot; )" 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( &quot;this string contains 'abc' as a&quot; )" 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>
<testcase classname="<exe-name>.global" name="Registering reporter with '::' in name fails" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Regression test #1" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="RepeatGenerator refuses infinite generators" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/Automake reporter lists tags" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/Automake reporter lists reporters" time="{duration}" status="run"/>
@@ -1429,12 +1065,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>
@@ -1479,14 +1109,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( &quot;string&quot;, 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>
@@ -1548,6 +1170,9 @@ at Misc.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Tag alias can be registered against tag patterns/The same tag alias can only be registered once" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Tag alias can be registered against tag patterns/Tag aliases must be of the form [@name]" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Tags with spaces and non-alphanumerical characters are accepted" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="TakeGenerator can be skipped forward" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="TakeGenerator can be skipped forward/take is shorter than underlying" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="TakeGenerator can be skipped forward/take is longer than underlying" time="{duration}" status="run"/>
<testcase classname="<exe-name>.Template_Fixture" name="Template test case method with test types specified inside std::tuple - MyTypes - 0" time="{duration}" status="run"/>
<testcase classname="<exe-name>.Template_Fixture" name="Template test case method with test types specified inside std::tuple - MyTypes - 1" time="{duration}" status="run"/>
<testcase classname="<exe-name>.Template_Fixture" name="Template test case method with test types specified inside std::tuple - MyTypes - 2" time="{duration}" status="run"/>
@@ -1691,6 +1316,18 @@ FAILED:
at Exception.tests.cpp:<line number>
</error>
</testcase>
<testcase classname="<exe-name>.global" name="Unscoped capture outlives scope" time="{duration}" status="run">
<skipped message="TEST_CASE tagged with !mayfail"/>
<failure message="false" type="REQUIRE">
FAILED:
REQUIRE( false )
i := 1
j := 2
i + j := 3
at Message.tests.cpp:<line number>
</failure>
</testcase>
<testcase classname="<exe-name>.global" name="Unscoped capture outlives scope/A" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Upcasting special member functions" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Upcasting special member functions/Move constructor" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Upcasting special member functions/move assignment" time="{duration}" status="run"/>
@@ -1825,13 +1462,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>
@@ -1841,13 +1471,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>
@@ -1857,27 +1480,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>
@@ -1887,27 +1489,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>
@@ -1978,6 +1559,9 @@ at Skip.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="benchmark function call/without chronometer" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="benchmark function call/with chronometer" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="boolean member" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="cat generator" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="cat generator/Simple usage" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="cat generator/Used in map" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="checkedElse" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="checkedElse, failing" time="{duration}" status="run">
<failure message="testCheckedElse( false )" type="REQUIRE">
@@ -2012,11 +1596,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>
@@ -2035,28 +1614,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">
@@ -2125,46 +1688,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>
@@ -2309,15 +1832,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>
@@ -64,6 +64,17 @@ at AssertionHandler.tests.cpp:<line number>
<testCase name="is_unary_function" duration="{duration}"/>
</file>
<file path="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp">
<testCase name="Parsing path filter specs" duration="{duration}"/>
<testCase name="Parsing path filter specs/Only section specs leads to old filter behaviour" duration="{duration}"/>
<testCase name="Parsing path filter specs/Generator specs enable new filter behaviour" duration="{duration}"/>
<testCase name="Parsing path filter specs/Generator specs do not accept stringish arguments" duration="{duration}"/>
<testCase name="Parsing path filter specs/Generator specs accept star as argument" duration="{duration}"/>
<testCase name="Parsing path filter specs/Generator specs do not accept negative numbers" duration="{duration}"/>
<testCase name="Parsing path filter specs/Generic path spec enables new filter behaviour" duration="{duration}"/>
<testCase name="Parsing path filter specs/Generic path spec for generator is validated" duration="{duration}"/>
<testCase name="Parsing path filter specs/Generic path spec without colon is rejected" duration="{duration}"/>
<testCase name="Parsing path filter specs/Using both section and generator filters creates filter stack" duration="{duration}"/>
<testCase name="Parsing path filter specs/Section/generator filters are whitespace trimmed" duration="{duration}"/>
<testCase name="Parsing sharding-related cli flags" duration="{duration}"/>
<testCase name="Parsing sharding-related cli flags/shard-count" duration="{duration}"/>
<testCase name="Parsing sharding-related cli flags/Negative shard count reports error" duration="{duration}"/>
@@ -119,6 +130,8 @@ at AssertionHandler.tests.cpp:<line number>
<testCase name="Process can be configured on command line/use-colour/error" duration="{duration}"/>
<testCase name="Process can be configured on command line/Benchmark options" duration="{duration}"/>
<testCase name="Process can be configured on command line/Benchmark options/samples" duration="{duration}"/>
<testCase name="Process can be configured on command line/Benchmark options/samples must be greater than zero" duration="{duration}"/>
<testCase name="Process can be configured on command line/Benchmark options/samples must be parseable" duration="{duration}"/>
<testCase name="Process can be configured on command line/Benchmark options/resamples" duration="{duration}"/>
<testCase name="Process can be configured on command line/Benchmark options/confidence-interval" duration="{duration}"/>
<testCase name="Process can be configured on command line/Benchmark options/no-analysis" duration="{duration}"/>
@@ -143,7 +156,18 @@ at AssertionHandler.tests.cpp:<line number>
<testCase name="convertToBits" duration="{duration}"/>
</file>
<file path="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp">
<testCase name="ConcatGenerator" duration="{duration}"/>
<testCase name="ConcatGenerator/Cat support single-generator construction" duration="{duration}"/>
<testCase name="ConcatGenerator/Iterating over multiple generators" duration="{duration}"/>
<testCase name="Filter generator throws exception for empty generator" duration="{duration}"/>
<testCase name="FixedValuesGenerator can be skipped forward" duration="{duration}"/>
<testCase name="Generator adapters properly handle isFinite" duration="{duration}"/>
<testCase name="Generator adapters properly handle isFinite/concat generator" duration="{duration}"/>
<testCase name="Generator adapters properly handle isFinite/take generator" duration="{duration}"/>
<testCase name="Generator adapters properly handle isFinite/chunk generator" duration="{duration}"/>
<testCase name="Generator adapters properly handle isFinite/map" duration="{duration}"/>
<testCase name="Generator adapters properly handle isFinite/filter" duration="{duration}"/>
<testCase name="Generators can be skipped forward" duration="{duration}"/>
<testCase name="Generators internals" duration="{duration}"/>
<testCase name="Generators internals/Single value" duration="{duration}"/>
<testCase name="Generators internals/Preset values" duration="{duration}"/>
@@ -181,6 +205,17 @@ at AssertionHandler.tests.cpp:<line number>
<testCase name="Generators internals/Range/Negative manual step/Integer/Exact" duration="{duration}"/>
<testCase name="Generators internals/Range/Negative manual step/Integer/Slightly over end" duration="{duration}"/>
<testCase name="Generators internals/Range/Negative manual step/Integer/Slightly under end" duration="{duration}"/>
<testCase name="MapGenerator can be skipped forward efficiently" duration="{duration}"/>
<testCase name="MapGenerator can be skipped forward efficiently/via calls to next()" duration="{duration}"/>
<testCase name="MapGenerator can be skipped forward efficiently/via calls to skipToNthElement()" duration="{duration}"/>
<testCase name="MapGenerator can handle not default constructible types" duration="{duration}"/>
<testCase name="RandomGenerator reports itself as infinite - float" duration="{duration}"/>
<testCase name="RandomGenerator reports itself as infinite - int" duration="{duration}"/>
<testCase name="RandomGenerator reports itself as infinite - long double" duration="{duration}"/>
<testCase name="RepeatGenerator refuses infinite generators" duration="{duration}"/>
<testCase name="TakeGenerator can be skipped forward" duration="{duration}"/>
<testCase name="TakeGenerator can be skipped forward/take is shorter than underlying" duration="{duration}"/>
<testCase name="TakeGenerator can be skipped forward/take is longer than underlying" duration="{duration}"/>
</file>
<file path="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp">
<testCase name="analyse no analysis" duration="{duration}"/>
@@ -1240,6 +1275,9 @@ at Generators.tests.cpp:<line number>
<testCase name="Generators -- simple/one" duration="{duration}"/>
<testCase name="Generators -- simple/two" duration="{duration}"/>
<testCase name="Nested generators and captured variables" duration="{duration}"/>
<testCase name="cat generator" duration="{duration}"/>
<testCase name="cat generator/Simple usage" duration="{duration}"/>
<testCase name="cat generator/Used in map" duration="{duration}"/>
<testCase name="strlen3" duration="{duration}"/>
<testCase name="tables" duration="{duration}"/>
</file>
@@ -1831,6 +1869,17 @@ at Message.tests.cpp:<line number>
<testCase name="Standard output from all sections is reported/one" duration="{duration}"/>
<testCase name="Standard output from all sections is reported/two" duration="{duration}"/>
<testCase name="The NO_FAIL macro reports a failure but does not fail the test" duration="{duration}"/>
<testCase name="Unscoped capture outlives scope" duration="{duration}">
<skipped message="REQUIRE(false)">
FAILED:
REQUIRE( false )
i := 1
j := 2
i + j := 3
at Message.tests.cpp:<line number>
</skipped>
</testCase>
<testCase name="Unscoped capture outlives scope/A" duration="{duration}"/>
<testCase name="just failure" duration="{duration}">
<failure message="FAIL()">
FAILED:
@@ -63,6 +63,17 @@ at AssertionHandler.tests.cpp:<line number>
<testCase name="is_unary_function" duration="{duration}"/>
</file>
<file path="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp">
<testCase name="Parsing path filter specs" duration="{duration}"/>
<testCase name="Parsing path filter specs/Only section specs leads to old filter behaviour" duration="{duration}"/>
<testCase name="Parsing path filter specs/Generator specs enable new filter behaviour" duration="{duration}"/>
<testCase name="Parsing path filter specs/Generator specs do not accept stringish arguments" duration="{duration}"/>
<testCase name="Parsing path filter specs/Generator specs accept star as argument" duration="{duration}"/>
<testCase name="Parsing path filter specs/Generator specs do not accept negative numbers" duration="{duration}"/>
<testCase name="Parsing path filter specs/Generic path spec enables new filter behaviour" duration="{duration}"/>
<testCase name="Parsing path filter specs/Generic path spec for generator is validated" duration="{duration}"/>
<testCase name="Parsing path filter specs/Generic path spec without colon is rejected" duration="{duration}"/>
<testCase name="Parsing path filter specs/Using both section and generator filters creates filter stack" duration="{duration}"/>
<testCase name="Parsing path filter specs/Section/generator filters are whitespace trimmed" duration="{duration}"/>
<testCase name="Parsing sharding-related cli flags" duration="{duration}"/>
<testCase name="Parsing sharding-related cli flags/shard-count" duration="{duration}"/>
<testCase name="Parsing sharding-related cli flags/Negative shard count reports error" duration="{duration}"/>
@@ -118,6 +129,8 @@ at AssertionHandler.tests.cpp:<line number>
<testCase name="Process can be configured on command line/use-colour/error" duration="{duration}"/>
<testCase name="Process can be configured on command line/Benchmark options" duration="{duration}"/>
<testCase name="Process can be configured on command line/Benchmark options/samples" duration="{duration}"/>
<testCase name="Process can be configured on command line/Benchmark options/samples must be greater than zero" duration="{duration}"/>
<testCase name="Process can be configured on command line/Benchmark options/samples must be parseable" duration="{duration}"/>
<testCase name="Process can be configured on command line/Benchmark options/resamples" duration="{duration}"/>
<testCase name="Process can be configured on command line/Benchmark options/confidence-interval" duration="{duration}"/>
<testCase name="Process can be configured on command line/Benchmark options/no-analysis" duration="{duration}"/>
@@ -142,7 +155,18 @@ at AssertionHandler.tests.cpp:<line number>
<testCase name="convertToBits" duration="{duration}"/>
</file>
<file path="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp">
<testCase name="ConcatGenerator" duration="{duration}"/>
<testCase name="ConcatGenerator/Cat support single-generator construction" duration="{duration}"/>
<testCase name="ConcatGenerator/Iterating over multiple generators" duration="{duration}"/>
<testCase name="Filter generator throws exception for empty generator" duration="{duration}"/>
<testCase name="FixedValuesGenerator can be skipped forward" duration="{duration}"/>
<testCase name="Generator adapters properly handle isFinite" duration="{duration}"/>
<testCase name="Generator adapters properly handle isFinite/concat generator" duration="{duration}"/>
<testCase name="Generator adapters properly handle isFinite/take generator" duration="{duration}"/>
<testCase name="Generator adapters properly handle isFinite/chunk generator" duration="{duration}"/>
<testCase name="Generator adapters properly handle isFinite/map" duration="{duration}"/>
<testCase name="Generator adapters properly handle isFinite/filter" duration="{duration}"/>
<testCase name="Generators can be skipped forward" duration="{duration}"/>
<testCase name="Generators internals" duration="{duration}"/>
<testCase name="Generators internals/Single value" duration="{duration}"/>
<testCase name="Generators internals/Preset values" duration="{duration}"/>
@@ -180,6 +204,17 @@ at AssertionHandler.tests.cpp:<line number>
<testCase name="Generators internals/Range/Negative manual step/Integer/Exact" duration="{duration}"/>
<testCase name="Generators internals/Range/Negative manual step/Integer/Slightly over end" duration="{duration}"/>
<testCase name="Generators internals/Range/Negative manual step/Integer/Slightly under end" duration="{duration}"/>
<testCase name="MapGenerator can be skipped forward efficiently" duration="{duration}"/>
<testCase name="MapGenerator can be skipped forward efficiently/via calls to next()" duration="{duration}"/>
<testCase name="MapGenerator can be skipped forward efficiently/via calls to skipToNthElement()" duration="{duration}"/>
<testCase name="MapGenerator can handle not default constructible types" duration="{duration}"/>
<testCase name="RandomGenerator reports itself as infinite - float" duration="{duration}"/>
<testCase name="RandomGenerator reports itself as infinite - int" duration="{duration}"/>
<testCase name="RandomGenerator reports itself as infinite - long double" duration="{duration}"/>
<testCase name="RepeatGenerator refuses infinite generators" duration="{duration}"/>
<testCase name="TakeGenerator can be skipped forward" duration="{duration}"/>
<testCase name="TakeGenerator can be skipped forward/take is shorter than underlying" duration="{duration}"/>
<testCase name="TakeGenerator can be skipped forward/take is longer than underlying" duration="{duration}"/>
</file>
<file path="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp">
<testCase name="analyse no analysis" duration="{duration}"/>
@@ -1239,6 +1274,9 @@ at Generators.tests.cpp:<line number>
<testCase name="Generators -- simple/one" duration="{duration}"/>
<testCase name="Generators -- simple/two" duration="{duration}"/>
<testCase name="Nested generators and captured variables" duration="{duration}"/>
<testCase name="cat generator" duration="{duration}"/>
<testCase name="cat generator/Simple usage" duration="{duration}"/>
<testCase name="cat generator/Used in map" duration="{duration}"/>
<testCase name="strlen3" duration="{duration}"/>
<testCase name="tables" duration="{duration}"/>
</file>
@@ -1830,6 +1868,17 @@ at Message.tests.cpp:<line number>
<testCase name="Standard output from all sections is reported/one" duration="{duration}"/>
<testCase name="Standard output from all sections is reported/two" duration="{duration}"/>
<testCase name="The NO_FAIL macro reports a failure but does not fail the test" duration="{duration}"/>
<testCase name="Unscoped capture outlives scope" duration="{duration}">
<skipped message="REQUIRE(false)">
FAILED:
REQUIRE( false )
i := 1
j := 2
i + j := 3
at Message.tests.cpp:<line number>
</skipped>
</testCase>
<testCase name="Unscoped capture outlives scope/A" duration="{duration}"/>
<testCase name="just failure" duration="{duration}">
<failure message="FAIL()">
FAILED:
+217 -3
View File
@@ -980,6 +980,30 @@ ok {test-number} - matcher.match( 1 ) for: true
ok {test-number} - first.matchCalled for: true
# Composed matchers shortcircuit
ok {test-number} - !second.matchCalled for: true
# ConcatGenerator
ok {test-number} - c.get() == 1 for: 1 == 1
# ConcatGenerator
ok {test-number} - !(c.next()) for: !false
# ConcatGenerator
ok {test-number} - c.get() == i + 1 for: 1 == 1
# ConcatGenerator
ok {test-number} - c.next() for: true
# ConcatGenerator
ok {test-number} - c.get() == i + 1 for: 2 == 2
# ConcatGenerator
ok {test-number} - c.next() for: true
# ConcatGenerator
ok {test-number} - c.get() == i + 1 for: 3 == 3
# ConcatGenerator
ok {test-number} - c.next() for: true
# ConcatGenerator
ok {test-number} - c.get() == i + 1 for: 4 == 4
# ConcatGenerator
ok {test-number} - c.next() for: true
# ConcatGenerator
ok {test-number} - c.get() == 5 for: 5 == 5
# ConcatGenerator
ok {test-number} - !(c.next()) for: !false
# Contains string matcher
not ok {test-number} - testStringForMatching(), ContainsSubstring( "not there", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "not there" (case insensitive)
# Contains string matcher
@@ -1188,6 +1212,18 @@ ok {test-number} - Factorial(3) == 6 for: 6 == 6
ok {test-number} - Factorial(10) == 3628800 for: 3628800 (0x<hex digits>) == 3628800 (0x<hex digits>)
# Filter generator throws exception for empty generator
ok {test-number} - filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException
# FixedValuesGenerator can be skipped forward
ok {test-number} - values.currentElementIndex() == 0 for: 0 == 0
# FixedValuesGenerator can be skipped forward
ok {test-number} - values.currentElementIndex() == 3 for: 3 == 3
# FixedValuesGenerator can be skipped forward
ok {test-number} - values.get() == 3 for: 3 == 3
# FixedValuesGenerator can be skipped forward
ok {test-number} - values.currentElementIndex() == 4 for: 4 == 4
# FixedValuesGenerator can be skipped forward
ok {test-number} - values.get() == 4 for: 4 == 4
# FixedValuesGenerator can be skipped forward
ok {test-number} - values.skipToNthElement( 5 )
# Floating point matchers: double
ok {test-number} - 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.09999999999999964 are within 10% of each other
# Floating point matchers: double
@@ -1322,6 +1358,26 @@ ok {test-number} - i % 2 == 0 for: 0 == 0
ok {test-number} - i % 2 == 0 for: 0 == 0
# GENERATE can combine literals and generators
ok {test-number} - i % 2 == 0 for: 0 == 0
# Generator adapters properly handle isFinite
ok {test-number} - finite_cat.isFinite() for: true
# Generator adapters properly handle isFinite
ok {test-number} - !(infinite_cat.isFinite()) for: !false
# Generator adapters properly handle isFinite
ok {test-number} - take_1.isFinite() for: true
# Generator adapters properly handle isFinite
ok {test-number} - take_2.isFinite() for: true
# Generator adapters properly handle isFinite
ok {test-number} - finite_chunk.isFinite() for: true
# Generator adapters properly handle isFinite
ok {test-number} - !(infinite_chunk.isFinite()) for: !false
# Generator adapters properly handle isFinite
ok {test-number} - finite_map.isFinite() for: true
# Generator adapters properly handle isFinite
ok {test-number} - !(infinite_map.isFinite()) for: !false
# Generator adapters properly handle isFinite
ok {test-number} - finite_filter.isFinite() for: true
# Generator adapters properly handle isFinite
ok {test-number} - !(infinite_filter.isFinite()) for: !false
# Generators -- adapters
ok {test-number} - i % 2 == 0 for: 0 == 0
# Generators -- adapters
@@ -1434,6 +1490,24 @@ ok {test-number} - 4u * i > str.size() for: 12 > 1
ok {test-number} - 4u * i > str.size() for: 12 > 2
# Generators -- simple
ok {test-number} - 4u * i > str.size() for: 12 > 3
# Generators can be skipped forward
ok {test-number} - generator.currentElementIndex() == 0 for: 0 == 0
# Generators can be skipped forward
ok {test-number} - generator.currentElementIndex() == 3 for: 3 == 3
# Generators can be skipped forward
ok {test-number} - generator.get() == 3 for: 3 == 3
# Generators can be skipped forward
ok {test-number} - generator.currentElementIndex() == 3 for: 3 == 3
# Generators can be skipped forward
ok {test-number} - generator.get() == 3 for: 3 == 3
# Generators can be skipped forward
ok {test-number} - generator.currentElementIndex() == 5 for: 5 == 5
# Generators can be skipped forward
ok {test-number} - generator.get() == 5 for: 5 == 5
# Generators can be skipped forward
ok {test-number} - generator.skipToNthElement( 3 )
# Generators can be skipped forward
ok {test-number} - generator.skipToNthElement( 6 )
# Generators internals
ok {test-number} - gen.get() == 123 for: 123 == 123
# Generators internals
@@ -1986,6 +2060,50 @@ ok {test-number} - !(d <= Approx( 1.22 )) for: !(1.22999999999999998 <= Approx(
ok {test-number} - d <= Approx( 1.22 ).epsilon(0.1) for: 1.22999999999999998 <= Approx( 1.21999999999999997 )
# ManuallyRegistered
ok {test-number} - with 1 message: 'was called'
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 0 for: 0 == 0
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 0 for: 0 == 0
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_generator.get() == 3 for: 3 == 3
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 1 for: 1 == 1
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_generator.get() == 3 for: 3 == 3
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 1 for: 1 == 1
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 1 for: 1 == 1
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 0 for: 0 == 0
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 0 for: 0 == 0
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_generator.get() == 4 for: 4 == 4
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 1 for: 1 == 1
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_generator.get() == 4 for: 4 == 4
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 1 for: 1 == 1
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 1 for: 1 == 1
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_generator.get() == 6 for: 6 == 6
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 2 for: 2 == 2
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_generator.skipToNthElement( 7 )
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 2 for: 2 == 2
# MapGenerator can handle not default constructible types
ok {test-number} - map_generator.get().m_i == 1 for: 1 == 1
# MapGenerator can handle not default constructible types
ok {test-number} - map_generator.next() for: true
# MapGenerator can handle not default constructible types
ok {test-number} - map_generator.next() for: true
# MapGenerator can handle not default constructible types
ok {test-number} - map_generator.get().m_i == 3 for: 3 == 3
# Matchers can be (AllOf) composed with the && operator
ok {test-number} - testStringForMatching(), ContainsSubstring( "string" ) && ContainsSubstring( "abc" ) && ContainsSubstring( "substring" ) && ContainsSubstring( "contains" ) for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" )
# Matchers can be (AnyOf) composed with the || operator
@@ -2238,6 +2356,52 @@ ok {test-number} - spec.hasFilters() for: true
ok {test-number} - spec.getInvalidSpecs().empty() for: true
# Parsed tags are matched case insensitive
ok {test-number} - spec.matches( testCase ) for: true
# Parsing path filter specs
ok {test-number} - result for: {?}
# Parsing path filter specs
ok {test-number} - !(config.useNewPathFilteringBehaviour) for: !false
# Parsing path filter specs
ok {test-number} - result for: {?}
# Parsing path filter specs
ok {test-number} - config.useNewPathFilteringBehaviour for: true
# Parsing path filter specs
ok {test-number} - !(result) for: !{?}
# Parsing path filter specs
ok {test-number} - result for: {?}
# Parsing path filter specs
ok {test-number} - config.pathFilters[0] == PathFilter( PathFilter::For::Generator, "*" ) for: {?} == {?}
# Parsing path filter specs
ok {test-number} - !(result) for: !{?}
# Parsing path filter specs
ok {test-number} - result for: {?}
# Parsing path filter specs
ok {test-number} - config.useNewPathFilteringBehaviour for: true
# Parsing path filter specs
ok {test-number} - config.pathFilters[0] == PathFilter( PathFilter::For::Generator, "1" ) for: {?} == {?}
# Parsing path filter specs
ok {test-number} - config.pathFilters[1] == PathFilter( PathFilter::For::Section, "foobar" ) for: {?} == {?}
# Parsing path filter specs
ok {test-number} - !(result) for: !{?}
# Parsing path filter specs
ok {test-number} - !(result1) for: !{?}
# Parsing path filter specs
ok {test-number} - !(result2) for: !{?}
# Parsing path filter specs
ok {test-number} - result for: {?}
# Parsing path filter specs
ok {test-number} - config.pathFilters[0] == PathFilter( PathFilter::For::Section, "foo-bar" ) for: {?} == {?}
# Parsing path filter specs
ok {test-number} - config.pathFilters[1] == PathFilter( PathFilter::For::Generator, "3" ) for: {?} == {?}
# Parsing path filter specs
ok {test-number} - config.pathFilters[2] == PathFilter( PathFilter::For::Generator, "123" ) for: {?} == {?}
# Parsing path filter specs
ok {test-number} - config.pathFilters[3] == PathFilter( PathFilter::For::Section, "baz" ) for: {?} == {?}
# Parsing path filter specs
ok {test-number} - result for: {?}
# Parsing path filter specs
ok {test-number} - config.pathFilters[0] == PathFilter(PathFilter::For::Section, "untrimmed" ) for: {?} == {?}
# Parsing path filter specs
ok {test-number} - config.pathFilters[1] == PathFilter(PathFilter::For::Generator, "42" ) for: {?} == {?}
# Parsing sharding-related cli flags
ok {test-number} - cli.parse({ "test", "--shard-count=8" }) for: {?}
# Parsing sharding-related cli flags
@@ -2281,9 +2445,9 @@ ok {test-number} - config.warnings == WarnAbout::NoAssertions for: 1 == 1
# Parsing warnings
ok {test-number} - !(cli.parse( { "test", "-w", "NoTests" } )) for: !{?}
# Parsing warnings
ok {test-number} - cli.parse( { "test", "--warn", "NoAssertions", "--warn", "UnmatchedTestSpec" } ) for: {?}
ok {test-number} - cli.parse( { "test", "--warn", "NoAssertions", "--warn", "UnmatchedTestSpec", "--warn", "InfiniteGenerators" } ) for: {?}
# Parsing warnings
ok {test-number} - config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec ) for: 3 == 3
ok {test-number} - config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec | WarnAbout::InfiniteGenerator ) for: 7 == 7
# Pointers can be compared to null
ok {test-number} - p == 0 for: 0 == 0
# Pointers can be compared to null
@@ -2485,6 +2649,14 @@ ok {test-number} - cli.parse({ "test", "--benchmark-samples=200" }) for: {?}
# Process can be configured on command line
ok {test-number} - config.benchmarkSamples == 200 for: 200 == 200
# Process can be configured on command line
ok {test-number} - !(result) for: !{?}
# Process can be configured on command line
ok {test-number} - result.errorMessage(), ContainsSubstring("Benchmark samples must be greater than 0") for: "Benchmark samples must be greater than 0" contains: "Benchmark samples must be greater than 0"
# Process can be configured on command line
ok {test-number} - !(result) for: !{?}
# Process can be configured on command line
ok {test-number} - result.errorMessage(), ContainsSubstring("Could not parse 'abc' as benchmark samples") for: "Could not parse 'abc' as benchmark samples" contains: "Could not parse 'abc' as benchmark samples"
# Process can be configured on command line
ok {test-number} - cli.parse({ "test", "--benchmark-resamples=20000" }) for: {?}
# Process can be configured on command line
ok {test-number} - config.benchmarkResamples == 20000 for: 20000 (0x<hex digits>) == 20000 (0x<hex digits>)
@@ -2514,6 +2686,12 @@ ok {test-number} - Catch::generateRandomSeed(method)
ok {test-number} - Catch::generateRandomSeed(method)
# Random seed generation reports unknown methods
ok {test-number} - Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77))
# RandomGenerator reports itself as infinite - float
ok {test-number} - !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
# RandomGenerator reports itself as infinite - int
ok {test-number} - !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
# RandomGenerator reports itself as infinite - long double
ok {test-number} - !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
# Range type with sentinel
ok {test-number} - Catch::Detail::stringify(UsesSentinel{}) == "{ }" for: "{ }" == "{ }"
# Reconstruction should be based on stringification: #914
@@ -2528,6 +2706,8 @@ not ok {test-number} - testStringForMatching(), Matches( "this string contains '
ok {test-number} - registry.registerReporter( "with::doublecolons", Catch::Detail::make_unique<TestReporterFactory>() ), "'::' is not allowed in reporter name: 'with::doublecolons'" for: "'::' is not allowed in reporter name: 'with::doublecolons'" equals: "'::' is not allowed in reporter name: 'with::doublecolons'"
# Regression test #1
ok {test-number} - actual, !UnorderedEquals( expected ) for: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' }
# RepeatGenerator refuses infinite generators
ok {test-number} - RepeatGenerator<int>( 2, random( 1, 100 ) )
# Reporter's write listings to provided stream
ok {test-number} - !(factories.empty()) for: !false
# Reporter's write listings to provided stream
@@ -2879,6 +3059,22 @@ ok {test-number} - registry.add( "[@no square bracket at end", "", Catch::Source
ok {test-number} - testCase.tags.size() == 2 for: 2 == 2
# Tags with spaces and non-alphanumerical characters are accepted
ok {test-number} - testCase.tags, VectorContains( Tag( "tag with spaces" ) ) && VectorContains( Tag( "I said \"good day\" sir!"_catch_sr ) ) for: { {?}, {?} } ( Contains: {?} and Contains: {?} )
# TakeGenerator can be skipped forward
ok {test-number} - take.get() == 0 for: 0 == 0
# TakeGenerator can be skipped forward
ok {test-number} - take.get() == 2 for: 2 == 2
# TakeGenerator can be skipped forward
ok {test-number} - take.get() == 5 for: 5 == 5
# TakeGenerator can be skipped forward
ok {test-number} - take.skipToNthElement( 6 )
# TakeGenerator can be skipped forward
ok {test-number} - take.get() == 0 for: 0 == 0
# TakeGenerator can be skipped forward
ok {test-number} - take.get() == 2 for: 2 == 2
# TakeGenerator can be skipped forward
ok {test-number} - take.get() == 5 for: 5 == 5
# TakeGenerator can be skipped forward
ok {test-number} - take.skipToNthElement( 6 )
# Template test case method with test types specified inside std::tuple - MyTypes - 0
ok {test-number} - Template_Fixture<TestType>::m_a == 1 for: 1 == 1
# Template test case method with test types specified inside std::tuple - MyTypes - 1
@@ -3409,6 +3605,8 @@ ok {test-number} - vector_a, RangeEquals( array_a_plus_1, close_enough ) for: {
ok {test-number} - vector_a, UnorderedRangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } unordered elements are { 2, 3, 4 }
# Unexpected exceptions can be translated
not ok {test-number} - unexpected exception with message: '3.14000000000000012'
# Unscoped capture outlives scope
not ok {test-number} - false with 3 messages: 'i := 1' and 'j := 2' and 'i + j := 3'
# Upcasting special member functions
ok {test-number} - bptr->i == 3 for: 3 == 3
# Upcasting special member functions
@@ -3923,6 +4121,22 @@ ok {test-number} - model.finished == 0 for: 0 == 0
ok {test-number} - called == 1 for: 1 == 1
# boolean member
ok {test-number} - obj.prop != 0 for: 0x<hex digits> != 0
# cat generator
ok {test-number} - input < 3 for: 0 < 3
# cat generator
ok {test-number} - input < 3 for: 1 < 3
# cat generator
ok {test-number} - input < 3 for: 2 < 3
# cat generator
ok {test-number} - input % 2 == 0 for: 0 == 0
# cat generator
ok {test-number} - input % 2 == 0 for: 0 == 0
# cat generator
ok {test-number} - input % 2 == 0 for: 0 == 0
# cat generator
ok {test-number} - input % 2 == 0 for: 0 == 0
# cat generator
ok {test-number} - input % 2 == 0 for: 0 == 0
# checkedElse
ok {test-number} - flag for: true
# checkedElse
@@ -4631,5 +4845,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0
ok {test-number} -
# xmlentitycheck
ok {test-number} -
1..2317
1..2425
@@ -978,6 +978,30 @@ ok {test-number} - matcher.match( 1 ) for: true
ok {test-number} - first.matchCalled for: true
# Composed matchers shortcircuit
ok {test-number} - !second.matchCalled for: true
# ConcatGenerator
ok {test-number} - c.get() == 1 for: 1 == 1
# ConcatGenerator
ok {test-number} - !(c.next()) for: !false
# ConcatGenerator
ok {test-number} - c.get() == i + 1 for: 1 == 1
# ConcatGenerator
ok {test-number} - c.next() for: true
# ConcatGenerator
ok {test-number} - c.get() == i + 1 for: 2 == 2
# ConcatGenerator
ok {test-number} - c.next() for: true
# ConcatGenerator
ok {test-number} - c.get() == i + 1 for: 3 == 3
# ConcatGenerator
ok {test-number} - c.next() for: true
# ConcatGenerator
ok {test-number} - c.get() == i + 1 for: 4 == 4
# ConcatGenerator
ok {test-number} - c.next() for: true
# ConcatGenerator
ok {test-number} - c.get() == 5 for: 5 == 5
# ConcatGenerator
ok {test-number} - !(c.next()) for: !false
# Contains string matcher
not ok {test-number} - testStringForMatching(), ContainsSubstring( "not there", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "not there" (case insensitive)
# Contains string matcher
@@ -1186,6 +1210,18 @@ ok {test-number} - Factorial(3) == 6 for: 6 == 6
ok {test-number} - Factorial(10) == 3628800 for: 3628800 (0x<hex digits>) == 3628800 (0x<hex digits>)
# Filter generator throws exception for empty generator
ok {test-number} - filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException
# FixedValuesGenerator can be skipped forward
ok {test-number} - values.currentElementIndex() == 0 for: 0 == 0
# FixedValuesGenerator can be skipped forward
ok {test-number} - values.currentElementIndex() == 3 for: 3 == 3
# FixedValuesGenerator can be skipped forward
ok {test-number} - values.get() == 3 for: 3 == 3
# FixedValuesGenerator can be skipped forward
ok {test-number} - values.currentElementIndex() == 4 for: 4 == 4
# FixedValuesGenerator can be skipped forward
ok {test-number} - values.get() == 4 for: 4 == 4
# FixedValuesGenerator can be skipped forward
ok {test-number} - values.skipToNthElement( 5 )
# Floating point matchers: double
ok {test-number} - 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.09999999999999964 are within 10% of each other
# Floating point matchers: double
@@ -1320,6 +1356,26 @@ ok {test-number} - i % 2 == 0 for: 0 == 0
ok {test-number} - i % 2 == 0 for: 0 == 0
# GENERATE can combine literals and generators
ok {test-number} - i % 2 == 0 for: 0 == 0
# Generator adapters properly handle isFinite
ok {test-number} - finite_cat.isFinite() for: true
# Generator adapters properly handle isFinite
ok {test-number} - !(infinite_cat.isFinite()) for: !false
# Generator adapters properly handle isFinite
ok {test-number} - take_1.isFinite() for: true
# Generator adapters properly handle isFinite
ok {test-number} - take_2.isFinite() for: true
# Generator adapters properly handle isFinite
ok {test-number} - finite_chunk.isFinite() for: true
# Generator adapters properly handle isFinite
ok {test-number} - !(infinite_chunk.isFinite()) for: !false
# Generator adapters properly handle isFinite
ok {test-number} - finite_map.isFinite() for: true
# Generator adapters properly handle isFinite
ok {test-number} - !(infinite_map.isFinite()) for: !false
# Generator adapters properly handle isFinite
ok {test-number} - finite_filter.isFinite() for: true
# Generator adapters properly handle isFinite
ok {test-number} - !(infinite_filter.isFinite()) for: !false
# Generators -- adapters
ok {test-number} - i % 2 == 0 for: 0 == 0
# Generators -- adapters
@@ -1432,6 +1488,24 @@ ok {test-number} - 4u * i > str.size() for: 12 > 1
ok {test-number} - 4u * i > str.size() for: 12 > 2
# Generators -- simple
ok {test-number} - 4u * i > str.size() for: 12 > 3
# Generators can be skipped forward
ok {test-number} - generator.currentElementIndex() == 0 for: 0 == 0
# Generators can be skipped forward
ok {test-number} - generator.currentElementIndex() == 3 for: 3 == 3
# Generators can be skipped forward
ok {test-number} - generator.get() == 3 for: 3 == 3
# Generators can be skipped forward
ok {test-number} - generator.currentElementIndex() == 3 for: 3 == 3
# Generators can be skipped forward
ok {test-number} - generator.get() == 3 for: 3 == 3
# Generators can be skipped forward
ok {test-number} - generator.currentElementIndex() == 5 for: 5 == 5
# Generators can be skipped forward
ok {test-number} - generator.get() == 5 for: 5 == 5
# Generators can be skipped forward
ok {test-number} - generator.skipToNthElement( 3 )
# Generators can be skipped forward
ok {test-number} - generator.skipToNthElement( 6 )
# Generators internals
ok {test-number} - gen.get() == 123 for: 123 == 123
# Generators internals
@@ -1984,6 +2058,50 @@ ok {test-number} - !(d <= Approx( 1.22 )) for: !(1.22999999999999998 <= Approx(
ok {test-number} - d <= Approx( 1.22 ).epsilon(0.1) for: 1.22999999999999998 <= Approx( 1.21999999999999997 )
# ManuallyRegistered
ok {test-number} - with 1 message: 'was called'
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 0 for: 0 == 0
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 0 for: 0 == 0
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_generator.get() == 3 for: 3 == 3
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 1 for: 1 == 1
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_generator.get() == 3 for: 3 == 3
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 1 for: 1 == 1
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 1 for: 1 == 1
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 0 for: 0 == 0
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 0 for: 0 == 0
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_generator.get() == 4 for: 4 == 4
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 1 for: 1 == 1
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_generator.get() == 4 for: 4 == 4
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 1 for: 1 == 1
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 1 for: 1 == 1
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_generator.get() == 6 for: 6 == 6
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 2 for: 2 == 2
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_generator.skipToNthElement( 7 )
# MapGenerator can be skipped forward efficiently
ok {test-number} - map_calls == 2 for: 2 == 2
# MapGenerator can handle not default constructible types
ok {test-number} - map_generator.get().m_i == 1 for: 1 == 1
# MapGenerator can handle not default constructible types
ok {test-number} - map_generator.next() for: true
# MapGenerator can handle not default constructible types
ok {test-number} - map_generator.next() for: true
# MapGenerator can handle not default constructible types
ok {test-number} - map_generator.get().m_i == 3 for: 3 == 3
# Matchers can be (AllOf) composed with the && operator
ok {test-number} - testStringForMatching(), ContainsSubstring( "string" ) && ContainsSubstring( "abc" ) && ContainsSubstring( "substring" ) && ContainsSubstring( "contains" ) for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" )
# Matchers can be (AnyOf) composed with the || operator
@@ -2236,6 +2354,52 @@ ok {test-number} - spec.hasFilters() for: true
ok {test-number} - spec.getInvalidSpecs().empty() for: true
# Parsed tags are matched case insensitive
ok {test-number} - spec.matches( testCase ) for: true
# Parsing path filter specs
ok {test-number} - result for: {?}
# Parsing path filter specs
ok {test-number} - !(config.useNewPathFilteringBehaviour) for: !false
# Parsing path filter specs
ok {test-number} - result for: {?}
# Parsing path filter specs
ok {test-number} - config.useNewPathFilteringBehaviour for: true
# Parsing path filter specs
ok {test-number} - !(result) for: !{?}
# Parsing path filter specs
ok {test-number} - result for: {?}
# Parsing path filter specs
ok {test-number} - config.pathFilters[0] == PathFilter( PathFilter::For::Generator, "*" ) for: {?} == {?}
# Parsing path filter specs
ok {test-number} - !(result) for: !{?}
# Parsing path filter specs
ok {test-number} - result for: {?}
# Parsing path filter specs
ok {test-number} - config.useNewPathFilteringBehaviour for: true
# Parsing path filter specs
ok {test-number} - config.pathFilters[0] == PathFilter( PathFilter::For::Generator, "1" ) for: {?} == {?}
# Parsing path filter specs
ok {test-number} - config.pathFilters[1] == PathFilter( PathFilter::For::Section, "foobar" ) for: {?} == {?}
# Parsing path filter specs
ok {test-number} - !(result) for: !{?}
# Parsing path filter specs
ok {test-number} - !(result1) for: !{?}
# Parsing path filter specs
ok {test-number} - !(result2) for: !{?}
# Parsing path filter specs
ok {test-number} - result for: {?}
# Parsing path filter specs
ok {test-number} - config.pathFilters[0] == PathFilter( PathFilter::For::Section, "foo-bar" ) for: {?} == {?}
# Parsing path filter specs
ok {test-number} - config.pathFilters[1] == PathFilter( PathFilter::For::Generator, "3" ) for: {?} == {?}
# Parsing path filter specs
ok {test-number} - config.pathFilters[2] == PathFilter( PathFilter::For::Generator, "123" ) for: {?} == {?}
# Parsing path filter specs
ok {test-number} - config.pathFilters[3] == PathFilter( PathFilter::For::Section, "baz" ) for: {?} == {?}
# Parsing path filter specs
ok {test-number} - result for: {?}
# Parsing path filter specs
ok {test-number} - config.pathFilters[0] == PathFilter(PathFilter::For::Section, "untrimmed" ) for: {?} == {?}
# Parsing path filter specs
ok {test-number} - config.pathFilters[1] == PathFilter(PathFilter::For::Generator, "42" ) for: {?} == {?}
# Parsing sharding-related cli flags
ok {test-number} - cli.parse({ "test", "--shard-count=8" }) for: {?}
# Parsing sharding-related cli flags
@@ -2279,9 +2443,9 @@ ok {test-number} - config.warnings == WarnAbout::NoAssertions for: 1 == 1
# Parsing warnings
ok {test-number} - !(cli.parse( { "test", "-w", "NoTests" } )) for: !{?}
# Parsing warnings
ok {test-number} - cli.parse( { "test", "--warn", "NoAssertions", "--warn", "UnmatchedTestSpec" } ) for: {?}
ok {test-number} - cli.parse( { "test", "--warn", "NoAssertions", "--warn", "UnmatchedTestSpec", "--warn", "InfiniteGenerators" } ) for: {?}
# Parsing warnings
ok {test-number} - config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec ) for: 3 == 3
ok {test-number} - config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec | WarnAbout::InfiniteGenerator ) for: 7 == 7
# Pointers can be compared to null
ok {test-number} - p == 0 for: 0 == 0
# Pointers can be compared to null
@@ -2483,6 +2647,14 @@ ok {test-number} - cli.parse({ "test", "--benchmark-samples=200" }) for: {?}
# Process can be configured on command line
ok {test-number} - config.benchmarkSamples == 200 for: 200 == 200
# Process can be configured on command line
ok {test-number} - !(result) for: !{?}
# Process can be configured on command line
ok {test-number} - result.errorMessage(), ContainsSubstring("Benchmark samples must be greater than 0") for: "Benchmark samples must be greater than 0" contains: "Benchmark samples must be greater than 0"
# Process can be configured on command line
ok {test-number} - !(result) for: !{?}
# Process can be configured on command line
ok {test-number} - result.errorMessage(), ContainsSubstring("Could not parse 'abc' as benchmark samples") for: "Could not parse 'abc' as benchmark samples" contains: "Could not parse 'abc' as benchmark samples"
# Process can be configured on command line
ok {test-number} - cli.parse({ "test", "--benchmark-resamples=20000" }) for: {?}
# Process can be configured on command line
ok {test-number} - config.benchmarkResamples == 20000 for: 20000 (0x<hex digits>) == 20000 (0x<hex digits>)
@@ -2512,6 +2684,12 @@ ok {test-number} - Catch::generateRandomSeed(method)
ok {test-number} - Catch::generateRandomSeed(method)
# Random seed generation reports unknown methods
ok {test-number} - Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77))
# RandomGenerator reports itself as infinite - float
ok {test-number} - !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
# RandomGenerator reports itself as infinite - int
ok {test-number} - !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
# RandomGenerator reports itself as infinite - long double
ok {test-number} - !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
# Range type with sentinel
ok {test-number} - Catch::Detail::stringify(UsesSentinel{}) == "{ }" for: "{ }" == "{ }"
# Reconstruction should be based on stringification: #914
@@ -2526,6 +2704,8 @@ not ok {test-number} - testStringForMatching(), Matches( "this string contains '
ok {test-number} - registry.registerReporter( "with::doublecolons", Catch::Detail::make_unique<TestReporterFactory>() ), "'::' is not allowed in reporter name: 'with::doublecolons'" for: "'::' is not allowed in reporter name: 'with::doublecolons'" equals: "'::' is not allowed in reporter name: 'with::doublecolons'"
# Regression test #1
ok {test-number} - actual, !UnorderedEquals( expected ) for: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' }
# RepeatGenerator refuses infinite generators
ok {test-number} - RepeatGenerator<int>( 2, random( 1, 100 ) )
# Reporter's write listings to provided stream
ok {test-number} - !(factories.empty()) for: !false
# Reporter's write listings to provided stream
@@ -2872,6 +3052,22 @@ ok {test-number} - registry.add( "[@no square bracket at end", "", Catch::Source
ok {test-number} - testCase.tags.size() == 2 for: 2 == 2
# Tags with spaces and non-alphanumerical characters are accepted
ok {test-number} - testCase.tags, VectorContains( Tag( "tag with spaces" ) ) && VectorContains( Tag( "I said \"good day\" sir!"_catch_sr ) ) for: { {?}, {?} } ( Contains: {?} and Contains: {?} )
# TakeGenerator can be skipped forward
ok {test-number} - take.get() == 0 for: 0 == 0
# TakeGenerator can be skipped forward
ok {test-number} - take.get() == 2 for: 2 == 2
# TakeGenerator can be skipped forward
ok {test-number} - take.get() == 5 for: 5 == 5
# TakeGenerator can be skipped forward
ok {test-number} - take.skipToNthElement( 6 )
# TakeGenerator can be skipped forward
ok {test-number} - take.get() == 0 for: 0 == 0
# TakeGenerator can be skipped forward
ok {test-number} - take.get() == 2 for: 2 == 2
# TakeGenerator can be skipped forward
ok {test-number} - take.get() == 5 for: 5 == 5
# TakeGenerator can be skipped forward
ok {test-number} - take.skipToNthElement( 6 )
# Template test case method with test types specified inside std::tuple - MyTypes - 0
ok {test-number} - Template_Fixture<TestType>::m_a == 1 for: 1 == 1
# Template test case method with test types specified inside std::tuple - MyTypes - 1
@@ -3402,6 +3598,8 @@ ok {test-number} - vector_a, RangeEquals( array_a_plus_1, close_enough ) for: {
ok {test-number} - vector_a, UnorderedRangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } unordered elements are { 2, 3, 4 }
# Unexpected exceptions can be translated
not ok {test-number} - unexpected exception with message: '3.14000000000000012'
# Unscoped capture outlives scope
not ok {test-number} - false with 3 messages: 'i := 1' and 'j := 2' and 'i + j := 3'
# Upcasting special member functions
ok {test-number} - bptr->i == 3 for: 3 == 3
# Upcasting special member functions
@@ -3916,6 +4114,22 @@ ok {test-number} - model.finished == 0 for: 0 == 0
ok {test-number} - called == 1 for: 1 == 1
# boolean member
ok {test-number} - obj.prop != 0 for: 0x<hex digits> != 0
# cat generator
ok {test-number} - input < 3 for: 0 < 3
# cat generator
ok {test-number} - input < 3 for: 1 < 3
# cat generator
ok {test-number} - input < 3 for: 2 < 3
# cat generator
ok {test-number} - input % 2 == 0 for: 0 == 0
# cat generator
ok {test-number} - input % 2 == 0 for: 0 == 0
# cat generator
ok {test-number} - input % 2 == 0 for: 0 == 0
# cat generator
ok {test-number} - input % 2 == 0 for: 0 == 0
# cat generator
ok {test-number} - input % 2 == 0 for: 0 == 0
# checkedElse
ok {test-number} - flag for: true
# checkedElse
@@ -4620,5 +4834,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0
ok {test-number} -
# xmlentitycheck
ok {test-number} -
1..2317
1..2425
@@ -303,6 +303,8 @@
##teamcity[testFinished name='Composed generic matchers shortcircuit' duration="{duration}"]
##teamcity[testStarted name='Composed matchers shortcircuit']
##teamcity[testFinished name='Composed matchers shortcircuit' duration="{duration}"]
##teamcity[testStarted name='ConcatGenerator']
##teamcity[testFinished name='ConcatGenerator' duration="{duration}"]
##teamcity[testStarted name='Contains string matcher']
##teamcity[testFailed name='Contains string matcher' message='Matchers.tests.cpp:<line number>|n...............................................................................|n|nMatchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), ContainsSubstring( "not there", Catch::CaseSensitive::No ) )|nwith expansion:|n "this string contains |'abc|' as a substring" contains: "not there" (case insensitive)|n']
##teamcity[testFailed name='Contains string matcher' message='Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), ContainsSubstring( "STRING" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" contains: "STRING"|n']
@@ -407,16 +409,22 @@
##teamcity[testFinished name='Factorials are computed' duration="{duration}"]
##teamcity[testStarted name='Filter generator throws exception for empty generator']
##teamcity[testFinished name='Filter generator throws exception for empty generator' duration="{duration}"]
##teamcity[testStarted name='FixedValuesGenerator can be skipped forward']
##teamcity[testFinished name='FixedValuesGenerator can be skipped forward' duration="{duration}"]
##teamcity[testStarted name='Floating point matchers: double']
##teamcity[testFinished name='Floating point matchers: double' duration="{duration}"]
##teamcity[testStarted name='Floating point matchers: float']
##teamcity[testFinished name='Floating point matchers: float' duration="{duration}"]
##teamcity[testStarted name='GENERATE can combine literals and generators']
##teamcity[testFinished name='GENERATE can combine literals and generators' duration="{duration}"]
##teamcity[testStarted name='Generator adapters properly handle isFinite']
##teamcity[testFinished name='Generator adapters properly handle isFinite' duration="{duration}"]
##teamcity[testStarted name='Generators -- adapters']
##teamcity[testFinished name='Generators -- adapters' duration="{duration}"]
##teamcity[testStarted name='Generators -- simple']
##teamcity[testFinished name='Generators -- simple' duration="{duration}"]
##teamcity[testStarted name='Generators can be skipped forward']
##teamcity[testFinished name='Generators can be skipped forward' duration="{duration}"]
##teamcity[testStarted name='Generators internals']
##teamcity[testFinished name='Generators internals' duration="{duration}"]
##teamcity[testStarted name='Greater-than inequalities with different epsilons']
@@ -466,6 +474,10 @@
##teamcity[testFinished name='Less-than inequalities with different epsilons' duration="{duration}"]
##teamcity[testStarted name='ManuallyRegistered']
##teamcity[testFinished name='ManuallyRegistered' duration="{duration}"]
##teamcity[testStarted name='MapGenerator can be skipped forward efficiently']
##teamcity[testFinished name='MapGenerator can be skipped forward efficiently' duration="{duration}"]
##teamcity[testStarted name='MapGenerator can handle not default constructible types']
##teamcity[testFinished name='MapGenerator can handle not default constructible types' duration="{duration}"]
##teamcity[testStarted name='Matchers can be (AllOf) composed with the && operator']
##teamcity[testFinished name='Matchers can be (AllOf) composed with the && operator' duration="{duration}"]
##teamcity[testStarted name='Matchers can be (AnyOf) composed with the |||| operator']
@@ -539,6 +551,8 @@
##teamcity[testFinished name='Parse uints' duration="{duration}"]
##teamcity[testStarted name='Parsed tags are matched case insensitive']
##teamcity[testFinished name='Parsed tags are matched case insensitive' duration="{duration}"]
##teamcity[testStarted name='Parsing path filter specs']
##teamcity[testFinished name='Parsing path filter specs' duration="{duration}"]
##teamcity[testStarted name='Parsing sharding-related cli flags']
##teamcity[testFinished name='Parsing sharding-related cli flags' duration="{duration}"]
##teamcity[testStarted name='Parsing tags with non-alphabetical characters is pass-through']
@@ -563,6 +577,12 @@
##teamcity[testFinished name='Random seed generation accepts known methods' duration="{duration}"]
##teamcity[testStarted name='Random seed generation reports unknown methods']
##teamcity[testFinished name='Random seed generation reports unknown methods' duration="{duration}"]
##teamcity[testStarted name='RandomGenerator reports itself as infinite - float']
##teamcity[testFinished name='RandomGenerator reports itself as infinite - float' duration="{duration}"]
##teamcity[testStarted name='RandomGenerator reports itself as infinite - int']
##teamcity[testFinished name='RandomGenerator reports itself as infinite - int' duration="{duration}"]
##teamcity[testStarted name='RandomGenerator reports itself as infinite - long double']
##teamcity[testFinished name='RandomGenerator reports itself as infinite - long double' duration="{duration}"]
##teamcity[testStarted name='Range type with sentinel']
##teamcity[testFinished name='Range type with sentinel' duration="{duration}"]
##teamcity[testStarted name='Reconstruction should be based on stringification: #914']
@@ -577,6 +597,8 @@
##teamcity[testFinished name='Registering reporter with |'::|' in name fails' duration="{duration}"]
##teamcity[testStarted name='Regression test #1']
##teamcity[testFinished name='Regression test #1' duration="{duration}"]
##teamcity[testStarted name='RepeatGenerator refuses infinite generators']
##teamcity[testFinished name='RepeatGenerator refuses infinite generators' duration="{duration}"]
##teamcity[testStarted name='Reporter|'s write listings to provided stream']
##teamcity[testFinished name='Reporter|'s write listings to provided stream' duration="{duration}"]
##teamcity[testStarted name='Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla']
@@ -643,6 +665,8 @@
##teamcity[testFinished name='Tag alias can be registered against tag patterns' duration="{duration}"]
##teamcity[testStarted name='Tags with spaces and non-alphanumerical characters are accepted']
##teamcity[testFinished name='Tags with spaces and non-alphanumerical characters are accepted' duration="{duration}"]
##teamcity[testStarted name='TakeGenerator can be skipped forward']
##teamcity[testFinished name='TakeGenerator can be skipped forward' duration="{duration}"]
##teamcity[testStarted name='Template test case method with test types specified inside std::tuple - MyTypes - 0']
##teamcity[testFinished name='Template test case method with test types specified inside std::tuple - MyTypes - 0' duration="{duration}"]
##teamcity[testStarted name='Template test case method with test types specified inside std::tuple - MyTypes - 1']
@@ -727,6 +751,9 @@
##teamcity[testStarted name='Unexpected exceptions can be translated']
##teamcity[testFailed name='Unexpected exceptions can be translated' message='Exception.tests.cpp:<line number>|n...............................................................................|n|nException.tests.cpp:<line number>|nunexpected exception with message:|n "3.14000000000000012"']
##teamcity[testFinished name='Unexpected exceptions can be translated' duration="{duration}"]
##teamcity[testStarted name='Unscoped capture outlives scope']
##teamcity[testIgnored name='Unscoped capture outlives scope' message='Message.tests.cpp:<line number>|n...............................................................................|n|nMessage.tests.cpp:<line number>|nexpression failed with messages:|n "i := 1"|n "j := 2"|n "i + j := 3"|n REQUIRE( false )|nwith expansion:|n false|n- failure ignore as test marked as |'ok to fail|'|n']
##teamcity[testFinished name='Unscoped capture outlives scope' duration="{duration}"]
##teamcity[testStarted name='Upcasting special member functions']
##teamcity[testFinished name='Upcasting special member functions' duration="{duration}"]
##teamcity[testStarted name='Usage of AllMatch range matcher']
@@ -815,6 +842,8 @@
##teamcity[testFinished name='benchmark function call' duration="{duration}"]
##teamcity[testStarted name='boolean member']
##teamcity[testFinished name='boolean member' duration="{duration}"]
##teamcity[testStarted name='cat generator']
##teamcity[testFinished name='cat generator' duration="{duration}"]
##teamcity[testStarted name='checkedElse']
##teamcity[testFinished name='checkedElse' duration="{duration}"]
##teamcity[testStarted name='checkedElse, failing']
@@ -303,6 +303,8 @@
##teamcity[testFinished name='Composed generic matchers shortcircuit' duration="{duration}"]
##teamcity[testStarted name='Composed matchers shortcircuit']
##teamcity[testFinished name='Composed matchers shortcircuit' duration="{duration}"]
##teamcity[testStarted name='ConcatGenerator']
##teamcity[testFinished name='ConcatGenerator' duration="{duration}"]
##teamcity[testStarted name='Contains string matcher']
##teamcity[testFailed name='Contains string matcher' message='Matchers.tests.cpp:<line number>|n...............................................................................|n|nMatchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), ContainsSubstring( "not there", Catch::CaseSensitive::No ) )|nwith expansion:|n "this string contains |'abc|' as a substring" contains: "not there" (case insensitive)|n']
##teamcity[testFailed name='Contains string matcher' message='Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), ContainsSubstring( "STRING" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" contains: "STRING"|n']
@@ -407,16 +409,22 @@
##teamcity[testFinished name='Factorials are computed' duration="{duration}"]
##teamcity[testStarted name='Filter generator throws exception for empty generator']
##teamcity[testFinished name='Filter generator throws exception for empty generator' duration="{duration}"]
##teamcity[testStarted name='FixedValuesGenerator can be skipped forward']
##teamcity[testFinished name='FixedValuesGenerator can be skipped forward' duration="{duration}"]
##teamcity[testStarted name='Floating point matchers: double']
##teamcity[testFinished name='Floating point matchers: double' duration="{duration}"]
##teamcity[testStarted name='Floating point matchers: float']
##teamcity[testFinished name='Floating point matchers: float' duration="{duration}"]
##teamcity[testStarted name='GENERATE can combine literals and generators']
##teamcity[testFinished name='GENERATE can combine literals and generators' duration="{duration}"]
##teamcity[testStarted name='Generator adapters properly handle isFinite']
##teamcity[testFinished name='Generator adapters properly handle isFinite' duration="{duration}"]
##teamcity[testStarted name='Generators -- adapters']
##teamcity[testFinished name='Generators -- adapters' duration="{duration}"]
##teamcity[testStarted name='Generators -- simple']
##teamcity[testFinished name='Generators -- simple' duration="{duration}"]
##teamcity[testStarted name='Generators can be skipped forward']
##teamcity[testFinished name='Generators can be skipped forward' duration="{duration}"]
##teamcity[testStarted name='Generators internals']
##teamcity[testFinished name='Generators internals' duration="{duration}"]
##teamcity[testStarted name='Greater-than inequalities with different epsilons']
@@ -466,6 +474,10 @@
##teamcity[testFinished name='Less-than inequalities with different epsilons' duration="{duration}"]
##teamcity[testStarted name='ManuallyRegistered']
##teamcity[testFinished name='ManuallyRegistered' duration="{duration}"]
##teamcity[testStarted name='MapGenerator can be skipped forward efficiently']
##teamcity[testFinished name='MapGenerator can be skipped forward efficiently' duration="{duration}"]
##teamcity[testStarted name='MapGenerator can handle not default constructible types']
##teamcity[testFinished name='MapGenerator can handle not default constructible types' duration="{duration}"]
##teamcity[testStarted name='Matchers can be (AllOf) composed with the && operator']
##teamcity[testFinished name='Matchers can be (AllOf) composed with the && operator' duration="{duration}"]
##teamcity[testStarted name='Matchers can be (AnyOf) composed with the |||| operator']
@@ -539,6 +551,8 @@
##teamcity[testFinished name='Parse uints' duration="{duration}"]
##teamcity[testStarted name='Parsed tags are matched case insensitive']
##teamcity[testFinished name='Parsed tags are matched case insensitive' duration="{duration}"]
##teamcity[testStarted name='Parsing path filter specs']
##teamcity[testFinished name='Parsing path filter specs' duration="{duration}"]
##teamcity[testStarted name='Parsing sharding-related cli flags']
##teamcity[testFinished name='Parsing sharding-related cli flags' duration="{duration}"]
##teamcity[testStarted name='Parsing tags with non-alphabetical characters is pass-through']
@@ -563,6 +577,12 @@
##teamcity[testFinished name='Random seed generation accepts known methods' duration="{duration}"]
##teamcity[testStarted name='Random seed generation reports unknown methods']
##teamcity[testFinished name='Random seed generation reports unknown methods' duration="{duration}"]
##teamcity[testStarted name='RandomGenerator reports itself as infinite - float']
##teamcity[testFinished name='RandomGenerator reports itself as infinite - float' duration="{duration}"]
##teamcity[testStarted name='RandomGenerator reports itself as infinite - int']
##teamcity[testFinished name='RandomGenerator reports itself as infinite - int' duration="{duration}"]
##teamcity[testStarted name='RandomGenerator reports itself as infinite - long double']
##teamcity[testFinished name='RandomGenerator reports itself as infinite - long double' duration="{duration}"]
##teamcity[testStarted name='Range type with sentinel']
##teamcity[testFinished name='Range type with sentinel' duration="{duration}"]
##teamcity[testStarted name='Reconstruction should be based on stringification: #914']
@@ -577,6 +597,8 @@
##teamcity[testFinished name='Registering reporter with |'::|' in name fails' duration="{duration}"]
##teamcity[testStarted name='Regression test #1']
##teamcity[testFinished name='Regression test #1' duration="{duration}"]
##teamcity[testStarted name='RepeatGenerator refuses infinite generators']
##teamcity[testFinished name='RepeatGenerator refuses infinite generators' duration="{duration}"]
##teamcity[testStarted name='Reporter|'s write listings to provided stream']
##teamcity[testFinished name='Reporter|'s write listings to provided stream' duration="{duration}"]
##teamcity[testStarted name='Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla']
@@ -643,6 +665,8 @@
##teamcity[testFinished name='Tag alias can be registered against tag patterns' duration="{duration}"]
##teamcity[testStarted name='Tags with spaces and non-alphanumerical characters are accepted']
##teamcity[testFinished name='Tags with spaces and non-alphanumerical characters are accepted' duration="{duration}"]
##teamcity[testStarted name='TakeGenerator can be skipped forward']
##teamcity[testFinished name='TakeGenerator can be skipped forward' duration="{duration}"]
##teamcity[testStarted name='Template test case method with test types specified inside std::tuple - MyTypes - 0']
##teamcity[testFinished name='Template test case method with test types specified inside std::tuple - MyTypes - 0' duration="{duration}"]
##teamcity[testStarted name='Template test case method with test types specified inside std::tuple - MyTypes - 1']
@@ -727,6 +751,9 @@
##teamcity[testStarted name='Unexpected exceptions can be translated']
##teamcity[testFailed name='Unexpected exceptions can be translated' message='Exception.tests.cpp:<line number>|n...............................................................................|n|nException.tests.cpp:<line number>|nunexpected exception with message:|n "3.14000000000000012"']
##teamcity[testFinished name='Unexpected exceptions can be translated' duration="{duration}"]
##teamcity[testStarted name='Unscoped capture outlives scope']
##teamcity[testIgnored name='Unscoped capture outlives scope' message='Message.tests.cpp:<line number>|n...............................................................................|n|nMessage.tests.cpp:<line number>|nexpression failed with messages:|n "i := 1"|n "j := 2"|n "i + j := 3"|n REQUIRE( false )|nwith expansion:|n false|n- failure ignore as test marked as |'ok to fail|'|n']
##teamcity[testFinished name='Unscoped capture outlives scope' duration="{duration}"]
##teamcity[testStarted name='Upcasting special member functions']
##teamcity[testFinished name='Upcasting special member functions' duration="{duration}"]
##teamcity[testStarted name='Usage of AllMatch range matcher']
@@ -815,6 +842,8 @@
##teamcity[testFinished name='benchmark function call' duration="{duration}"]
##teamcity[testStarted name='boolean member']
##teamcity[testFinished name='boolean member' duration="{duration}"]
##teamcity[testStarted name='cat generator']
##teamcity[testFinished name='cat generator' duration="{duration}"]
##teamcity[testStarted name='checkedElse']
##teamcity[testFinished name='checkedElse' duration="{duration}"]
##teamcity[testStarted name='checkedElse, failing']
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -301,6 +301,23 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]"
REQUIRE(config.benchmarkSamples == 200);
}
SECTION("samples must be greater than zero"){
auto result = cli.parse({"test", "--benchmark-samples=0"});
CHECK_FALSE(result);
REQUIRE_THAT(
result.errorMessage(),
ContainsSubstring("Benchmark samples must be greater than 0"));
}
SECTION("samples must be parseable") {
auto result = cli.parse({"test", "--benchmark-samples=abc"});
CHECK_FALSE(result);
REQUIRE_THAT(
result.errorMessage(),
ContainsSubstring("Could not parse 'abc' as benchmark samples"));
}
SECTION("resamples") {
CHECK(cli.parse({ "test", "--benchmark-resamples=20000" }));
@@ -396,9 +413,10 @@ TEST_CASE( "Parsing warnings", "[cli][warnings]" ) {
SECTION( "Combining multiple warnings" ) {
REQUIRE( cli.parse( { "test",
"--warn", "NoAssertions",
"--warn", "UnmatchedTestSpec" } ) );
"--warn", "UnmatchedTestSpec",
"--warn", "InfiniteGenerators" } ) );
REQUIRE( config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec ) );
REQUIRE( config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec | WarnAbout::InfiniteGenerator ) );
}
}
@@ -465,3 +483,80 @@ TEST_CASE( "Parse rng seed in different formats", "[approvals][cli][rng-seed]" )
REQUIRE_FALSE( cli.parse( { "tests", "--rng-seed", seed_string } ) );
}
}
TEST_CASE( "Parsing path filter specs",
"[cli][section-spec]" ) {
using Catch::PathFilter;
Catch::ConfigData config;
auto cli = Catch::makeCommandLineParser( config );
SECTION( "Only section specs leads to old filter behaviour" ) {
auto result = cli.parse( { "tests", "-c", "1", "--section", "a section" } );
REQUIRE( result );
REQUIRE_FALSE( config.useNewPathFilteringBehaviour );
}
SECTION( "Generator specs enable new filter behaviour" ) {
auto result =
cli.parse( { "tests", "-g", "1", "--generator-index", "2" } );
REQUIRE( result );
REQUIRE( config.useNewPathFilteringBehaviour );
}
SECTION("Generator specs do not accept stringish arguments") {
auto result = cli.parse( { "tests", "--generator-index", "foo-baz" } );
REQUIRE_FALSE( result );
}
SECTION( "Generator specs accept star as argument" ) {
auto result = cli.parse( { "tests", "--generator-index", "*" } );
REQUIRE( result );
REQUIRE( config.pathFilters[0] ==
PathFilter( PathFilter::For::Generator, "*" ) );
}
SECTION( "Generator specs do not accept negative numbers" ) {
auto result = cli.parse( { "tests", "--generator-index", "-2" } );
REQUIRE_FALSE( result );
}
SECTION( "Generic path spec enables new filter behaviour" ) {
auto result =
cli.parse( { "tests", "-p", "g:1", "--path-filter", "c:foobar" } );
REQUIRE( result );
REQUIRE( config.useNewPathFilteringBehaviour );
REQUIRE( config.pathFilters[0] ==
PathFilter( PathFilter::For::Generator, "1" ) );
REQUIRE( config.pathFilters[1] ==
PathFilter( PathFilter::For::Section, "foobar" ) );
}
SECTION( "Generic path spec for generator is validated" ) {
auto result = cli.parse( { "tests", "-p", "g:foo-bar" } );
REQUIRE_FALSE( result );
}
SECTION( "Generic path spec without colon is rejected" ) {
auto result1 = cli.parse( { "tests", "-p", "g123" } );
REQUIRE_FALSE( result1 );
auto result2 = cli.parse( { "tests", "-p", "carp" } );
REQUIRE_FALSE( result2 );
}
SECTION( "Using both section and generator filters creates filter stack" ) {
auto result = cli.parse( { "tests",
"--section", "foo-bar",
"--generator-index", "3",
"-g", "123",
"-c", "baz"
});
REQUIRE( result );
REQUIRE( config.pathFilters[0] == PathFilter( PathFilter::For::Section, "foo-bar" ) );
REQUIRE( config.pathFilters[1] == PathFilter( PathFilter::For::Generator, "3" ) );
REQUIRE( config.pathFilters[2] == PathFilter( PathFilter::For::Generator, "123" ) );
REQUIRE( config.pathFilters[3] == PathFilter( PathFilter::For::Section, "baz" ) );
}
SECTION( "Section/generator filters are whitespace trimmed" ) {
auto result = cli.parse( { "tests",
"--section", " untrimmed ",
"--generator-index", " 42 "
});
REQUIRE( result );
REQUIRE( config.pathFilters[0] == PathFilter(PathFilter::For::Section, "untrimmed" ) );
REQUIRE( config.pathFilters[1] == PathFilter(PathFilter::For::Generator, "42" ) );
}
}
@@ -173,7 +173,7 @@ TEST_CASE( "Decomposer checks that the argument is 0 when handling "
}
TEST_CASE( "foo", "[approvals]" ) {
TEST_CASE( "foo", "[approvals][path-filters]" ) {
SECTION( "A" ) {
SECTION( "B1" ) { REQUIRE( true ); }
SECTION( "B2" ) { REQUIRE( true ); }
@@ -181,7 +181,7 @@ TEST_CASE( "foo", "[approvals]" ) {
}
}
TEST_CASE( "bar", "[approvals]" ) {
TEST_CASE( "bar", "[approvals][path-filters]" ) {
REQUIRE( true );
SECTION( "A" ) {
SECTION( "B1" ) { REQUIRE( true ); }
@@ -191,14 +191,14 @@ TEST_CASE( "bar", "[approvals]" ) {
REQUIRE( true );
}
TEST_CASE( "baz", "[approvals]" ) {
TEST_CASE( "baz", "[approvals][path-filters]" ) {
SECTION( "A" ) { REQUIRE( true ); }
auto _ = GENERATE( 1, 2, 3 );
(void)_;
SECTION( "B" ) { REQUIRE( true ); }
}
TEST_CASE( "qux", "[approvals]" ) {
TEST_CASE( "qux", "[approvals][path-filters]" ) {
REQUIRE( true );
SECTION( "A" ) { REQUIRE( true ); }
auto _ = GENERATE( 1, 2, 3 );
@@ -207,7 +207,7 @@ TEST_CASE( "qux", "[approvals]" ) {
REQUIRE( true );
}
TEST_CASE( "corge", "[approvals]" ) {
TEST_CASE( "corge", "[approvals][path-filters]" ) {
REQUIRE( true );
SECTION( "A" ) {
REQUIRE( true );
@@ -219,7 +219,7 @@ TEST_CASE( "corge", "[approvals]" ) {
REQUIRE( true );
}
TEST_CASE("grault", "[approvals]") {
TEST_CASE( "grault", "[approvals][path-filters]" ) {
REQUIRE( true );
SECTION( "A" ) {
REQUIRE( true );
@@ -232,3 +232,33 @@ TEST_CASE("grault", "[approvals]") {
}
REQUIRE( true );
}
TEST_CASE( "garply", "[approvals][path-filters]" ) {
auto i = GENERATE( 1, 10, 100 );
CAPTURE( i );
REQUIRE( true );
}
TEST_CASE( "waldo", "[approvals][path-filters]" ) {
auto i = GENERATE( 1, 10, 100 );
auto j = GENERATE( 2, 20, 200 );
CAPTURE( i, j );
REQUIRE( true );
}
TEST_CASE( "fred", "[approvals][path-filters]" ) {
REQUIRE( true );
SECTION( "A" ) {
auto _ = GENERATE( 0, 1, 2 );
(void)_;
SECTION( "A1" ) { REQUIRE( true ); }
SECTION( "A2" ) { REQUIRE( true ); }
}
SECTION( "B" ) {
auto _ = GENERATE( 0, 1, 2 );
(void)_;
SECTION( "B1" ) { REQUIRE( true ); }
SECTION( "B2" ) { REQUIRE( true ); }
}
}
// More metasyntactic names if needed: plugh, xyzzy, thud
@@ -13,6 +13,7 @@
#include <helpers/range_test_helpers.hpp>
#include <catch2/catch_approx.hpp>
#include <catch2/catch_template_test_macros.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generator_exception.hpp>
#include <catch2/generators/catch_generators_adapters.hpp>
@@ -85,7 +86,7 @@ TEST_CASE("Generators internals", "[generators][internals]") {
filter([](int) { return false; }, values({ 1, 2, 3 })),
Catch::GeneratorException);
}
// Non-trivial usage
SECTION("Out-of-line predicates are copied into the generator") {
auto evilNumber = Catch::Detail::make_unique<int>(2);
@@ -339,6 +340,7 @@ public:
bool next() override {
return false;
}
bool isFinite() const override { return true; }
};
// Avoids -Wweak-vtables
@@ -472,6 +474,7 @@ namespace {
public:
bool const& get() const override;
bool isFinite() const override { return true; }
};
// Avoids -Wweak-vtables
@@ -509,6 +512,7 @@ namespace {
bool const& get() const override;
size_t stringificationCalls() const { return m_stringificationCalls; }
bool isFinite() const override { return true; }
};
// Avoids -Wweak-vtables
@@ -586,3 +590,242 @@ TEST_CASE("from_range(container) supports ADL begin/end and arrays", "[generator
}
}
TEST_CASE( "ConcatGenerator", "[generators][concat]" ) {
using namespace Catch::Generators;
SECTION( "Cat support single-generator construction" ) {
ConcatGenerator<int> c( value( 1 ) );
REQUIRE( c.get() == 1 );
REQUIRE_FALSE( c.next() );
}
SECTION( "Iterating over multiple generators" ) {
ConcatGenerator<int> c( value( 1 ), values( { 2, 3, 4 } ), value( 5 ) );
for ( int i = 0; i < 4; ++i ) {
REQUIRE( c.get() == i + 1 );
REQUIRE( c.next() );
}
REQUIRE( c.get() == 5 );
REQUIRE_FALSE( c.next() );
}
}
namespace {
// Test the default behaviour of skipping generators forward. We do
// not want to use pre-existing generator, because they will get
// specialized forward skip implementation.
class SkipTestGenerator : public Catch::Generators::IGenerator<int> {
std::vector<int> m_elements{ 0, 1, 2, 3, 4, 5 };
size_t m_idx = 0;
public:
int const& get() const override { return m_elements[m_idx]; }
bool next() override {
++m_idx;
return m_idx < m_elements.size();
}
bool isFinite() const override { return true; }
};
}
TEST_CASE( "Generators can be skipped forward", "[generators]" ) {
SkipTestGenerator generator;
REQUIRE( generator.currentElementIndex() == 0 );
generator.skipToNthElement( 3 );
REQUIRE( generator.currentElementIndex() == 3 );
REQUIRE( generator.get() == 3 );
// Try "skipping" to the same element.
generator.skipToNthElement( 3 );
REQUIRE( generator.currentElementIndex() == 3 );
REQUIRE( generator.get() == 3 );
generator.skipToNthElement( 5 );
REQUIRE( generator.currentElementIndex() == 5 );
REQUIRE( generator.get() == 5 );
// Backwards
REQUIRE_THROWS( generator.skipToNthElement( 3 ) );
// Past the end
REQUIRE_THROWS( generator.skipToNthElement( 6 ) );
}
TEST_CASE( "FixedValuesGenerator can be skipped forward",
"[generators][values]" ) {
Catch::Generators::FixedValuesGenerator<int> values( {0, 1, 2, 3, 4} );
REQUIRE( values.currentElementIndex() == 0 );
values.skipToNthElement( 3 );
REQUIRE( values.currentElementIndex() == 3 );
REQUIRE( values.get() == 3 );
values.skipToNthElement( 4 );
REQUIRE( values.currentElementIndex() == 4 );
REQUIRE( values.get() == 4 );
// Past the end
REQUIRE_THROWS( values.skipToNthElement( 5 ) );
}
TEST_CASE( "TakeGenerator can be skipped forward", "[generators][take]" ) {
SECTION("take is shorter than underlying") {
Catch::Generators::TakeGenerator<int> take(
6, Catch::Generators::values( { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } ) );
REQUIRE( take.get() == 0 );
take.skipToNthElement( 2 );
REQUIRE( take.get() == 2 );
take.skipToNthElement( 5 );
REQUIRE( take.get() == 5 );
// This is in the original values, but past the end of the take
REQUIRE_THROWS( take.skipToNthElement( 6 ) );
}
SECTION( "take is longer than underlying" ) {
Catch::Generators::TakeGenerator<int> take(
8, Catch::Generators::values( { 0, 1, 2, 3, 4, 5 } ) );
REQUIRE( take.get() == 0 );
take.skipToNthElement( 2 );
REQUIRE( take.get() == 2 );
take.skipToNthElement( 5 );
REQUIRE( take.get() == 5 );
// This is in the take, but outside of original values
REQUIRE_THROWS( take.skipToNthElement( 6 ) );
}
}
TEST_CASE("MapGenerator can be skipped forward efficiently",
"[generators][map]") {
using namespace Catch::Generators;
int map_calls = 0;
auto map_func = [&map_calls]( int i ) {
++map_calls;
return i;
};
SECTION( "via calls to next()" ) {
MapGenerator<int, int, decltype( map_func )> map_generator(
map_func, values( { 0, 1, 2, 3, 4, 5, 6 } ) );
REQUIRE( map_calls == 0 );
map_generator.next();
map_generator.next();
map_generator.next();
REQUIRE( map_calls == 0 );
REQUIRE( map_generator.get() == 3 );
REQUIRE( map_calls == 1 );
REQUIRE( map_generator.get() == 3 );
REQUIRE( map_calls == 1 );
map_generator.next();
REQUIRE( map_calls == 1 );
}
SECTION("via calls to skipToNthElement()") {
MapGenerator<int, int, decltype( map_func )> map_generator(
map_func, values( { 0, 1, 2, 3, 4, 5, 6 } ) );
REQUIRE( map_calls == 0 );
map_generator.skipToNthElement( 3 );
map_generator.skipToNthElement( 4 );
REQUIRE( map_calls == 0 );
REQUIRE( map_generator.get() == 4 );
REQUIRE( map_calls == 1 );
map_generator.skipToNthElement( 4 );
REQUIRE( map_generator.get() == 4 );
REQUIRE( map_calls == 1 );
map_generator.skipToNthElement( 6 );
REQUIRE( map_calls == 1 );
REQUIRE( map_generator.get() == 6 );
REQUIRE( map_calls == 2 );
REQUIRE_THROWS( map_generator.skipToNthElement( 7 ) );
REQUIRE( map_calls == 2 );
}
}
TEST_CASE( "Generator adapters properly handle isFinite",
"[generators][map][take][chunk][filter][concat]" ) {
using namespace Catch::Generators;
SECTION( "concat generator" ) {
ConcatGenerator<int> finite_cat(
value( 1 ), values( { 2, 3, 4 } ), value( 5 ) );
REQUIRE( finite_cat.isFinite() );
ConcatGenerator<int> infinite_cat(
value( 1 ), random( 1, 10 ), value( 3 ) );
REQUIRE_FALSE( infinite_cat.isFinite() );
}
SECTION( "take generator" ) {
TakeGenerator<int> take_1( 2, values( { 1, 2, 3, 4, 5 } ) );
REQUIRE( take_1.isFinite() );
TakeGenerator<int> take_2( 3, random( 1, 100 ) );
REQUIRE( take_2.isFinite() );
}
SECTION( "chunk generator" ) {
ChunkGenerator<int> finite_chunk( 2, values( { 1, 2, 3, 4, 5 } ) );
REQUIRE( finite_chunk.isFinite() );
ChunkGenerator<int> infinite_chunk( 2, random( 1, 100 ) );
REQUIRE_FALSE( infinite_chunk.isFinite() );
}
SECTION( "map" ) {
auto identity = []( int i ) {
return i;
};
MapGenerator<int, int, decltype( identity )> finite_map(
identity, values( { 1, 2, 3 } ) );
REQUIRE( finite_map.isFinite() );
MapGenerator<int, int, decltype( identity )> infinite_map(
identity, random( 1, 100 ) );
REQUIRE_FALSE( infinite_map.isFinite() );
}
SECTION( "filter" ) {
auto always_true = []( int ) {
return true;
};
FilterGenerator<int, decltype( always_true )> finite_filter(
always_true, values( { 1, 2, 3, 4, 5 } ) );
REQUIRE( finite_filter.isFinite() );
FilterGenerator<int, decltype( always_true )> infinite_filter(
always_true, random( 1, 100 ) );
REQUIRE_FALSE( infinite_filter.isFinite() );
}
}
TEST_CASE( "RepeatGenerator refuses infinite generators",
"[generators][repeat]" ) {
using namespace Catch::Generators;
REQUIRE_THROWS( RepeatGenerator<int>( 2, random( 1, 100 ) ) );
}
TEMPLATE_TEST_CASE( "RandomGenerator reports itself as infinite",
"[generators][random]",
int,
float,
long double) {
REQUIRE_FALSE( Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite() );
}
namespace {
struct NotDefaultConstructible {
int m_i;
explicit NotDefaultConstructible( int i ): m_i( i ){}
};
}
TEST_CASE( "MapGenerator can handle not default constructible types",
"[generators][map]" ) {
using namespace Catch::Generators;
auto map_generator = map( []( int i ) { return NotDefaultConstructible( i ); }, values({1, 2, 3}));
REQUIRE( map_generator.get().m_i == 1 );
REQUIRE( map_generator.next() );
REQUIRE( map_generator.next() );
REQUIRE( map_generator.get().m_i == 3 );
}
@@ -9,6 +9,7 @@
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include <catch2/internal/catch_test_case_tracker.hpp>
#include <catch2/internal/catch_path_filter.hpp>
using namespace Catch;
@@ -22,7 +23,9 @@ Catch::TestCaseTracking::NameAndLocationRef makeNAL( StringRef name ) {
TEST_CASE( "Tracker" ) {
TrackerContext ctx;
ctx.startRun();
ITracker& root = ctx.startRun();
std::vector<PathFilter> dummyFilters;
root.setFilters( &dummyFilters, false );
ctx.startCycle();
@@ -54,7 +54,7 @@ TEST_CASE( "The default listing implementation write to provided stream",
SECTION( "Listing tags" ) {
std::vector<Catch::TagInfo> tags(1);
tags[0].add("fakeTag"_catch_sr);
Catch::defaultListTags(sstream.stream(), tags, false);
Catch::defaultListTags(sstream.stream(), tags, false, Catch::Verbosity::Normal);
auto listingString = sstream.str();
REQUIRE_THAT(listingString, ContainsSubstring("[fakeTag]"s));
@@ -87,7 +87,7 @@ TEST_CASE( "The default listing implementation write to provided stream",
std::vector<Catch::ListenerDescription> listeners(
{ { "fakeListener"_catch_sr, "fake description" } } );
Catch::defaultListListeners( sstream.stream(), listeners );
Catch::defaultListListeners( sstream.stream(), listeners, Catch::Verbosity::Normal );
auto listingString = sstream.str();
REQUIRE_THAT( listingString,
ContainsSubstring( "fakeListener"s ) &&
@@ -381,6 +381,81 @@ TEST_CASE( "TextFlow::AnsiSkippingString substrings properly",
}
}
TEST_CASE( "TextFlow::AnsiSkippingString counts UTF-8 codepoints",
"[TextFlow][ansiskippingstring][approvals]" ) {
SECTION( "2-byte codepoints" ) {
AnsiSkippingString str( "\xC3\xA4\xC3\xB6\xC3\xBC" ); // äöü
CHECK( str.size() == 3 );
}
SECTION( "3-byte codepoints" ) {
AnsiSkippingString str( "\xE4\xB8\xAD\xE6\x96\x87" ); // 中文
CHECK( str.size() == 2 );
}
SECTION( "4-byte codepoints" ) {
// U+1F600 U+1F60E
AnsiSkippingString str( "\xF0\x9F\x98\x80\xF0\x9F\x98\x8E" );
CHECK( str.size() == 2 );
}
SECTION( "mixed ASCII and UTF-8" ) {
AnsiSkippingString str( "a\xC3\xA4" "b" ); // aäb
CHECK( str.size() == 3 );
}
SECTION( "UTF-8 with ANSI escapes" ) {
AnsiSkippingString str( "\033[31m\xC3\xA4\xC3\xB6\xC3\xBC\033[0m" );
CHECK( str.size() == 3 );
}
}
TEST_CASE( "TextFlow::AnsiSkippingString iterates UTF-8 codepoints",
"[TextFlow][ansiskippingstring][approvals]" ) {
// "aäb" = 'a' (0x61), 'ä' (0xC3 0xA4), 'b' (0x62)
std::string text = "a\xC3\xA4" "b";
AnsiSkippingString str( text );
SECTION( "forward iteration has correct count" ) {
int count = 0;
for ( auto it = str.begin(); it != str.end(); ++it ) {
++count;
}
CHECK( count == 3 );
}
SECTION( "backward iteration has correct count" ) {
auto it = str.end();
int count = 0;
while ( it != str.begin() ) {
--it;
++count;
}
CHECK( count == 3 );
}
SECTION( "substring preserves full UTF-8 bytes" ) {
auto a = str.begin();
auto b = str.begin();
++b; // past 'a'
++b; // past 'ä'
CHECK( str.substring( a, b ) == "a\xC3\xA4" );
}
}
TEST_CASE( "TextFlow::Column wraps UTF-8 text correctly",
"[TextFlow][column][approvals]" ) {
// "äöü äöü äöü" = 11 codepoints, 17 bytes
Column col( "\xC3\xA4\xC3\xB6\xC3\xBC \xC3\xA4\xC3\xB6\xC3\xBC \xC3\xA4\xC3\xB6\xC3\xBC" );
SECTION( "width=8" ) {
col.width( 8 );
// 7 visible codepoints "äöü äöü" fit, then wrap
REQUIRE( as_written( col ) ==
"\xC3\xA4\xC3\xB6\xC3\xBC \xC3\xA4\xC3\xB6\xC3\xBC\n"
"\xC3\xA4\xC3\xB6\xC3\xBC" );
}
SECTION( "width=80" ) {
col.width( 80 );
REQUIRE( as_written( col ) ==
"\xC3\xA4\xC3\xB6\xC3\xBC \xC3\xA4\xC3\xB6\xC3\xBC \xC3\xA4\xC3\xB6\xC3\xBC" );
}
}
TEST_CASE( "TextFlow::Column skips ansi escape sequences",
"[TextFlow][column][approvals]" ) {
std::string text = "\033[38;2;98;174;239m\033[38;2;198;120;221mThe quick brown \033[38;2;198;120;221mfox jumped over the lazy dog\033[0m";
+10 -9
View File
@@ -6,15 +6,6 @@
// SPDX-License-Identifier: BSL-1.0
#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wpadded"
// Wdouble-promotion is not supported until 3.8
# if (__clang_major__ > 3) || (__clang_major__ == 3 && __clang_minor__ > 7)
# pragma clang diagnostic ignored "-Wdouble-promotion"
# endif
#endif
#include <catch2/catch_approx.hpp>
#include <catch2/catch_test_macros.hpp>
@@ -24,6 +15,16 @@ using Catch::Approx;
#include <limits>
#include <cstdint>
#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wpadded"
// Wdouble-promotion is not supported until 3.8
# if ( __clang_major__ > 3 ) || \
( __clang_major__ == 3 && __clang_minor__ > 7 )
# pragma clang diagnostic ignored "-Wdouble-promotion"
# endif
#endif
namespace {
struct TestData {
@@ -281,6 +281,11 @@ TEST_CASE("#1913 - GENERATEs can share a line", "[regression][generators]") {
REQUIRE(i != j);
}
#if defined( __clang__ )
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wunreachable-code-return"
#endif
namespace {
class test_generator : public Catch::Generators::IGenerator<int> {
public:
@@ -296,6 +301,7 @@ namespace {
}
auto next() -> bool override { return false; }
auto isFinite() const -> bool override { return true; }
};
static auto make_test_generator()
@@ -305,6 +311,10 @@ namespace {
} // namespace
#if defined( __clang__ )
# pragma clang diagnostic pop
#endif
TEST_CASE( "#2615 - Throwing in constructor generator fails test case but does not abort",
"[!shouldfail][regression][generators]" ) {
// this should fail the test case, but not abort the application
@@ -321,3 +331,16 @@ TEST_CASE( "GENERATE can combine literals and generators", "[generators]" ) {
random( -100, 100 ) ) ) );
REQUIRE( i % 2 == 0 );
}
TEST_CASE( "cat generator", "[generators][concat]" ) {
SECTION("Simple usage") {
const int input = GENERATE( cat( value( 0 ) ), cat( value( 1 ), value( 2 ) ) );
REQUIRE( input < 3 );
}
SECTION( "Used in map" ) {
const int input = GENERATE(
map( []( int i ) { return i * 2; },
cat( value( 1 ), take( 4, random( 10, 10'000'000 ) ) ) ) );
REQUIRE( input % 2 == 0 );
}
}

Some files were not shown because too many files have changed in this diff Show More