Commit Graph

3926 Commits

Author SHA1 Message Date
Martin Hořeňovský
4113a12c69 Fix Wreserved-identifier for UDLs in Catch2
See #578
2021-08-19 19:15:46 +02:00
Martin Hořeňovský
edad4d0af7 Prefer _t over ::type form for std type traits 2021-08-19 00:21:13 +02:00
Martin Hořeňovský
88c27ffaf2 Mention CATCH_MOVE and CATCH_FORWARD in contributing docs 2021-08-16 16:22:21 +02:00
Martin Hořeňovský
d2ee7100d2 Replace uses of std::move and std::forward with macros
This improves the SelfTest build times by about 3% (measured
with Clang 10 on random Linux box I had lying around).
2021-08-16 16:22:19 +02:00
Martin Hořeňovský
03ce304102 Add std::move/std::forward replacement macros
Using the `CATCH_MOVE` and `CATCH_FORWARD` macros instead of the
`std::move` and `std::forward<T>` utility functions can improve
compilation times and debug build's performance, and thus will
be preferred going forward.
2021-08-16 16:22:16 +02:00
Geoffrey M Gunter
7040f03b54 Fix typo in docs/matchers.md
There were a few instances in matchers.md where header files erroneously
had a .h file extension instead of .hpp
2021-08-16 15:19:49 +02:00
Martin Hořeňovský
1554251f97 Fix typo in docs/cmake-integration.md 2021-08-11 22:57:36 +02:00
Martin Hořeňovský
2b54f1e7a6 Remove superfluous catch_enforce include from complete_invoke
Also added missing transitive include to `catch_benchmark.hpp`.
2021-08-11 22:52:04 +02:00
Martin Hořeňovský
2c84854b90 Use unique_ptr to hold Environment measurements in benchmarking 2021-08-11 22:52:01 +02:00
Martin Hořeňovský
3579c055c8 Use Detail::make_unique<T> in more places 2021-08-11 22:51:59 +02:00
Martin Hořeňovský
3ec63324a8 Replace owning naked IStream pointers with unique_ptrs 2021-08-11 22:51:57 +02:00
Martin Hořeňovský
7d0770adf2 Merge pull request #2269 from numaru/feature/rename-contrib-in-docs
Rename contrib/ to extras/ in the docs
2021-08-11 00:26:38 +02:00
Kin Numaru
74db06199b Rename contrib/ to extras/ in the docs
The directory has been renamed in 918aa32 but the doc was not updated
yet.
2021-08-10 10:41:16 +02:00
Martin Hořeňovský
52a3144145 Update users docs 2021-08-08 23:42:24 +02:00
Martin Hořeňovský
a62974eb6a Update why-catch.md 2021-08-08 23:42:17 +02:00
Martin Hořeňovský
a0d84654dd Add GitHub Actions badges to README 2021-08-07 21:18:00 +02:00
Martin Hořeňovský
557e5118f1 Remove TravisCI badge 2021-08-07 16:25:22 +02:00
Martin Hořeňovský
0a3f511cfe Fix inconsistencies in reporting benchmarking failures
With these changes, all these benchmarks
```cpp
BENCHMARK("Empty benchmark") {};
BENCHMARK("Throwing benchmark") {
    throw "just a plain literal, bleh";
};
BENCHMARK("Asserting benchmark") {
    REQUIRE(1 == 2);
};
BENCHMARK("FAIL'd benchmark") {
    FAIL("This benchmark only fails, nothing else");
};
```

report the respective failure and mark the outer `TEST_CASE` as
failed. Previously, the first two would not fail the `TEST_CASE`,
and the latter two would break xml reporter's formatting, because
`benchmarkFailed`, `benchmarkEnded` etc would not be be called
properly in failure cases.
2021-08-07 15:16:11 +02:00
Martin Hořeňovský
9ef510b769 Remove unused travis yaml 2021-08-07 15:09:50 +02:00
Martin Hořeňovský
1b1f3a88bc Don't debug log empty strings 2021-08-06 11:38:54 +02:00
Martin Hořeňovský
02ab64da2e Cleanup ExceptionTranslatorRegistry::translateActiveException 2021-08-06 00:56:09 +02:00
Martin Hořeňovský
77df08b44d Better arg name for run_for_at_least 2021-08-06 00:55:31 +02:00
Martin Hořeňovský
79c2daa4a0 Update tutorial docs 2021-08-03 13:53:44 +02:00
Martin Hořeňovský
1e0dc61d16 Update CMake integration documentation 2021-07-31 21:46:11 +02:00
Martin Hořeňovský
02e5951f11 Add major changes and their motivation to v2 -> v3 migration docs
Closes #2135
2021-07-29 23:19:48 +02:00
Martin Hořeňovský
1ecc79bb56 Fix superfluous uppercase C in matcher docs 2021-07-28 23:38:27 +02:00
Martin Hořeňovský
73cae40a90 Fix WithinULP matcher factory name in docs 2021-07-28 23:37:23 +02:00
Robert Andrzejuk
6c4c961207 Update migrate-v2-to-v3.md
#2135 Adding "Changes overview" to "Migrating from v2 to v3" doc
2021-07-28 23:18:50 +02:00
Martin Hořeňovský
340a61af50 Always use 'Detail' for the detail namespace 2021-07-27 21:45:27 +02:00
Martin Hořeňovský
3d1cf95b32 Fix ulp distance calculation for numbers with different signs
This is a simplification of the fix proposed in #2152, with the
critical function split out so that it can be tested directly,
without having to go through the ULP matcher.

