Commit Graph

86 Commits

Author SHA1 Message Date
Alex Merry 966d361551 Improve formatting of test specification docs
The existing formatting created one-element lists separated by paragraphs, when it would make more sense to have the paragraphs that are providing more information about one of those list entries be part of the list entry itself.

I think this makes the documentation easier to read in both markdown and html form, and should also improve the structure for assistive technologies.
2023-10-24 16:01:56 +02:00
Martin Hořeňovský 2a19ae16b8
Rewrite commandline test spec docs
Closes #2738
2023-08-30 16:18:34 +02:00
Martin Hořeňovský bf6a15a69a
Rewrite -# docs 2023-02-17 15:55:21 +01:00
Martin Hořeňovský 16f48f8c7c
Add SUCCEED and FAIL docs next to SKIP docs 2023-01-12 20:38:58 +01:00
Philip Salzmann d548be26e3
Add new SKIP macro for skipping tests at runtime (#2360)
* Add new SKIP macro for skipping tests at runtime

This adds a new `SKIP` macro for dynamically skipping tests at runtime.
The "skipped" status of a test case is treated as a first-class citizen,
like "succeeded" or "failed", and is reported with a new color on the
console.

* Don't show "skipped assertions" in console/compact reporters

Also extend skip tests to cover a few more use cases.

* Return exit code 4 if all test cases are skipped

* Use LightGrey for the skip colour

This isn't great, but is better than the deep blue that was borderline
invisible on dark backgrounds. The fix is to redo the colouring
a bit, including introducing light-blue that is actually visible.

* Add support for explicit skips in all reporters

* --allow-running-no-tests also allows all tests to be skipped

* Add docs for SKIP macro, deprecate IEventListener::skipTest

Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
2023-01-12 15:01:47 +01:00
TrueWodzu cdf604f30e Update command-line.md
Typo in "--list-reporter" link, should be "--list-reporters"
2023-01-08 19:37:16 +01:00
Martin Hořeňovský d8619f076b
Fixup shard index docs
Closes #2547
2022-10-16 17:00:29 +02:00
tocic dea1a6abd9
Fix typos in docs (#2514) 2022-09-09 16:00:39 +02:00
Martin Hořeňovský 686468d185
Explain TU as translation unit where appropriate 2022-09-03 22:22:10 +02:00
Martin Hořeňovský 6f9f1465c3
Shorten lines in sharding docs 2022-06-22 00:12:16 +02:00
Sergio Losilla 231c58a048
Add table with verbosity levels (missing --list-listeners) (#2443)
Co-authored-by: Sergio Losilla <sergio.losilla@nt-bnct.com>
Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
2022-06-02 21:50:51 +02:00
Martin Hořeňovský 605a34765a
v3.0.1 2022-05-17 22:13:36 +02:00
Martin Hořeňovský 5a49285e9c
Add --list-listeners option 2022-05-10 20:57:59 +02:00
Martin Hořeňovský 9dc229693d
Document the stability guarantees of '--order rand' option 2022-04-25 21:45:50 +02:00
Martin Hořeňovský db57a4956f
Fixup ToC in command-line.md 2022-04-25 21:39:48 +02:00
Daniel Feist 291b35b389
Added --skip-benchmarks command-line option. (#2408)
Closes #2392

Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
2022-04-23 23:14:49 +02:00
Martin Hořeňovský 46b3f7ee5f
Document magic %-prefixed streams 2022-04-07 12:50:18 +02:00
Martin Hořeňovský f9f4e58dfb
Add missing version placeholder to --colour-mode cli option docs 2022-04-07 12:50:14 +02:00
Martin Hořeňovský 423e1d2ebb
Integrate the new reporter specs into Catch2
This means that the CLI interface now uses the new key-value oriented
reporter spec, the common reporter base creates the colour implementation
based on the reporter-specific configuration, and it also stores the
custom configuration options for each reporter instance.

Closes #339 as it allows per-reporter forcing of ansi colour codes.
2022-04-07 12:50:08 +02:00
Martin Hořeňovský 1a8a793178
Refactor colour handling to prepare for per-reporter colour modes
This includes always compiling the ANSI and None colour
implementations, as they don't need to touch any platform
specific APIs, and removing their respective compile-time
configuration options.

Because the Win32 colour implementation requires Win32-specific
APIs, it is still hidden behind a compile-time toggle,
`CATCH_CONFIG_COLOUR_WIN32` (renamed from `..._COLOUR_WINDOWS`).

The commandline options for colours were also changed. The
option now uses different name, and allows to select between
different implementations, rather than changing whether
the compiled-in colour implementation is used through
"yes/no/default" options.
2022-03-28 13:10:13 +02:00
Martin Hořeňovský aa3c7be434
Fix ToC in CLI documentation 2022-02-05 16:14:47 +01:00
Martin Hořeňovský d3199c42c2
Redo reporter CLI and reporter-specific docs
Closes #2259
2022-01-03 20:38:13 +01:00
Martin Hořeňovský eeee4a49af
Remove short flags from --list-tests and --list-tags 2022-01-02 21:23:29 +01:00
Martin Hořeňovský 0d1bdea69f
Remove all mentions of the removed --list-test-names-only flag 2022-01-02 21:23:26 +01:00
Martin Hořeňovský 3ab981fa21
Add documentation for the --verbosity option 2022-01-02 21:02:43 +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ý 4752545a69 Add version placeholders to the reporter docs 2022-01-01 14:16:12 +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ý 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
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ý ed1f343a41
Provide random-device option for --rng-seed and make it default 2021-10-08 21:35:45 +02:00
Jozef Grajciar 037ddbc75c Fix introduced in version placeholders
Resolves #2082
2021-03-13 10:26:12 +01:00
Martin Hořeňovský 6d803cba5d
Add example of negated tag selection to the CLI test spec docs
Close #2180
2021-02-25 15:54:27 +01:00
Augustas dc3c22f9ec
update from Hudson to Jenkins
Hudson is discontinued in 2016. Changed to Jenkins
2020-10-31 21:48:28 +02:00
Martin Hořeňovský 6efeecc179
Cherry-pick doc updates for v2.13.0 2020-07-26 15:14:38 +02:00
Martin Hořeňovský a004423c7f
Improve documentation for --min-duration 2020-07-26 14:06:52 +02:00
John Bytheway 80b0d6975c
Add --min-duration option
A test runner already has a --durations option to print durations.
However, this isn't entirely satisfactory.

When there are many tests, this produces output spam which makes it hard
to find the test failure output.  Nevertheless, it is helpful to be
informed of tests which are unusually slow.

Therefore, introduce a new option --min-duration that causes all
durations above a certain threshold to be printed.  This allows slow
tests to be visible without mentioning every test.
2020-07-26 10:47:53 +02:00
Martin Hořeňovský 4aefbbcd02
Pick docs for v2.12.0 2020-05-03 07:49:05 +02:00
Martin Hořeňovský 89fab65382
Update documentation for --order 2020-05-01 14:46:14 +02:00
Martin Hořeňovský 08f8a81b2c
Picking v2.11.2 docs changes 2020-04-30 21:44:16 +02:00
Tristan Stenner 6a2c025bfc
Add command line option 'never' to --wait-for-keypress (#1866)
Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
2020-02-16 16:11:11 +01:00
khyperia 3c7e737a7b
Allow configuring of benchmark warmup time 2020-02-16 15:44:23 +01:00
Martin Hostettler 8fb1219013 docs: command-line: Add example to specify tests by file name. 2019-10-21 23:51:33 +02:00
Clare Macrae d5a69cd400 Add 'Introduced in Catch 2.9.0.' text 2019-08-02 19:18:47 +02:00
Clare Macrae 0c27554af5 Update Contents in docs #1667 2019-07-06 17:25:55 +02:00
Scott Hutchinson 6f32c67ea7 Adding to documentation for --order and --rng-seed 2019-06-21 15:17:55 +02:00
Joachim Meyer ce2560ca95 Integrate Nonius benchmark into Catch2
Changes done to Nonius:
* Moved things into "Catch::Benchmark" namespace
* Benchmarks were integrated with `TEST_CASE`/`SECTION`/`GENERATE` macros
* Removed Nonius's parameters for benchmarks, Generators should be used instead
* Added relevant methods to the reporter interface (default-implemented, to avoid
breaking existing 3rd party reporters)
* Async processing is guarded with `_REENTRANT` macro for GCC/Clang, used by default
on MSVC
* Added a macro `CATCH_CONFIG_DISABLE_BENCHMARKING` that removes all traces of
benchmarking from Catch
2019-06-06 19:33:37 +02:00
Ryan Pavlik edde6f4736 Fix typos identified by codespell.
Self test baselines also modified accordingly, due to
one typo found in a string in test code.
2019-04-10 09:42:11 +02:00