Commit Graph

90 Commits

Author SHA1 Message Date
Riom 4acc51828f
Introduce CATCH_CONFIG_PREFIX_MESSAGES to only prefix a few logging related macros. (#2544)
* Add missing include for VxWorks build.

std::min is defined in algorithm provides std::min. It appears to be transitively included for most platforms. For VxWorks however this explicit include is required.

* Add option CATCH_CONFIG_PREFIX_MESSAGES to selectively prefix message macros only.

In contrast to CATCH_CONFIG_PREFIX_ALL, this will only prefix the following macros:
I.e. INFO, UNSCOPED_INFO, WARN and CATCH_CAPTURE

This is mainly useful for codebases that use INFO or WARN for their own logging macros.
2023-07-19 17:04:43 +02:00
Martin Hořeňovský 6e79e682b7
v3.4.0 2023-07-13 13:37:30 +02:00
Martin Hořeňovský dba9197ec7
Add new config option: STATIC_ANALYSIS_SUPPORT 2023-05-29 00:55:20 +02:00
Martin Hořeňovský 65cc7fd2ae
v3.2.0 2022-11-16 20:05:48 +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ý 2d0dcc36e8
Add Bazel support to the documentation 2022-10-21 10:53:55 +02:00
Martin Hořeňovský 6a422bae0b
Trim superfluous whitespace in docs 2022-10-17 15:02:45 +02:00
tocic dea1a6abd9
Fix typos in docs (#2514) 2022-09-09 16:00:39 +02:00
Martin Hořeňovský 97c48e0c34
v3.1.0 2022-07-17 20:18:44 +02:00
Brandon Jones 7e4ec432d0 Change Bazel XML support to depend upon BAZEL_TEST 2022-06-17 16:36:14 +02:00
Martin Hořeňovský 605a34765a
v3.0.1 2022-05-17 22:13:36 +02:00
Lukasz Okraszewski cb551b4f6d
Add default reporter for Bazel integration (#2399)
When the added Bazel configuration flag is enabled,
a default JUnit reporter will be added if the XML
envrioment variable is defined.
Fix include paths for generated config header.
Enable Bazel config by default when building with
Bazel.


Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
2022-04-08 18:01:59 +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ý c912f62fc4
Remove Windows.h related defines 2022-02-05 16:21:06 +01:00
Martin Hořeňovský b0279e0c14
Remove mention of CATCH_CONFIG_MAIN from docs/configuration.md 2022-02-05 14:55:01 +01:00
Jozef Grajciar 037ddbc75c Fix introduced in version placeholders
Resolves #2082
2021-03-13 10:26:12 +01:00
Clare Macrae f57689f888 Fix minor typo in docs. 2020-10-28 11:38:06 +01:00
Martin Hořeňovský ddde2f5e33
Remove obsolete configuration macros from the documentation 2020-05-14 14:52:33 +02:00
Martin Hořeňovský 04c171f91f
Update CATCH_CONFIG_WINDOWS_CRTDBG docs to reflect new distribution 2020-05-06 18:17:51 +02:00
Martin Hořeňovský bbbc7a0d7f
Fix CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTION interaction with feature macro 2020-05-01 20:26:40 +02:00
Martin Hořeňovský 08f8a81b2c
Picking v2.11.2 docs changes 2020-04-30 21:44:16 +02:00
khyperia e880da93bd
Make CATCH_BREAK_INTO_DEBUGGER be user-configurable 2020-02-16 15:27:21 +01:00
Martin Hořeňovský cd7d7a1c67
Remove CATCH_CONFIG_ENABLE_BENCHMARKING compilation toggle
Now that Catch2 is a proper library, we can always build the full
library (comparatively minor slowdown) and the user can avoid
including benchmarking headers to avoid the compilation slowdown.
2020-02-06 11:36:46 +01:00
Martin Hořeňovský bce5b364d3
Unconditionally provide <chrono> StringMakers 2020-02-03 20:53:36 +01:00
Martin Hořeňovský 6c3a5ef625
Remove CATCH_CONFIG_DISABLE_MATCHERS
Now that the recommended distribution and usage method is proper
library, users can just avoid including the matcher headers to get
basically the same effect.
2020-01-25 09:07:36 +01:00
Martin Hořeňovský 7c9f92bc1c
v2.10.0 2019-10-13 23:44:18 +02:00
Martin Hořeňovský 071bacad5e
Properly linkthrough additions to the configuration docs 2019-09-06 13:24:51 +02:00
Martin Hořeňovský addf799040
Workaround missing std::nextafter in uClibc
Luckily, the rest of C++11 features seem to be supported...

Closes #1739
2019-09-06 13:08:44 +02:00
Martin Hořeňovský 155274f0df
Add disabling the use of Android's logging at compile time
This is done via the new compile time toggle,
`CATCH_CONFIG_ANDROID_LOGWRITE`.

Closes #1743
2019-09-06 12:44:06 +02:00
Clare Macrae 119569a67e Add 'Introduced in Catch 2.4.0.' text 2019-08-02 19:18:47 +02:00
Clare Macrae 69fc94d6f8 Add 'Introduced in Catch 2.4.1.' text 2019-08-02 19:18:47 +02:00
Clare Macrae 42a5903188 Add 'Introduced in Catch 2.6.0.' text 2019-08-02 19:18:47 +02:00
Martin Hořeňovský d017f6d18f
Document CATCH_CONFIG_CPP17_BYTE macro
Leftover from #1686
2019-07-26 21:43:46 +02:00
Martin Hořeňovský 91244d30a7
Document CATCH_CONFIG_CPP17_OPTIONAL macro 2019-07-26 21:42:54 +02:00
Martin Hořeňovský c365ac392b
Standardize and document the parallel processing toggle 2019-06-15 12:50:36 +02:00
Martin Hořeňovský e340ab8db6
Various improvements to the benchmarking support
* Units from <ratio> are no longer redeclared in our own namespace
* The default clock is `steady_clock`, not `high_resolution_clock`,
because, as HH says "high_resolution_clock is useless. If you want
measure the passing of time, use steady_clock. If you want user
friendly time, use system_clock".
* Benchmarking support is opt-in, not opt-out, to avoid the large
(~10%) compile time penalty.
* Benchmarking-related options in CLI are always present, to decrease
the amount of code that is only compiled conditionally and making
the whole shebang more maintainble.
2019-06-06 21:28:56 +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
Martin Hořeňovský 67308bb606
Add documentation for CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER
Related to #1510
2019-01-31 15:36:52 +01:00
melak47 c638c57209 Add StringMaker for std::variant, std::monostate (#1380)
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.
2018-09-20 14:13:35 +02:00
melak47 a575536abe Add StringMaker for std::(w)string_view
Fixes #1375
2018-09-10 11:37:26 +02:00
Martin Hořeňovský 46e99e258f Fixup TOC script sluggification and documentation 2018-09-09 17:09:57 +02:00
Martin Moene a81c01d4f9 Updated documentation TOCs 2018-09-08 11:05:52 +02:00
Martin Hořeňovský 232ea3c456 Add documentation for no-exception support
Closes #703
Closes #1358
2018-09-04 10:06:31 +02:00
Axel Huebl 7667a7d89c Docs: TABs to Spaces
Replace TABs with four (4) spaces in code docs.
2018-08-29 18:05:22 +02:00
Martin Hořeňovský 7a59d5027f Link the example from `CATCH_CONFIG_NOSTDOUT` documentation 2018-07-08 13:58:44 +02:00
Martin Hořeňovský f460a7d8f9 Fix documentation of CATCH_CONFIG_FAST_COMPILE
Related to issue #1279
2018-06-30 12:31:46 +02:00
Martin Hořeňovský df0b0e64e1 Make FALLBACK_STRINGIFIER documentation more explicit
Related to #1024
2018-05-14 21:03:07 +02:00
Martin Hořeňovský 0074926e5c Provide a polyfill over `std::to_string`
Android apparently does not support `std::to_string`, so we add a
small polyfill over it. Right now only the ULP matcher uses it,
but we have had plans to use it in `StringMaker<int>` and friends,
as it performs a lot better than `std::stringstream` based
stringification on MSVC.

See #1280 for more details
2018-05-09 21:47:42 +02:00
Martin Hořeňovský e92b9c07c3 Add an experimental new way of capturing stdout/stderr
Unlike the relatively non-invasive old way of capturing stdout/stderr,
this new way is also able to capture output from C's stdlib functions
such as `printf`. This is done by redirecting stdout and stderr file
descriptors to a file, and then reading this file back.

This approach has two sizeable drawbacks:
1) Performance, obviously. Previously an installed capture made the
program run faster (as long as it was then discarded), because a call
to `std::cout` did not result in text output to the console. This new
capture method in fact forces disk IO. While it is likely that any
modern OS will keep this file in memory-cache and might never actually
issue the IO to the backing storage, it is still a possibility and
calls to the file system are not free.

2) Nonportability. While POSIX is usually assumed portable, and this
implementation relies only on a very common parts of it, it is no
longer standard C++ (or just plain C) and thus might not be available
on some obscure platforms. Different C libs might also implement the
relevant functions in a less-than-useful ways (e.g. MS's `tmpfile`
generates a temp file inside system folder, so it will not work
without elevated privileges and thus is useless).

These two drawbacks mean that, at least for now, the new capture is
opt-in. To opt-in, `CATCH_CONFIG_EXPERIMENTAL_REDIRECT` needs to be
defined in the implementation file.

Closes #1243
2018-04-29 22:25:49 +02:00