Commit Graph

4130 Commits

Author SHA1 Message Date
Niels Kristian Kjærgård Madsen
5f9109a8dc
Fix nvcc compile error (#2477)
Co-authored-by: Niels Kristian Kjærgård Madsen <nkm@kvantify.dk>
2022-07-07 00:03:02 +02:00
Martin Hořeňovský
5a1ef7e4a6
Redo visibility fallback 2022-06-27 13:10:22 +02:00
Martin Hořeňovský
bea58bf8bb
Allow building Catch2 as dynamic library
Also have a check that warns users if they try to combined dynamic
library with hidden visibility, which we do not support.

Closes #2397
Closes #2398
2022-06-24 16:26:12 +02:00
Martin Hořeňovský
34d9724058
Add experimental CMake script for sharding tests in binaries 2022-06-24 14:12:55 +02:00
Martin Hořeňovský
5d269045b2
Add section on running tests in parallel to the FAQ 2022-06-24 11:20:31 +02:00
Martin Hořeňovský
95a1206805
Add doc page with best practices and other usage tips 2022-06-24 11:20:22 +02:00
Martin Hořeňovský
6f9f1465c3
Shorten lines in sharding docs 2022-06-22 00:12:16 +02:00
Martin Hořeňovský
8730260457
Split apart combined TUs
The compile time improvements from using combined TUs mostly isn't
worth the annoyance they cause with various IDE shortcuts, like
when switching between header and its impl. file.

Splitting them apart also fixes the issue of empty subdirs being
installed due to `foo/internal` folders that only contained the
combined TUs and no headers.

Closes #2457
Closes #2463
2022-06-21 18:48:44 +02:00
Martin Hořeňovský
bdfa920f93
Use binary path in testBazelReporter reporter output path 2022-06-21 14:21:12 +02:00
Frank Dana
a369267874
test-fixtures.md: Line-wrap code examples (#2464)
* test-fixtures.md: Line-wrap code examples

* relinebreak

Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
2022-06-19 16:24:59 +02:00
Nexus Web Development
1f381a1f62
Update commercial-users.md (#2465)
Using Catch2 and now Catch3 for our client's as well as our own projects and loving it. Especially the easy C++ BDD setup and implementation.
2022-06-18 23:47:49 +02:00
Martin Hořeňovský
165647abbc
Change provideBazelReporterOutput to local linkage 2022-06-17 18:23:06 +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ý
078201fcf4
Remove HOMEPAGE_URL from project call
Closes #2428
2022-06-16 22:16:44 +02:00
Murray Johnson
8110ee9206 Add lib/cmake/Catch2 to conan builddirs in package recipe so extras/*.cmake files are packaged 2022-06-15 10:50:24 +02:00
Martin Hořeňovský
fa9416426a
Refactor shared args in approvalTests.py 2022-06-14 23:42:00 +02:00
Martin Hořeňovský
338e4ec1f8
Force disable console colours for tests that regex check output
Fixes #2458
2022-06-14 23:24:06 +02:00
Martin Hořeňovský
372b7575f6
Remove deprecation notice for console colour CLI
The required changes were one of the last commits before the full
v3 release.
2022-06-13 23:52:31 +02:00
Martin Hořeňovský
d32fca4a49
Merge pull request #2452 from lizzyd710/devel
Added Cytopia to opensource-users.md
2022-06-08 15:59:57 +02:00
Morwenn
a0ece7b252
Compatility fixes for GCC5 (#2448)
* GCC5 compat: work around inherited constructor issues

Don't use inherited constructors, forward manually instead. This
basically reverts 61f803126d.

I believe that GCC5 does not implement P0136, a C++17 change that made
inherited constructors actually usable and was backported as a DR all
the way to C++11.

* GCC5 compat: bypass std::pair construction issue

Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
2022-06-07 18:46:46 +02:00
Elizabeth Sherrock
0a810c5e59
Added Cytopia to opensource-users.md 2022-06-07 09:06:10 -04:00
Joe Noël
d0177ee686 Fix implicit long to double conversion
Raises a compiler warning when compiled with `-Wimplicit-int-float-conversion` using clang.
2022-06-07 00:27:37 +02:00
Martin Hořeňovský
173539ab9e
Update the 'Try online' badge link for 3.0.1 2022-06-06 00:29:05 +02:00
Martin Hořeňovský
8822e28772
Update CE link in BDD documentation for 3.0.1
The old compiler was no longer built-for, so it couldn't link
against new versions, and also didn't properly provide the
user-config header.

Closes #2396
2022-06-06 00:29:02 +02:00
Martin Hořeňovský
ff9506cedd
Only test SEH handling with MSVC
MinGW doesn't support `__try` and friends at all, while Clang
only supports it partially, and the test would require some
changes to make it work there. Since this is only a test, we can
afford to keep it MSVC-only.

Closes #2447
2022-06-06 00:29:01 +02:00
Petr Kubánek
0c13d021da Update documentation - add pkg-config examples.
Use -std=c++14 (instead of c++11). Pointers how to integrate with
pkg-config for non-CMake projects.
2022-06-05 15:58:41 +02:00
balus
3644b4135d Doc: correct the address of the link to the command-line doc in tutorial.md 2022-06-04 10:20:01 +02:00
ahans
1c4f52b24a
Suppress NVCC unused variable warnings (#2427)
Closes #2306
2022-06-03 16:17:14 +02:00
Sergio Losilla
231c58a048
Add table with verbosity levels (missing --list-listeners) (#2443)
Co-authored-by: Sergio Losilla <sergio.losilla@nt-bnct.com>
Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
2022-06-02 21:50:51 +02:00
Sergio Losilla
5efd327dd4
Fix crash when running with --list-listeners and no registered listeners (#2442)
Co-authored-by: Sergio Losilla <sergio.losilla@nt-bnct.com>
2022-06-02 16:11:12 +02:00
Martin Hořeňovský
40dd9dd3f4
Fix copy paste error in the new random gen constraint 2022-06-02 15:51:21 +02:00
Martin Hořeňovský
4142e699c2
Add full set of constraints to random integral generator
Related to #2433
2022-06-02 12:15:35 +02:00
Martin Hořeňovský
9e445930cc
Remove obsolete todo 2022-06-02 11:54:15 +02:00
Martin Hořeňovský
2dc657cd1f
Make default colour selection fall-through
Closes #2426
2022-06-02 09:16:10 +02:00
Martin Hořeňovský
cca5923502
Leak full Wparentheses suppression for GCC 9
Reported as an issue on Discord. I thought that by GCC 9, the
C++ frontend was fixed enough to support `_Pragma`-based
suppression correctly, but apparently I was wrong.
2022-05-31 23:57:09 +02:00
Martin Hořeňovský
8c952bd076
Point to 3.0.1 in FetchContent example
Closes #2326
Closes #2438
2022-05-31 11:49:24 +02:00
Martin Hořeňovský
85c00eb946
Ensure that console_width.hpp includes user_config.hpp first
Otherwise we can get macro redefinition warnings when another
file includes console_width.hpp first, before user_config.hpp.

Closes #2431
2022-05-23 23:57:42 +02:00
Martin Hořeňovský
3a18a688a0
Mention CMake's integration with CATCH_CONFIG options 2022-05-21 13:04:09 +02:00
Martin Hořeňovský
605a34765a
v3.0.1 2022-05-17 22:13:36 +02:00
Martin Hořeňovský
abb669d4fd
Extend project call for Catch2
This provides some extra metadata for CPack and related tools.
2022-05-17 22:12:44 +02:00
Martin Hořeňovský
dcafc605f3
Only reseed the internal RNG when a test is first entered
This fixes multiple issues with random generators, with the most
important one being that multiple nested generators could return
values from the same sequence, due to internal implementation
details of `GENERATE`, and how they interact with test case
paths.

The cost of doing this is that given this simple `TEST_CASE`,
```cpp
TEST_CASE("foo") {
    auto i = GENERATE(take(10, random(0, 100));
    SECTION("A") {
        auto j = GENERATE(take(10, random(0, 100));
    }
    SECTION("B") {
        auto k = GENERATE(take(10, random(0, 100));
    }
}
```

`k` will have different values between running the test as
a whole, e.g. with `./tests "foo"`, and running only the "B"
section with `./tests "foo" -c "B"`.

I consider this an acceptable cost, because the only alternative
would be very messy to implement, and add a lot of brittle and
complex code for relatively little benefit.

If this calculation changes, we will need to instead walk
the current tracker tree whenever a random generator is being
constructed, check for random generators on the path to root,
and take a seed from them.
2022-05-17 21:49:26 +02:00
Martin Hořeňovský
7a2a6c632f
Make Random*Generators be seedable
This is a necessary step to fix issue with combining multiple
random generators in one test case, with different section nesting.
2022-05-17 17:57:21 +02:00
Martin Hořeňovský
359cd6187d
Rename global rng() to sharedRng() 2022-05-17 15:43:23 +02:00
Martin Hořeňovský
9c72b303d9
Reseed global rng instance unconditionally 2022-05-17 12:35:34 +02:00
Martin Hořeňovský
6044f021cf
Don't reseed std::srand when resetting rng state
We no longer use `std::rand` anywhere, so there is no point,
and it might even interfere with our users use of `std::(s)rand`.
2022-05-17 11:54:19 +02:00
Martin Hořeňovský
5d7883b551
Remove leftover comment in tests 2022-05-16 21:50:52 +02:00
Martin Hořeňovský
04a54b0e87
Fix release automation script 2022-05-16 18:39:01 +02:00
Martin Hořeňovský
48f3226974
Add support for retrieving generator's element as string 2022-05-16 16:34:06 +02:00
Martin Hořeňovský
af8b54ecd5
Generators now keep track of the index of current element
This might become potentially useful in the future, when we want
to provide the ability to forward jump generators, to be able to
simply reproduce specific input to a test.

I am not yet sure how it would work, but the basic idea is that
it could be similar to the `-c` switch for selecting specific
`SECTION` in a test case.
2022-05-16 11:56:21 +02:00
Martin Hořeňovský
07bec74096
Use better instruction for CATCH_TRAP on ARM Macs
The old instruction would cause the debugger to be stuck at the
triggering source line forever, while the new one should have the
expected semantics, where the debugger can then single-step,
continue. or generally do things, afterwards.

Closes #2422
2022-05-15 23:22:00 +02:00