Closes #2152
2021-07-27 21:04:41 +02:00
Vishesh Yadav
6f21a3609c Update CMake doc for automatic test registration
`FetchContent` doesn't include `contrib` directory as part of `CMAKE_MODULE_PATH`. This results into `include(Catch)` to fail. This patch just updates the documentation describing how to do include the path, so the new users don't have to figure this out themselves.

Source: https://github.com/catchorg/Catch2/issues/2103#issuecomment-730626324
2021-06-30 00:12:36 +02:00
Martin Hořeňovský
bf61a418cb Remove the ill-conceived compilation perf tests using real tests 2021-06-20 19:15:02 +02:00
Martin Hořeňovský
849002aec0 Move specialization for global op<< to the proper place
In v2 it was placed in a very central header due to the way it was
stitched together. Now that we don't do that, we can move it to the
proper place, removing the potential for confusion given that the
original header was split apart and renamed.
2021-06-20 19:14:56 +02:00
Martin Hořeňovský
4eb9af51af Use non-reserved identifiers for test autoregistration objects 2021-06-19 23:15:11 +02:00
Martin Hořeňovský
78e4fbdb12 Use non-reserved identifiers for BENCHMARK macro implementation 2021-06-19 23:14:20 +02:00
Martin Hořeňovský
a7533707ff Use unique_ptr for passing around exception translators 2021-06-19 20:57:06 +02:00
Martin Hořeňovský
28a33497be Move extractClassName to the single calling TU and make it static 2021-06-18 23:39:07 +02:00
Martin Hořeňovský
70f5392210 Devirtualize more things in trackers 2021-06-18 10:35:02 +02:00
Martin Hořeňovský
61461dfd1d Move default impls of isFooTracker to the interface 2021-06-18 10:35:01 +02:00
Martin Hořeňovský
c064322a9d Devirtualize ITracker::parent 2021-06-18 10:34:58 +02:00
Martin Hořeňovský
a14d67cace ITracker::parent returns pointer not reference
We were already using it mostly to get pointers rather than
references, so this makes it make more sense.
2021-06-18 10:34:55 +02:00
Martin Hořeňovský
4ce8a23edd Tiny cleanups in tracking 2021-06-18 10:34:43 +02:00
Martin Hořeňovský
c1b59b7071 Mark JUnit reporter's internal members as private 2021-06-18 00:00:24 +02:00
AlCash07
c77ba5314a Fix decomposing in presence of universal ADL-found operators
Closes #2121
2021-06-08 23:36:06 +02:00
Martin Hořeňovský
65c9a1d31a Add test for comparing immovable types 2021-06-07 20:05:03 +02:00
Martin Hořeňovský
fa31d58934 Don't use removed-in-C++20 allocator parts in CustomAllocator tests 2021-06-07 17:44:39 +02:00
Martin Hořeňovský
9ac8cad2d1 Merge pull request #2244 from jbadwaik/devel
Disable CATCH_INTERNAL_IGNORE_BUT_WARN for NVHPC Compilers
2021-06-07 15:22:53 +02:00
Jayesh Badwaik (FZ Juelich)
c71f42cc29 Disable CATCH_INTERNAL_IGNORE_BUT_WARN for NVHPC Compilers
- NVHPC's implementation of `__builtin_constant_p` has a bug which
    results in calls to the immediately evaluated lambda expressions to be
    reported as unevaluated lambdas.

    https://developer.nvidia.com/nvidia_bug/3321845.

  - Hence, we disable CATCH_INTERNAL_IGNORE_BUT_WARN for NVHPC Compilers
2021-06-07 12:28:16 +02:00
Martin Hořeňovský
e6da4e10ae Use make_unique instead of unique_ptr(new T) 2021-06-01 00:17:22 +02:00
Martin Hořeňovský
816f69416b Use TestCaseInfo in tests directly 2021-06-01 00:17:19 +02:00