simple code with provided main function which just returns 0
leaks memory due to fact that singletons are not cleaned up
running valgrind on such simple application reports that 752 bytes
are still available in 11 blocks
this commit adds destructor to Catch::LeakDetector which calls
Catch::cleanUp()
By default, it expands into a `static_assert` + `SUCCEED` pair, but
it can also be deferred to runtime by defining
`CATCH_CONFIG_RUNTIME_STATIC_REQUIRE`, which causes it to expand
into plain old `REQUIRE`.
Closes#1362Closes#1356
* Session::applyCommandLine overload on wchar_t
This allows users on Windows to use Catch::Session::applyCommandLine
with wchar_t * arguments of application.
With this change Session::run became templated so both char and wchar_t
version have the same implementation.
Xml result of reported will now contain value of rng-seed in case it
is not zero.
The value will be stored in element Randomness and it's attribute seed.
Relates to #1402
Some platforms set the signedness of char to unsigned (eg. ARM).
Convert from char should not assume the signedness of char.
Fix build issue with -Werror,-Wtautological-unsigned-zero-compare flags.
Signed-off-by: Miguel Gaio <mgaio35@gmail.com>
Previously a mismatched prefix would be skipped before the actual
comparison would be performed. Obviously, it is supposed to be
_matching_ prefix that is skipped.
Prevent warnings
- gnu: -Wcomment: multi-line comment
- clang: -Wweak-vtables 'class' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit
- clang: -Winconsistent-missing-override: 'method' overrides a member function but is not marked 'override'
- MSVC: C4702: unreachable code
This fixes some wording that implies C++98 standard, updates
the recommended solution to looped SECTION macros and mentioned
the "last section failed, test needs to be rerun" problem.
Related to #1367
Related to #1384
Related to #1389
This might prove helpful when the package managers either doesn't
have Catch at all, or provides it in obsolete version (Ubuntu 16.04,
I am looking at you).
Closes#1383
The "percentage" suggests that the expected epsilon can be in
[0, 100], but the expected values are in [0, 1]. The new wording
uses "coefficient", to make it clearer that we are talking about
values in [0, 1].
Closes#1388
The StringMaker is off by default and can be enabled by a new macro `CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER`, to avoid increasing the footprint of stringification machinery by default.
The desired behaviour was to match a literal "[.]", so the regex
has to be escaped as "\\[\\.\\]" -- double backslashes, because
it has to be escaped from CMake as well as from the regex engine.
This means
* Adding new configuration toggle `CATCH_CONFIG_DISABLE_EXCEPTIONS`
and a best-guess configuration auto-checking for it.
* Adding new set of internal macros, `CATCH_TRY`, `CATCH_CATCH_ALL`
and `CATCH_CATCH_ANON` that can be used in place of regular `try`,
`catch(...)` and `catch(T const&)` respectively, while disappearing
when `CATCH_CONFIG_DISABLE_EXCEPTIONS` is enabled.
* Replacing all uses of `throw` with calls to `Catch::throw_exception`
customization point.
* Providing a default implementation for the above customization point
when `CATCH_CONFIG_DISABLE_EXCEPTIONS` is set.
* Letting users override this implementation with their own.
* Some minor changes and ifdefs all around to support the above
issue #1360
It is possible to have multple given contexts in a single BDD scenario;
if you have to type 'and' in the GIVEN description; it's very likely you
need an AND.
A generic AND is not possible, thus a AND_GIVEN is added to complement
the AND_WHEN and AND_THEN.
Can be used without needing to increase indent:
SCENARIO("...") {
GIVEN("...")
AND_GIVEN("...") {
WHEN("...") {
THEN("...") {
// ...
}
}
}
}
would correctly output, when requested/needed:
Given: ...
And given: ...
When: ...
Then: ...
The padding had to be increased by a character in the output message, to
continue to be uniform.
This is because otherwise the installations paths provided via
GNUInstallDirs become messed up and parts of the installation
package will end up in the wrong place.
Also it doesn't make much sense to force dependees to also install
our header alongside them.
Closes#1373