1
0
mirror of https://github.com/catchorg/Catch2.git synced 2025-07-15 23:56:07 -04:00

72 Commits

Author SHA1 Message Date
ceed26842b fix(python): fix invalid escape sequences 2025-06-24 15:32:27 -06:00
74fcff6e5b Use Start-BitsTransfer for downloading OpenCppCoverage instead
The old `Start-FileDownload` was no longer recognized by the pswh
version on my local machine, this updates the OpenCppCoverage install
script to use a still usable cmdlet.
2025-05-02 22:58:36 +02:00
371b11b5a8 Modernize tools/misc/CMakeLists.txt 2025-04-26 22:46:13 -06:00
8039e3ea1e Prevent unnecessarily finding C compiler 2025-04-26 12:05:22 -06:00
5c97a8583d Use more modern -S for specifying CMake source dir 2025-04-26 10:59:42 -06:00
8cfca70ae8 Fix formatting of CMake files
2 spaces seems to be the more common indentation level so that's what
I unified around.
2025-04-26 10:38:36 -06:00
232e893785 Downgrade required CMake to 3.16
We still want to build VS 2017 through AppVeyor, and those images
have CMake 3.16.2 installed. We could install newer CMake as part
of the build, but since we don't use newer CMake features yet, this
is simpler.
2025-01-05 23:45:00 +01:00
7d7b2f89f2 Support adding test tags as CTest labels in catch_discover_tests
We also bump the minimum CMake version to 3.20 as per 
2025-01-05 20:02:00 +01:00
77eca4e819 Simplify instructions by not changing directories for the ctest command 2024-09-13 14:45:04 +02:00
efb39689d9 Add test for handleFatalErrorCondition within JUnit reporter 2024-04-21 21:52:33 +02:00
b20b365fd2 releaseCommon: fix SyntaxWarning: invalid escape sequence '\s' 2024-03-01 21:24:45 +01:00
1648c30ec3 Look just for 'Catch2 X.Y.Z' in doc placeholder update 2023-12-11 00:52:22 +01:00
85eb4652b4 Add nice license headers to files in examples/ and fuzzing/
Related to 
2023-08-24 16:34:31 +02:00
5bba3e4038 Edited amalgamated file generator, to block REUSE from getting confused
It struggled with the copyright lines included as string literals.
2023-08-19 14:31:27 +02:00
46539b6d9b Fix spelling 2023-04-29 12:55:51 +02:00
a209bcfb54 Update build instructions in contributing.md
We now show the more modern `-S {source}` instead of the old and
undocumented `-H{source}` CMake flag, and also show the available
presets, instead of individually specifying the different testing
options.

Closes 
2023-02-22 20:11:45 +01:00
ac93f19437 Improved path normalization in approvalTests.py
Instead of redoing the whole line where path was found, only the
directory part of the path is removed, instead of removing all
of the line before the path starts.

This results in slight change in how junit and sonarqube approvals
come out, and significant change in how TeamCity reporter approvals
come out. This latter difference is the reason for the change,
as now the lines with `testFailed` and `testIgnored` messages
are not completely butchered.
2023-01-01 20:27:59 +01:00
297a17593f Cleanup the helper scripts
* Remove from __future__ import print_function, because we
  no longer support Python2.
* Clean out unused parts of tools/scripts/scriptCommon.py
* Move appveyorMergeCoverageScript to Python3
* Update user reporting in *release scripts
* Cleanup module imports
2022-11-06 21:23:16 +01:00
0c75caf77b Don't write ApprovalTests' temporary files into the source tree
This has two effects:
 1) This significantly improves the performance of ApprovalTests
    run in WSL, because running the massively multi-reporter
    test would cause lots of small and parallel writes across the
    WSL-Windows FS boundary, completely mudering performance.

 2) ApprovalTests can be run from multiple build dirs in parallel,
    as long as they do not fail. However, if they do fail,
    the multiple runs will still step on each other toes when
    writing the unapproved files for user.
2022-11-06 00:11:38 +01:00
f1084fb309 Fix references to license file
The license file was renamed with 6a502cc2f5
2022-10-28 11:30:15 +02:00
6a9bf2e0af meson cleanups with muon ()
* meson: run through muon's fmt to fix formatting

* meson: switch arrays to files

