Commit Graph

477 Commits

Author SHA1 Message Date
Martin Hořeňovský
b5547f2ef6 Passthrough stdout/err in multireporter's partial test end
This should provide the same overall stdout/err, but the new
output should feel "faster" for test cases that are entered
and exited multiple times (e.g. due to generators).
2022-01-01 14:20:23 +01:00
Martin Hořeňovský
93882f7fab Support '-' as output path for stdout 2022-01-01 14:16:12 +01:00
Martin Hořeňovský
fae0be25b3 Improve error handling in parsing reporter specs 2022-01-01 14:16:11 +01:00
Martin Hořeňovský
8baf9c05a3 Add more unit tests
* Call order of listeners/reporters in multireporter
* Adding listeners/reporters properly updates reporter preferences
2022-01-01 14:10:52 +01:00
Martin Jeřábek
ccd67b293d Add support for multiple parallel reporters
This requires a bunch of different changes across the reporter
subsystem.

* We need to handle multiple reporters and their differing
  preferences in `ListeningReporter`, e.g. what to do when
  we mix reporters that capture and don't capture stdout.
* We need to change how the reporter is given output and
  how we parse reporter's output destination from CLI.
* Approval tests need to handle multireporter option
2022-01-01 14:02:23 +01:00
Martin Hořeňovský
6b55f5d780
Don't send full stdout so far to testCasePartialEnded event 2022-01-01 12:21:41 +01:00
Martin Jeřábek
f0a89b7345
Add ops == and != for Optional 2021-12-29 16:58:16 +01:00
Martin Hořeňovský
45577a1f4c
Refactor implementation of case-insensitivity in tags
By not materializing the lower cased tags ahead of time, we
save allocations at the cost of worsened performance when comparing
two tags.

Since there are rarely many tags, and commonly they are not
compared even if present, this is almost always a win. The new
implementation also improves the robustness of the code
responsible for handling tags in a case-insensitive manner.
2021-12-28 00:20:55 +01:00
Martin Hořeňovský
cbb6764fb1
Add CaseInsensitiveEqualTo comparison type 2021-12-26 18:54:47 +01:00
Martin Hořeňovský
156e6fdfa9
CaseInsensitiveLess takes args as StringRefs 2021-12-26 00:52:52 +01:00
Martin Hořeňovský
187bf6db2b
Split out CaseInsensitiveCmp into its own file 2021-12-26 00:35:46 +01:00
Martin Hořeňovský
3cc0c033e4
Allow enabling multiple warnings in one invocation 2021-12-18 20:50:05 +01:00
Martin Hořeňovský
840acedf62
Implement warning for unmatched test specs 2021-12-18 20:50:03 +01:00
Martin Hořeňovský
9f2dca5384
Exit with non-0 return code if no tests were run
A new flag, `--allow-running-no-tests` was added to override this
behaviour if exit code of 0 was desired.

This change also made `-w NoTests` obsolete, and so it has been
removed.
2021-12-18 20:50:00 +01:00
Martin Hořeňovský
602e484f02
Rename reportInvalidArguments -> reportInvalidTestSpec
This is has been what it actually does for a long time, but it
has not been renamed earlier due to API compatibility.
2021-12-18 20:49:50 +01:00
Martin Hořeňovský
08939cc8bb
Error out early if invalid test specs are provided 2021-12-18 20:49:47 +01:00
Martin Hořeňovský
3bfe900bbc
Move shard logic check after help flag check 2021-12-18 20:49:44 +01:00
Martin Hořeňovský
dcf9479c85
Counts internally use uint64_t instead of size_t
This ensures that even for 32 bit platforms, the assertion count
should not plausibly overflow.
2021-12-06 20:42:51 +01:00
Martin Hořeňovský
c49faa62dd
Let users of amalgamated distribution override the default main
Closes #2324
2021-12-02 13:49:16 +01:00
Martin Hořeňovský
153965a655
Delete useless MatcherMethod base class
All of its functionality can be moved into the `MatcherBase` class,
simplifying the code a bit and removing a warning about class with
virtual member functions but no virtual destructor.

