Commit Graph

4181 Commits

Author SHA1 Message Date
Martin Hořeňovský
6aa56c70e2
Mention BUILD.bazel in contributing docs for CATCH_CONFIG* 2022-11-12 22:08:23 +01:00
Rosen Penev
1cd86c09a2 meson: update minimum version
include_directories of type string began being supported in meson 0.50.0. New warning with meson 0.64
2022-11-12 14:32:01 +01:00
Emery Goss (AIVAS-v2:Ubuntu-20.04)
b980d408b1 Make MatcherGenericBase copy constructor take const parameter. 2022-11-12 12:22:35 +01:00
Vertexwahn
41990e0fe6
Fix Bazel build (#2563)
Also adds a CI job for Bazel build to avoid future breakage.
2022-11-11 16:54:22 +01:00
Robert Blaauboer
b65c0e27e9 Make ScopedMessage in INFO logging macro const
If users have const correctness checks enabled then this would flagged forcing users to wrap the INFO macro themselves or forego using it altogether.
2022-11-10 18:56:20 +01:00
Martin Hořeňovský
6e77e16ea8
Remove unused StringRef argument from MatchExpr
Apart from cleaning up the code, this change also improves the
compilation time of `UsageTests/Matchers.tests.cpp` by about 2%.
2022-11-10 15:25:51 +01:00
Martin Hořeňovský
943c6e3dee
Add version field to the XML reporter output
We start at version 2, with version 1 being taken up by the output
from Catch2 v2.
2022-11-10 12:04:51 +01:00
Martin Hořeňovský
066cc51ce6
Document adding new CATCH_CONFIG options to contributing.md 2022-11-09 16:33:47 +01:00
Masashi Fujita
b7f4a2efb8
Add support for PlayStation platforms (#2562)
* Add new `CATCH_CONFIG` option for using `std::getenv`, because PS does not support env vars
* Add PS to platforms that have disabled posix signals.
* Small workaround for PS toolchain bug that prevents it from compiling `std::set` with lambda based comparator.
2022-11-09 14:47:55 +01:00
Martin Hořeňovský
f8006aa6d4
More cleanups for src/CMakeLists.txt
* Sort source file lists
* Better source_group for cleanup in IDEs
* More uniform source lists
2022-11-09 13:12:42 +01:00
Martin Hořeňovský
fdea5a52c2
Improve the .clang-format file a bit
* add include sorting and grouping
* allow some short blocks to be on a single line
2022-11-07 23:14:29 +01:00
Martin Hořeňovský
297a17593f
Cleanup the helper scripts
* Remove from __future__ import print_function, because we
  no longer support Python2.
* Clean out unused parts of tools/scripts/scriptCommon.py
* Move appveyorMergeCoverageScript to Python3
* Update user reporting in *release scripts
* Cleanup module imports
2022-11-06 21:23:16 +01:00
Martin Hořeňovský
d1ef461471
Update basic cost estimates for approvals/benchmarks 2022-11-06 21:23:03 +01:00
Martin Hořeňovský
0c75caf77b
Don't write ApprovalTests' temporary files into the source tree
This has two effects:
 1) This significantly improves the performance of ApprovalTests
    run in WSL, because running the massively multi-reporter
    test would cause lots of small and parallel writes across the
    WSL-Windows FS boundary, completely mudering performance.

 2) ApprovalTests can be run from multiple build dirs in parallel,
    as long as they do not fail. However, if they do fail,
    the multiple runs will still step on each other toes when
    writing the unapproved files for user.
2022-11-06 00:11:38 +01:00
Martin Hořeňovský
3b139ae51a
Decomposer checks for 0 when assuming an int arg was 0 literal 2022-11-05 20:43:52 +01:00
Martin Hořeňovský
5f9d4ef331
Move throwing test failure exceptions into a helper 2022-11-05 00:22:45 +01:00
Martin Hořeňovský
ec59cd8736
Support decomposing types that only compare with literal 0
This is primarily done to support new `std::*_ordering` types,
but the refactoring also supports any other type with this
property.

The compilation overhead is surprisingly low. Testing it with
clang on a Linux machine, compiling our SelfTest project takes
only 2-3% longer with these changes than it takes otherwise.

