mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 05:16:10 +01:00
Fix typos in docs (#2514)
This commit is contained in:
parent
32eae0ecce
commit
dea1a6abd9
@ -112,7 +112,7 @@ catch_discover_tests()
|
|||||||
```
|
```
|
||||||
|
|
||||||
#### Customization
|
#### Customization
|
||||||
`catch_discover_tests` can be given several extra argumets:
|
`catch_discover_tests` can be given several extra arguments:
|
||||||
```cmake
|
```cmake
|
||||||
catch_discover_tests(target
|
catch_discover_tests(target
|
||||||
[TEST_SPEC arg1...]
|
[TEST_SPEC arg1...]
|
||||||
|
@ -284,7 +284,7 @@ This option transforms tabs and newline characters into ```\t``` and ```\n``` re
|
|||||||
<pre>-w, --warn <warning name></pre>
|
<pre>-w, --warn <warning name></pre>
|
||||||
|
|
||||||
You can think of Catch2's warnings as the equivalent of `-Werror` (`/WX`)
|
You can think of Catch2's warnings as the equivalent of `-Werror` (`/WX`)
|
||||||
flag for C++ compilers. It turns some suspicious occurences, like a section
|
flag for C++ compilers. It turns some suspicious occurrences, like a section
|
||||||
without assertions, into errors. Because these might be intended, warnings
|
without assertions, into errors. Because these might be intended, warnings
|
||||||
are not enabled by default, but user can opt in.
|
are not enabled by default, but user can opt in.
|
||||||
|
|
||||||
@ -313,7 +313,7 @@ When set to ```yes``` Catch will report the duration of each test case, in milli
|
|||||||
> `--min-duration` was [introduced](https://github.com/catchorg/Catch2/pull/1910) in Catch2 2.13.0
|
> `--min-duration` was [introduced](https://github.com/catchorg/Catch2/pull/1910) in Catch2 2.13.0
|
||||||
|
|
||||||
When set, Catch will report the duration of each test case that took more
|
When set, Catch will report the duration of each test case that took more
|
||||||
than <value> seconds, in milliseconds. This option is overriden by both
|
than <value> seconds, in milliseconds. This option is overridden by both
|
||||||
`-d yes` and `-d no`, so that either all durations are reported, or none
|
`-d yes` and `-d no`, so that either all durations are reported, or none
|
||||||
are.
|
are.
|
||||||
|
|
||||||
@ -570,7 +570,7 @@ tests still returns 0.
|
|||||||
-v, --verbosity <quiet|normal|high>
|
-v, --verbosity <quiet|normal|high>
|
||||||
```
|
```
|
||||||
|
|
||||||
Changing verbosity might change how much details Catch2's reporters output.
|
Changing verbosity might change how many details Catch2's reporters output.
|
||||||
However, you should consider changing the verbosity level as a _suggestion_.
|
However, you should consider changing the verbosity level as a _suggestion_.
|
||||||
Not all reporters support all verbosity levels, e.g. because the reporter's
|
Not all reporters support all verbosity levels, e.g. because the reporter's
|
||||||
format cannot meaningfully change. In that case, the verbosity level is
|
format cannot meaningfully change. In that case, the verbosity level is
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
Catch2 is designed to "just work" as much as possible, and most of the
|
Catch2 is designed to "just work" as much as possible, and most of the
|
||||||
configuration options below are changed automatically during compilation,
|
configuration options below are changed automatically during compilation,
|
||||||
according to the detected environment. However, this detection can also
|
according to the detected environment. However, this detection can also
|
||||||
be overriden by users, using macros documented below, and/or CMake options
|
be overridden by users, using macros documented below, and/or CMake options
|
||||||
with the same name.
|
with the same name.
|
||||||
|
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ and so on.
|
|||||||
|
|
||||||
Catch2 currently targets C++14 as the minimum supported C++ version.
|
Catch2 currently targets C++14 as the minimum supported C++ version.
|
||||||
Features from higher language versions should be used only sparingly,
|
Features from higher language versions should be used only sparingly,
|
||||||
when the benefits from using them outweight the maintenance overhead.
|
when the benefits from using them outweigh the maintenance overhead.
|
||||||
|
|
||||||
Example of good use of polyfilling features is our use of `conjunction`,
|
Example of good use of polyfilling features is our use of `conjunction`,
|
||||||
where if available we use `std::conjunction` and otherwise provide our
|
where if available we use `std::conjunction` and otherwise provide our
|
||||||
|
@ -25,7 +25,7 @@ depending on how often the cleanup needs to happen.
|
|||||||
|
|
||||||
## Why cannot I derive from the built-in reporters?
|
## Why cannot I derive from the built-in reporters?
|
||||||
|
|
||||||
They are not made to be overriden, in that we do not attempt to maintain
|
They are not made to be overridden, in that we do not attempt to maintain
|
||||||
a consistent internal state if a member function is overriden, and by
|
a consistent internal state if a member function is overriden, and by
|
||||||
forbidding users from using them as a base class, we can refactor them
|
forbidding users from using them as a base class, we can refactor them
|
||||||
as needed later.
|
as needed later.
|
||||||
|
@ -99,7 +99,7 @@ Catch does not support running tests in isolated (forked) processes. While this
|
|||||||
|
|
||||||
Catch2 keeps test execution in one process strictly serial, and there
|
Catch2 keeps test execution in one process strictly serial, and there
|
||||||
are no plans to change this. If you find yourself with a test suite
|
are no plans to change this. If you find yourself with a test suite
|
||||||
that takes too long to run and yo uwant to make it parallel, you have
|
that takes too long to run and you want to make it parallel, you have
|
||||||
to run multiple processes side by side.
|
to run multiple processes side by side.
|
||||||
|
|
||||||
There are 2 basic ways to do that,
|
There are 2 basic ways to do that,
|
||||||
@ -171,7 +171,7 @@ TEST_CASE("b") {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
If you are seeing a problem like this, i.e. a weird test paths that trigger only under Clang with `libc++`, or only under very specific version of `libstdc++`, it is very likely you are seeing this. The only known workaround is to use a fixed version of your standard library.
|
If you are seeing a problem like this, i.e. weird test paths that trigger only under Clang with `libc++`, or only under very specific version of `libstdc++`, it is very likely you are seeing this. The only known workaround is to use a fixed version of your standard library.
|
||||||
|
|
||||||
|
|
||||||
### libstdc++, `_GLIBCXX_DEBUG` macro and random ordering of tests
|
### libstdc++, `_GLIBCXX_DEBUG` macro and random ordering of tests
|
||||||
|
@ -158,7 +158,7 @@ difference with `target` is less than the `margin`.
|
|||||||
are no more than `maxUlpDiff`
|
are no more than `maxUlpDiff`
|
||||||
[ULPs](https://en.wikipedia.org/wiki/Unit_in_the_last_place)
|
[ULPs](https://en.wikipedia.org/wiki/Unit_in_the_last_place)
|
||||||
away from the `target` value. The short version of what this means
|
away from the `target` value. The short version of what this means
|
||||||
is that there is no more than `maxUlpDiff - 1` representeable floating
|
is that there is no more than `maxUlpDiff - 1` representable floating
|
||||||
point numbers between the argument for matching and the `target` value.
|
point numbers between the argument for matching and the `target` value.
|
||||||
|
|
||||||
**Important**: The WithinULP matcher requires the platform to use the
|
**Important**: The WithinULP matcher requires the platform to use the
|
||||||
@ -224,7 +224,7 @@ The other miscellaneous matcher utility is exception matching.
|
|||||||
|
|
||||||
#### Matching exceptions
|
#### Matching exceptions
|
||||||
|
|
||||||
Catch2 provides an utility macro for asserting that an expression
|
Catch2 provides a utility macro for asserting that an expression
|
||||||
throws exception of specific type, and that the exception has desired
|
throws exception of specific type, and that the exception has desired
|
||||||
properties. The macro is `REQUIRE_THROWS_MATCHES(expr, ExceptionType, Matcher)`.
|
properties. The macro is `REQUIRE_THROWS_MATCHES(expr, ExceptionType, Matcher)`.
|
||||||
|
|
||||||
@ -368,7 +368,7 @@ style matchers arbitrarily.
|
|||||||
|
|
||||||
To create a new-style matcher, you have to create your own type that
|
To create a new-style matcher, you have to create your own type that
|
||||||
derives from `Catch::Matchers::MatcherGenericBase`. Your type has to
|
derives from `Catch::Matchers::MatcherGenericBase`. Your type has to
|
||||||
also provide two methods, `bool match( ... ) const` and overriden
|
also provide two methods, `bool match( ... ) const` and overridden
|
||||||
`std::string describe() const`.
|
`std::string describe() const`.
|
||||||
|
|
||||||
Unlike with old-style matchers, there are no requirements on how
|
Unlike with old-style matchers, there are no requirements on how
|
||||||
|
@ -47,7 +47,7 @@ Catch2 also supports [splitting tests in a binary into multiple
|
|||||||
shards](command-line.md#test-sharding). This can be used by any test
|
shards](command-line.md#test-sharding). This can be used by any test
|
||||||
runner to run batches of tests in parallel. Do note that when selecting
|
runner to run batches of tests in parallel. Do note that when selecting
|
||||||
on the number of shards, you should have more shards than there are cores,
|
on the number of shards, you should have more shards than there are cores,
|
||||||
to avoid issues with long running tests getting accidentally grouped in
|
to avoid issues with long-running tests getting accidentally grouped in
|
||||||
the same shard, and causing long-tailed execution time.
|
the same shard, and causing long-tailed execution time.
|
||||||
|
|
||||||
**Note that naively composing sharding and random ordering of tests will break.**
|
**Note that naively composing sharding and random ordering of tests will break.**
|
||||||
|
@ -41,7 +41,7 @@ So what does Catch2 bring to the party that differentiates it from these? Apart
|
|||||||
|
|
||||||
## Who else is using Catch2?
|
## Who else is using Catch2?
|
||||||
|
|
||||||
A whole lot of people. According to the 2021 Jetbrains C++ ecosystem survey,
|
A whole lot of people. According to the 2021 JetBrains C++ ecosystem survey,
|
||||||
about 11% of C++ programmers use Catch2 for unit testing, making it the
|
about 11% of C++ programmers use Catch2 for unit testing, making it the
|
||||||
second most popular unit testing framework.
|
second most popular unit testing framework.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user