diff options
| author | Martin Hořeňovský | 2026-07-04 16:35:50 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2026-07-04 16:36:05 +0200 |
| commit | 9ec44dd62b1b593e01feaf95eb485d26fcdd50ce (patch) | |
| tree | 70b32b57a08c8b3f5e21e2fca3cdcf9b5ae6ca99 /tests/TestScripts/DiscoverTests/register-tests.cpp | |
| parent | 675f9eaeb191c51b9d2ffb2bb198009533895051 (diff) | |
| download | catch3-9ec44dd62b1b593e01feaf95eb485d26fcdd50ce.tar.gz | |
catch_discover_tests uses tempfile to retrieve JSON from the binary
This allows it to deal with badly behaved code, where 3rd party
dependencies write into stdout during global construction.
Closes #3162
Closes #3166
Diffstat (limited to 'tests/TestScripts/DiscoverTests/register-tests.cpp')
| -rw-r--r-- | tests/TestScripts/DiscoverTests/register-tests.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/TestScripts/DiscoverTests/register-tests.cpp b/tests/TestScripts/DiscoverTests/register-tests.cpp index be533ab6..8b071196 100644 --- a/tests/TestScripts/DiscoverTests/register-tests.cpp +++ b/tests/TestScripts/DiscoverTests/register-tests.cpp @@ -8,6 +8,24 @@ #include <catch2/catch_test_macros.hpp> +#include <cstdio> +#include <iostream> + +namespace { + +struct PrintsWhenConstructed { + PrintsWhenConstructed() { + std::cout << "Hello\n"; + std::cerr << "Holla\n"; + std::fprintf(stdout, "Hullo\n"); + std::fprintf(stderr, "Hillo\n"); + } +}; + +static PrintsWhenConstructed instance; + +} + TEST_CASE("@Script[C:\\EPM1A]=x;\"SCALA_ZERO:\"", "[script regressions]"){} TEST_CASE("Some test") {} TEST_CASE( "Let's have a test case with a long name. Longer. No, even longer. " |