Closes #2555
2022-11-04 19:24:44 +01:00
Martin Hořeňovský
d7f8c36e4c
Add traits for checking whether types are comparable 2022-11-04 19:24:42 +01:00
Martin Hořeňovský
b3dbd83da2
Add test for comparing pointers to NULL with != 2022-11-04 19:24:39 +01:00
Martin Hořeňovský
0a1b0ae9d1
Meson build fixes
* Add missing files to `tests/meson.build`
* Rename meson build workflows to be more easily identifiable
2022-11-04 19:24:36 +01:00
Martin Hořeňovský
272bed081e
Set CMAKE_CXX_STANDARD_REQUIRED=ON in Github Action builds 2022-10-29 21:05:02 +02:00
Martin Hořeňovský
82cec69e93
Don't set C++ standard in CMakeLists for tests 2022-10-29 21:04:58 +02:00
Roger Standridge
b56c474260 Update comparing-floating-point-numbers.md 2022-10-29 12:42:45 +02:00
Martin Hořeňovský
12b4390169
Fix license rebase error in test helpers 2022-10-28 14:39:56 +02:00
Martin Hořeňovský
3b40cf13eb
Split out parseTestSpec into test-only helpers 2022-10-28 13:27:46 +02:00
Martin Hořeňovský
223d8d6382
Merge pull request #2557 from ltoenning/fix/license_file_ref
Fix references to license file
2022-10-28 13:04:29 +02:00
Lars Toenning
f1084fb309
Fix references to license file
The license file was renamed with 6a502cc2f5
2022-10-28 11:30:15 +02:00
Martin Hořeňovský
d41da10c54
Change reporters to report filters in round-trippable format 2022-10-27 20:46:59 +02:00
Martin Hořeňovský
d2294ad9b6
Add test for round-tripping serialization of unmatched test specs 2022-10-27 19:11:20 +02:00
Martin Hořeňovský
e19ed221bd
Provide round-tripping serialization for TestSpec 2022-10-27 18:23:59 +02:00
Martin Hořeňovský
c6dfeb5e7d
Split tests for TestSpec into its own file
They also got slapped with the `[approvals]` tag in the process,
because we have too many approval tests and want less of them,
and these particular tests don't bring much value.

Related to #2090
2022-10-26 21:03:56 +02:00
Martin Hořeňovský
17fac854ae
Add test checking that reporters report filters 2022-10-26 11:26:10 +02:00
Martin Hořeňovský
ffa152095c
Report used filters in the SonarQube reporter 2022-10-26 00:05:00 +02:00
Martin Hořeňovský
0ce8c25566
Report used filters in the TAP reporter 2022-10-26 00:04:49 +02:00
Philip Salzmann
6185d0cc0a Use console reporter's totals summary for compact reporter
This changes the compact reporter's summary of test run totals to use
the same format as the console reporter. This means that while output is
no longer on a single line (two instead), it now includes totals for
`failedButOk` test cases and assertions, which were previously missing.
2022-10-25 20:02:26 +02:00
autoantwort
8ce92d2c72
CatchMiscFunctions.cmake: Use PRIVATE for target_compile_options (#2553)
With the changes to how `-ffile-prefix-map` is detected, Catch2 started propagating the flag to its dependents, which isn't the desired behaviour, the normalization should only apply to Catch2's impl.
2022-10-24 18:26:40 +02:00
Martin Hořeňovský
a43f67962e
Refactor parsing of shard index/count in cmdline handling
This worsens the message for negative numbers a bit, but
simplifies the code enough that this is still a win.
2022-10-23 00:10:05 +02:00
Martin Hořeňovský
f1361ef624
Refactor how the RNG seed is parsed when handling cmdline 2022-10-22 22:18:30 +02:00
Martin Hořeňovský
d1e7544e9f
Simplify handling of environment in Bazel's support 2022-10-22 22:18:27 +02:00
Martin Hořeňovský
3fed2307e7
Add Detail::getEnv wrapper that compiles under UWP
Under UWP it will always return nullptr, so UWP will essentially
behave as if the environment was just empty.
2022-10-22 22:18:24 +02:00
Martin Hořeňovský
2d0dcc36e8
Add Bazel support to the documentation 2022-10-21 10:53:55 +02:00
Martin Hořeňovský
80d58a791d
Add support for Bazel's sharding env variables
Closes #2491
2022-10-21 10:53:53 +02:00
Martin Hořeňovský
d7341b5dc1
Add parseUInt utility function
There is an increasing number of places where Catch2 wants to parse
strings into numbers, but being stuck in C++14 world, we do not
have good stdlib facilities to do this (`strtoul` and `stoul`
are both bad).
2022-10-21 10:53:50 +02:00
Martin Hořeňovský
38d926090a
Tiny fix for testBazelReporter.py 2022-10-20 21:34:35 +02:00
Martin Hořeňovský
9d08689845
Add support for Bazel's TESTBRIDGE_TEST_ONLY env var
Closes #2490
2022-10-20 21:34:32 +02:00
Martin Hořeňovský
afc017ef52
Rename provideBazelReporterOutput -> enableBazelEnvSupport
The new name better reflects that we are adding support for more
Bazel environment variables.
2022-10-20 21:34:27 +02:00
Martin Hořeňovský
fb68bb0bd5
Fix microbenchmark example in the main readme.md 2022-10-20 21:34:25 +02:00
Martin Hořeňovský
77f7c0104d
Fix fibonacci impl in benchmark tests
The previous implementation was always 1 number ahead. Fixing this
is not important at all, but it was bugging me.
2022-10-18 10:44:18 +02:00
Martin Hořeňovský
be060cde44
Update README.md
* Add usage examples to the introduction
* Mention that v3 has been released
2022-10-17 21:47:22 +02:00
Martin Hořeňovský
5df88da16e
3.1.1 2022-10-17 19:57:58 +02:00