Closes #2182 as it is no longer relevant.
2021-11-26 00:38:13 +01:00
Martin Hořeňovský
b9baae6d93
Cleanup StringRef impl a bit 2021-11-23 23:16:46 +01:00
Martin Hořeňovský
c95072408f
Add catch_sharding.hpp to CML 2021-11-23 23:16:17 +01:00
Martin Hořeňovský
8cb8f0b08b
Sweep out some Wsign-conversion warnings 2021-11-23 23:16:08 +01:00
SketchyLizard
2db1cf3404 Fix template args to avoid conversion warnings
Fix avoids a warning about sign conversion when included from a file compiled with -Werror=sign-conversion.
2021-11-20 21:38:01 +01:00
Morwenn
f41d761674
Add STATIC_CHECK and STATIC_CHECK_FALSE (#2318) 2021-11-15 00:28:27 +01:00
Martin Hořeňovský
edc2f6e8a3
Further refactoring of StreamingReporterBase 2021-11-14 11:41:29 +01:00
Martin Hořeňovský
b2ac27423a
Cleanup visibility in StreamingReporterBase 2021-11-14 11:41:27 +01:00
Martin Hořeňovský
a754cb9062
Make TestRunInfo constexpr 2021-11-14 11:41:26 +01:00
Martin Hořeňovský
5f38cc39fa
JUnit/SonarQube reporters use base's stream member 2021-11-14 11:41:25 +01:00
Martin Hořeňovský
b892ab133c
Cleanup visibility in CumulativeReporterBase 2021-11-14 11:41:24 +01:00
Martin Hořeňovský
0c9fe16537
Opt out JUnit/SonarQube reporter from expanding passing assertions
Closes #1966
2021-11-14 11:27:45 +01:00
Martin Hořeňovský
d02ea5adee
Cumulative reporter base can be customized to not expand assertions 2021-11-14 11:27:44 +01:00
Martin Hořeňovský
4d9bfb2951
Avoid static analysis warning in Approx 2021-11-14 11:27:42 +01:00
Martin Hořeňovský
9200b4078b
Move reporter_registrars.hpp to reporters/ 2021-11-10 23:52:59 +01:00
Martin Hořeňovský
6603f1d972
Use case in names of default reporters 2021-11-10 23:32:01 +01:00
Martin Hořeňovský
62d8913d67
Cumulative reporter base records benchmark results 2021-11-09 11:52:50 +01:00
Martin Hořeňovský
8780425385
Make reporter lookup case insensitive, registration case preserving
Previously registration was case preserving, but lookup used
lowercased reporter name, so a reporter whose name contained
upper case character could not be requested by the user.
2021-11-09 11:50:03 +01:00
Martin Hořeňovský
7800fe9708
Lift toLower(char) to header 2021-11-09 11:44:54 +01:00
Martin Hořeňovský
141e384c60
Fix missing include in reporter_registrars.hpp 2021-11-08 11:32:27 +01:00
Martin Hořeňovský
f1239b2045 Add doxygen doccomments to IStreamingReporter 2021-11-05 14:24:22 +01:00
Martin Hořeňovský
912df7df35
Fix quadratic runtime when linebreaking strings without newlines
The problem was that every line would iterate from current line
start position to the end of the string, looking for a newline
to break on, leading to accidentally quadratic runtime. With this
change, the code only ever searches up to the current line's
length and not more.

Credit to @jorgenpt for the fix suggestion.

Closes #2315
2021-11-04 00:23:56 +01:00
Martin Hořeňovský
70c4ec78fb
Improve comments and names in TextFlow::Column 2021-11-01 19:14:37 +01:00
Martin Hořeňovský
455ae0c561 Typedef Column::iterator as Column::const_iterator not vice versa 2021-10-31 13:01:41 +01:00
Martin Hořeňovský
2520ad4b6e Return const_iterator from Column::begin/end const
This is what should normally happen, even if it does not change
anything given that `Column::const_iterator` is currently a typedef
for `Column::iterator`.
2021-10-31 12:59:00 +01:00
Martin Hořeňovský
e539e1cb52
Move strings in Clara's result type 2021-10-29 23:04:24 +02:00
Martin Hořeňovský
12d14a3c63
Add support for multiply calling lambda parsers in Clara
Previously a lambda parser in Clara could only be invoked once,
even if it internally was ok with being invoked multiple times.

With this change, a lambda parser can mark itself as `accept_many`,
in which case it will be invoked multiple times if the appropriate
flag was supplied multiple times by the user.
2021-10-27 20:15:28 +02:00
Martin Hořeňovský
f17725a186
Split void_type into its own header and rename it to void_t 2021-10-27 20:01:13 +02:00
Martin Hořeňovský
5ac1ffe9ee Improve shardIndex/Count cli argument parsing 2021-10-27 17:24:30 +02:00
Ben Dunkin
3087e19cc7 Allow test sharding for e.g. Bazel test sharding feature
This greatly simplifies running Catch2 tests in single binary
in parallel from external test runners. Instead of having to
shard the tests by tags/test names, an external test runner
can now just ask for test shard 2 (out of X), and execute that
in single process, without having to know what tests are actually
in the shard.

Note that sharding also applies to test listing, and happens after
tests were ordered according to the `--order` feature.
2021-10-27 17:24:30 +02:00
Martin Hořeňovský
6456ee8b01
Return Clara parsing error message by const-ref 2021-10-27 15:10:52 +02:00