Commit Graph

4466 Commits

Author SHA1 Message Date
Mike Crowe
4db8b50aab
Add support for building with Meson (#2530)
The Meson[1] build system makes it easier incorporate third-party
libaries into a project if they also build using Meson.

Let's add a minimal Meson build that's compatible with the CMake build,
along with a GitHub workflow to check that it builds and that at least
the simplest SelfTest runs.

The handling of catch_user_config.hpp is inspired by BUILD.bazel and
doesn't attempt to support any configuratons options. Such features
could be added later.

Meson strongly discourages using wildcards to specify sources, so the
source and header lists are copied from CMakeLists.txt.

Add a new test workflow to test the Meson builds. I was unable to get
these tests to pass with Ubuntu 20.04, so they use Ubuntu 22.04.

I'm neither a CMake nor a Meson expert, but the results seem to work for
me.

[1] https://mesonbuild.com/

Co-authored-by: Mike Crowe <mcrowe@brightsign.biz>
2022-10-01 23:28:30 +02:00
Sergey Evsegneev
4a7cefe601 Unused variable removed 2022-09-28 16:02:10 +02:00
Vertexwahn
243cf71608 Make Bazel work with CATCH_CONFIG_SHARED_LIBRARY 2022-09-27 22:06:12 +02:00
Vertexwahn
4bb7e02a9c Bazel build: Update of skylib 2022-09-27 22:06:12 +02:00
Rutayan Patro
97d0b1e00e
Suppress clang-tidy warnings for TEMPLATE_TEST_CASE (#2536)
* Suppress clang-tidy *-avoid-c-arrays for TEMPLATE_TEST_CASE
* Made globalRegistrar `const` to avoid `cppcoreguidelines-avoid-non-const-global-variables`

Fixes #2095
2022-09-26 18:07:50 +02:00
Dimitrij Mijoski
c0e582e659 Fix building as shared library with MSVC. 2022-09-24 15:15:50 +02:00
Björn Schäpers
0de60d8e7e Suppress -Wuseless-cast Warning
Fixes #2520.
2022-09-22 21:00:05 +02:00
Zhi Wang
d6bbd3fdef warning: storage class is not first
This pull request fixes the warning issued by `nvc++`
(the C++ compiler in Nvidia HPC SDK/PGI),
and is similar to pull request #1717.
2022-09-21 20:14:12 +02:00
Dimitrij Mijoski
98d37da03e
Raise the minimum CMake version to 3.10 (#2523) 2022-09-16 17:56:00 +02:00
Dimitrij Mijoski
4b3defe4af Suppress warning "-Wstrict-aliasing" for GCC 5 and 6 2022-09-15 13:40:16 +02:00
Dimitrij Mijoski
c75430834d Add GCC 5 and GCC 6 to CI 2022-09-15 13:40:16 +02:00
Tim Blechmann
359542d53e FileStream: enable automatic flushing
when a test executable is killed by a signal (e.g. when executed by
ctest with timeout), the reporter files are not flushed. this can lead
to incomplete (or empty) report files.
to avoid this we enable automatic flushing via `std::unitbuf`

compare #663
2022-09-11 23:49:15 +02:00
tocic
dea1a6abd9
Fix typos in docs (#2514) 2022-09-09 16:00:39 +02:00
Riom
32eae0ecce
Add missing include for VxWorks build. (#2515)
`catch_sharding.hpp` was using `std::min` without including `<algorithm>`.
This worked on most platforms, but it wasn't transitively included in
the VxWorks toolchain.
2022-09-08 10:21:36 +02:00
Martin Hořeňovský
4adf010549
Mention dynamic library stuff in the FAQ
Closes #2497
2022-09-03 22:31:29 +02:00
Martin Hořeňovský
686468d185
Explain TU as translation unit where appropriate 2022-09-03 22:22:10 +02:00
Martin Hořeňovský
7b2e7d623b
Disable Bazel's env checking on UWP
UWP does not support environment variables and so it cannot
compile code using getenv.
2022-09-02 07:11:28 +02:00
Martin Hořeňovský
3ca5cf32e5
Add CATCH_PLATFORM_WINDOWS_UWP detection macro 2022-09-02 07:10:38 +02:00
Martin Hořeňovský
dc001fa935
Allow easy retrieval of RNG seed by the users
This makes it so that they don't need parallel RNG seed passing
infrastructure for randomized data generation (e.g. inputs for
benchmarks).
2022-08-18 23:23:18 +02:00
Martin Hořeňovský
33e70194d3
Link to the randomized-shard-registration script from usage tips 2022-08-18 00:14:07 +02:00
Martin Hořeňovský
9bb206fc61
Remove obsoleted sections of ci-and-misc.md 2022-08-18 00:05:55 +02:00
Martin Hořeňovský
ab04e599e7
Improve v2->v3 migration docs 2022-08-18 00:02:33 +02:00
Damjan Jelas
47d56f28a9 Fix compatibility with cmake 3.8 2022-08-04 00:09:02 +02:00
Martin Hořeňovský
a118799631
Switch MacOS image to macos-12 in Github Actions
Also updated GCC version to GCC-11, which is packaged in the
runner image.
2022-08-03 23:54:49 +02:00
Dimitrij Mijoski
997a7d4165 Fix running the tests with shared library on Windows.
Without this fix, the test executable fails because it can not find
the dll of Catch2.
2022-07-25 21:07:49 +02:00
Haowei Hsu
2b0fd854e2 Modify the install directories into convention. 2022-07-25 10:43:41 +02:00
mheimlich
a7dc85dd49 Use DYLD_LIBRARY_PATH on apple platforms. 2022-07-23 20:45:49 +02:00
Martin Hořeňovský
97c48e0c34
v3.1.0 2022-07-17 20:18:44 +02:00
Martin Hořeňovský
9c9f35068e
Normalize C++ namespace in JUnit's reporter classname field
Closes #2468
2022-07-17 19:15:20 +02:00
Raphael Schaller
1bd233866c Add AllTrue, AnyTrue, NoneTrue matchers 2022-07-16 16:16:05 +02:00
Raphael Schaller
f993b702c6 extend gitignore 2022-07-16 16:16:05 +02:00
Martin Hořeňovský
caf1264588 Fixes for matcher testing helpers when testing bools 2022-07-16 16:16:05 +02:00
Martin Hořeňovský
a6d59b62b2
Remove obsolete link to benchmarking tests
The benchmarking feature is now documented, so there is no need
to direct our users towards our test file to understand how it
works.

Closes #2471
2022-07-15 19:49:24 +02:00
Martin Hořeňovský
cc0e91472a
Different way of checking for support of local warning suppression
Closes #2474
2022-07-15 19:34:35 +02:00
Martin Hořeňovský
3bd0c58878
Fix Wunused-variable warning for MinGW
Closes #2132
2022-07-11 22:28:15 +02:00
mheimlich
a63ad74554
Added new DL_PATHS option to catch_discover_tests() (#2467)
This enables setting the required PATH/LD_LIBRARY_PATH environment variables both when retrieving the list of text cases and when executing the tests.

Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
2022-07-11 18:31:32 +02:00
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