Allows muon to alphabetically sort files. switch headers back to arrays
as split() can only be used on strings.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-10-03 17:23:38 +02:00
980c20694e Don't expose header windows.h in catch_all.hpp ()
* Don't expose header windows.h in catch_all.hpp
* Fix generateAmalgamatedFiles.py
2022-10-03 15:36:37 +02:00
4db8b50aab Add support for building with Meson ()
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
fa9416426a Refactor shared args in approvalTests.py 2022-06-14 23:42:00 +02:00
338e4ec1f8 Force disable console colours for tests that regex check output
Fixes 
2022-06-14 23:24:06 +02:00
abb669d4fd Extend project call for Catch2
This provides some extra metadata for CPack and related tools.
2022-05-17 22:12:44 +02:00
04a54b0e87 Fix release automation script 2022-05-16 18:39:01 +02:00
d9b0a38f81 Report Catch2's version in the xml reporter output 2022-05-03 19:46:35 +02:00
423e1d2ebb Integrate the new reporter specs into Catch2
This means that the CLI interface now uses the new key-value oriented
reporter spec, the common reporter base creates the colour implementation
based on the reporter-specific configuration, and it also stores the
custom configuration options for each reporter instance.

Closes  as it allows per-reporter forcing of ansi colour codes.
2022-04-07 12:50:08 +02:00
72f0372664 Add tests for CMake configure toggles passing to Catch2 build 2022-02-20 19:32:30 +01:00
33ffc3b6fc Allow passing compile-time configuration options through CMake 2022-02-18 11:15:08 +01:00
7a2f9f4633 Extend checkLicense.py to also check tests 2022-01-29 13:10:54 +01:00
4ff8b27bb6 Cleanups output normalization in ApprovalTests
Removed:
 * NaN normalization
 * INFINITY normalization
 * errno normalization
 * Completely unused duration regex

Tests using these macros should be tagged `[approvals]`
so they are not run as part of approval tests.

Also simplified regex for the test's executable filename,
and hidden some tests relying on nullptr normalization.
2022-01-27 21:11:51 +01:00
dc86d51af2 Update version string to mention Catch2 2022-01-27 20:15:05 +01:00
ccd67b293d Add support for multiple parallel reporters
This requires a bunch of different changes across the reporter
subsystem.

* We need to handle multiple reporters and their differing
  preferences in `ListeningReporter`, e.g. what to do when
  we mix reporters that capture and don't capture stdout.
* We need to change how the reporter is given output and
  how we parse reporter's output destination from CLI.
* Approval tests need to handle multireporter option
2022-01-01 14:02:23 +01:00
cde26de803 Add buildAndTest.cmd for Windows users ()
* Add buildAndTest.cmd for Windows users

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
2021-12-18 23:52:35 +01:00
d30d0c01a7 Disable JIT debug for ctest.ext
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-12-16 12:17:52 +01:00
c097609115 Cleanup release scripts a bit 2021-12-02 11:48:50 +01:00
9d6fffb922 Remove no longer used Python scripts 2021-12-02 11:48:28 +01:00
c4df47c246 Approvals normalize paths with both backward and forward slash 2021-11-13 22:10:25 +01:00
de67278e14 JUnit reporter uses only 3 decimal places when reporting durations
We used to use whatever precision we ended up having from C++'s
stdlib. However, some relatively popular tools, like Jenkins,
use Maven SureFire XML schema to validate JUnit test reports, and
Maven SureFire schema requires the duration to have at most 3
decimal places.

For compatibility, the JUnit reporter will now respect this
limitation.

Closes 
2021-10-10 22:10:48 +02:00
23760327ae Fix updateVersionPlaceholder when the placeholder starts the line 2021-05-09 18:05:27 +02:00
037ddbc75c Fix introduced in version placeholders
Resolves 
2021-03-13 10:26:12 +01:00
29050daec0 Add Linux and Windows CI builds with surrogate TUs 2021-02-19 23:23:00 +01:00
ba81505168 Do not match exact amount of spaces for errno macro expansion in approvalTests.py
E.g. musl libc expands errno() to __errno_location() without a space between, glibc has 1 space.
2021-01-08 11:31:28 +01:00
851a0e907e Make scripts executable 2020-11-10 15:22:15 +01:00
d913837a5d Adds license check in CI 2020-11-10 00:51:24 +02:00
39e13bf530 Adds duplication check for source files in CI 2020-11-07 21:35:41 +02:00
f797ae7a8f Bump OpenCppCoverage to 0.9.9.0
Also modified the AppVeyor script to account for changes in what
happens to PATH with the new installer.

Closes 
2020-10-29 13:39:35 +01:00
40b9df567f Add missing cmake option to fix buildAndTest.sh
Note that the documentation was updated automatically, by running:
 ./tools/scripts/updateDocumentSnippets.py
2020-10-28 11:38:06 +01:00