Commit Graph

750 Commits

Author SHA1 Message Date
SirNate0
b15158c1db Fix typo in test-cases-and-sections.md 2024-08-13 12:28:03 +02:00
Martin Hořeňovský
8898cc6160
Mark non-const function for TEST_CASE_METHOD as deprecated 2024-08-05 20:13:03 +02:00
Keith Stockdale
f7cd0ba051
TEST_CASE_PERSISTENT_FIXTURE: A new fixture macro for allowing persistent fixtures throughout a TEST_CASE (#2885)
This PR introduces a new `TEST_CASE` macro called `TEST_CASE_PERSISTENT_FIXTURE`. `TEST_CASE_PERSISTENT_FIXTURE` offers the same functionality as `TEST_CASE_METHOD` except for one difference. The object on which the test method is invoked is only created once for all invocations of the test case. The object is created just after the `testCaseStarting` event is broadcast and the object is destroyed just before the `testCaseEnding` event is broadcast.

The main motivation for this new functionality is to allow `TEST_CASE`s to do expensive setup and teardown once per `TEST_CASE`, without having to resort to abusing event listeners or static function variables with manual initialization.


Implements #1602

---------

Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
2024-08-05 17:01:41 +02:00
Martin Hořeňovský
a40dd478f3
Update docs for REQUIRE_THROWS_MATCHES 2024-07-27 14:02:28 +02:00
Martin Hořeňovský
4e8d92bf02
v3.6.0 2024-05-05 20:58:18 +02:00
Martin Hořeňovský
b5373dadca
v3.5.4 2024-04-10 12:05:46 +02:00
Martin Hořeňovský
9271083a04
Merge pull request #2850 from jeremy-rifkin/jr/mention-succeed-in-loggingmd
Mention SUCCEED along with FAIL in logging.md
2024-03-30 15:59:43 +01:00
Jeremy
07701f946a
Mention SUCCEED along with FAIL in logging.md 2024-03-29 15:40:18 -05:00
Martin Hořeňovský
c0dfe13bb6
Improve example for custom options in reporter spec 2024-03-26 23:28:48 +01:00
Martin Hořeňovský
cad65c5003
Fix insufficiently escaped backslash in docs 2024-03-26 23:23:15 +01:00
Martin Hořeňovský
8ac8190e49
v3.5.3 2024-03-01 22:07:10 +01:00
Martin Hořeňovský
28c2f0b0c2
Mention x87 and ffast-math breaking FP random gen reproducibility 2024-02-19 15:02:11 +01:00
Martin Hořeňovský
2e1b02a0e2
Document issue with spaceship operator in assertion and MSVC 2024-02-19 15:02:10 +01:00
Martin Hořeňovský
82e9b9b5f2
Update CMake build instructions for current CMake version 2024-02-19 15:02:08 +01:00
Fernando J. Iglesias García
031a163a2c Improve tutorial.md with link to two-file setup instructions. 2024-02-19 15:01:14 +01:00
Letu Ren
b817497528 Fix number of current reporter
There are nine reporters in Catch2 3.5.2, Automake, compact, console,
JSON, JUnit, SonarQube, TAP, TeamCity and XML.
2024-02-16 21:29:57 +01:00
Julia Paluch
4f1b24df77 clarify duration unit in docs 2024-02-16 21:29:19 +01:00
Fædon Jóhannes
3157d6bbf1
Add Bazel instructions to integration docs (#2812)
Co-authored-by: Fædon Jóhannes Sinis <fs@treble.tech>
2024-02-16 16:58:09 +01:00
Martin Hořeňovský
79205da6a6
Fix typo in release notes for v3.5.2 2024-01-15 14:23:00 +01:00
Martin Hořeňovský
05e10dfccc
v3.5.2 2024-01-15 14:13:53 +01:00
Martin Hořeňovský
f981c9cbca
v3.5.1 2023-12-31 15:15:04 +01:00
Martin Hořeňovský
3acb8b30f1
More detailed examples for lifetimes in combined matcher exprs
Example taken from #2777
2023-12-13 17:24:23 +01:00
Martin Hořeňovský
3f23192e55
Fix typo in release notes 2023-12-13 17:24:18 +01:00
Martin Hořeňovský
53d0d913a4
v3.5.0 2023-12-11 00:55:40 +01:00
Simhon Chourasia
d4e9fb8aa5
Highlight that SECTIONs rerun the entire test case from beginning (#2749) 2023-12-10 22:35:54 +01:00
Martin Hořeňovský
b606bc2802
Remove obsolete section in limitations.md
We no longer use `std::shuffle` to implement random test order, so
a debug mode bug in old versions of libstdc++ cannot apply to us.
2023-12-10 22:09:48 +01:00
Blake-Madden
4ab0af8baf
Fix minor typos in documentation (#2769)
Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
2023-12-10 22:01:13 +01:00
Martin Hořeňovský
ae4fe16b81
Make the user-facing random Generators reproducible
Thanks to the new distributions, this is almost trivial change.
2023-12-10 19:53:44 +01:00
Ikko Eltociear Ashimine
21d2da23bc Fix typo in tostring.md
specialiation -> specialization
2023-12-09 21:00:24 +01:00
Pablo Duboue
0520ff4436 [DOC] Replaced broken link (fixes #2770)
The original link is no longer available but a fork is still on GitHub.
2023-12-02 22:05:48 +01:00
Gerald Senarclens de Grancy
2c68a0d05f lifted suggested version
Did this, because with 3.0.1, the files
- catch_xmlwriter.cpp
- catch_string_manip.hpp
- catch_test_case_info.hpp

were missing

This led to some obvious and some obscure compile errors when compiling
with g++ 13.2.0 (std c++17 or c++20)
One of these errors being "Elaborated-type-specifier for a scoped enum
must not use the ‘class’ keyword"

Since this is a rather bad experience and debugging it is
time-consuming, I suggest to simply boost the recommended version in the
snippet which is likely copied by new Catch2 users
2023-11-14 17:10:31 +01:00
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
Per Lundberg
766541d12d why-catch.md: Add JetBrains survey link 2023-09-27 20:14:35 +02:00
Martin Hořeňovský
b4ffba5087
Update sample output in docs/benchmarks.md 2023-09-08 10:04:17 +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ý
9538d16005
Mention missing catch_user_config.hpp in FAQ 2023-08-11 15:36:23 +02:00
Martin Hořeňovský
a94bee771e
Add missing line for v3.4.0 to ToC in release-notes.md 2023-08-11 15:36:03 +02:00
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ý
7a52dfa77b
Fix typo in cross-docs links 2023-06-11 19:37:15 +02:00
Martin Hořeňovský
0631b607ee
Test & document SKIP in generator constructor
Closes #1593
2023-05-31 15:12:43 +02:00
Martin Hořeňovský
dba9197ec7
Add new config option: STATIC_ANALYSIS_SUPPORT 2023-05-29 00:55:20 +02:00
Chris Thrasher
6dce539fad
Add SFML to the list of open source users 2023-05-13 14:34:34 -06:00
Martin Hořeňovský
d84777c9cb
Fix assertionStarting events being sent after the expr is evaluated
Closes #2678
2023-05-06 11:48:41 +02:00
Vertexwahn
46539b6d9b Fix spelling 2023-04-29 12:55:51 +02:00
Holger Kaelberer
aad926baf8 Catch.cmake: Add new DISCOVERY_MODE option to catch_discover_tests
Introducing a new DISCOVERY_MODE mode option, which provides greater
control over when catch_discover_tests perforsm test discovery.

It has two supported modes:
* POST_BUILD: The default behavior, which adds a POST_BUILD command
  to perform test discovery after the test has been built as was
  always done so far.

* PRE_TEST: New mode, which delays test discovery until test execution.
  The generated include file generates the appropriate CTest files at
  runtime and regenerates the CTest files when the executable is
  updated.
  This mode can be used in build-environments that don't allow for
  executing the linked binaries at build-time (like in a
  cross-compilation environment).

DISCOVERY_MODE can be controlled in two ways:
1. Setting the DISCOVERY_MODE when calling catch_discover_tests.

2. Setting the global CMAKE_CATCH_DISCOVER_TESTS_DISCOVERY_MODE prior
   to calling gtest_discover_tests.

Closes #2493
2023-04-19 23:51:42 +02:00
Vadim Zeitlin
8a1b3b81cb Add wxWidgets as another Open Source project using Catch
wxWidgets uses Catch (v2 currently) for all of its tests, even though
some of them still use CppUnit-like macros for compatibility.
2023-03-11 21:29:51 +01:00
Vadim Zeitlin
e5aabb6714 Add xmlwrapp to the list of Open Source projects using Catch
This library uses Catch (v2 currently) for its unit tests.
2023-03-11 21:29:51 +01:00
Martin Hořeňovský
3f0283de7a
v3.3.2 2023-02-27 15:12:49 +01:00
Martin Hořeňovský
6fbb3f0723
Add IsNaN matcher 2023-02-26 00:14:32 +01:00