Commit Graph

52 Commits

Author SHA1 Message Date
Rosen Penev
6a9bf2e0af
meson cleanups with muon (#2539)
* 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
Dimitrij Mijoski
980c20694e
Don't expose header windows.h in catch_all.hpp (#2526)
* Don't expose header windows.h in catch_all.hpp
* Fix generateAmalgamatedFiles.py
2022-10-03 15:36:37 +02:00
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
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ý
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ý
04a54b0e87
Fix release automation script 2022-05-16 18:39:01 +02:00
Martin Hořeňovský
d9b0a38f81
Report Catch2's version in the xml reporter output 2022-05-03 19:46:35 +02:00
Martin Hořeňovský
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 #339 as it allows per-reporter forcing of ansi colour codes.
2022-04-07 12:50:08 +02:00
Martin Hořeňovský
72f0372664
Add tests for CMake configure toggles passing to Catch2 build 2022-02-20 19:32:30 +01:00
Martin Hořeňovský
33ffc3b6fc
Allow passing compile-time configuration options through CMake 2022-02-18 11:15:08 +01:00
Martin Hořeňovský
7a2f9f4633
Extend checkLicense.py to also check tests 2022-01-29 13:10:54 +01:00
Martin Hořeňovský
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
Martin Hořeňovský
dc86d51af2
Update version string to mention Catch2 2022-01-27 20:15:05 +01:00
Martin Jeřábek
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
Alan Jowett
cde26de803
Add buildAndTest.cmd for Windows users (#2338)
* 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
Alan Jowett
d30d0c01a7 Disable JIT debug for ctest.ext
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-12-16 12:17:52 +01:00
Martin Hořeňovský
c097609115
Cleanup release scripts a bit 2021-12-02 11:48:50 +01:00
Martin Hořeňovský
9d6fffb922
Remove no longer used Python scripts 2021-12-02 11:48:28 +01:00
Martin Hořeňovský
c4df47c246
Approvals normalize paths with both backward and forward slash 2021-11-13 22:10:25 +01:00
Martin Hořeňovský
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 #2221
2021-10-10 22:10:48 +02:00
Martin Hořeňovský
23760327ae
Fix updateVersionPlaceholder when the placeholder starts the line 2021-05-09 18:05:27 +02:00
Jozef Grajciar
037ddbc75c Fix introduced in version placeholders
Resolves #2082
2021-03-13 10:26:12 +01:00
Martin Hořeňovský
29050daec0
Add Linux and Windows CI builds with surrogate TUs 2021-02-19 23:23:00 +01:00
John Zimmermann
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
Martin Hořeňovský
851a0e907e
Make scripts executable 2020-11-10 15:22:15 +01:00
George Xanthakis
d913837a5d
Adds license check in CI 2020-11-10 00:51:24 +02:00
George Xanthakis
39e13bf530
Adds duplication check for source files in CI 2020-11-07 21:35:41 +02:00
Hannes Kaeufler
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 #2059
2020-10-29 13:39:35 +01:00
Clare Macrae
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
Clare Macrae
c6352c3e1f Embed the script buildAndTest.sh inside the docs 2020-10-28 11:38:06 +01:00
Clare Macrae
4035beb988 Add a script - buildAndTest.sh
This contains the currently-documented steps for a developer build.
Also, make git ignore its output directory.
2020-10-28 11:38:06 +01:00
Clare Macrae
8c3970465d Add infrastructure for embedding code samples in docs. 2020-10-28 11:38:06 +01:00
Martin Hořeňovský
60dfec559f
Provide 1 .hpp + 1 .cpp distribution of Catch2
This commits also adds a script that does the amalgamation of headers
and .cpp files into the distributable version, removes the old
`generateSingleHeader` script, and also adds a very simple compilation
test for the amalgamated distribution.
2020-09-09 13:02:50 +02:00
Richard Ash
a862924601
Make scripts/updateDocumentToC.py executable.
On systems where the file system has excute permissions, this script was
not marked as executable in a clean git checkout and so could be run
without first changing the permissions. Fixed by setting the relevant
git flag.
2020-07-22 21:43:16 +02:00
Martin Hořeňovský
e1a0cce82b
Remove Clara from external folder
As Clara is no longer maintained as a separate project, the
implementation was moved to the internal subfolder of top-level
folder. This removes one folder and avoids potential user confusion.

Also simplified the convenience header checking script accordingly.
2020-05-09 19:40:57 +02:00
Martin Hořeňovský
db32550898
Remove catch_default_main.hpp
There are two reasons for this:

1) It is highly unlikely that someone has use for this header,
which has no customization points and only provides simplest
possible main, and cannot link the static library which also
provides a default main implementation.
2) It being a header was causing extra complications with
the convenience headers, and our checking script. This would either
require special handling in the checking script, or would break user's
of the main convenience header.

All in all, it is simpler and better in the long term to remove it,
than to fix its problems.
2020-05-09 18:00:49 +02:00
Martin Hořeňovský
fe405034b8
Add script checking convenience header correctness 2020-05-06 17:53:39 +02:00
Martin Hořeňovský
0d8eeec557
Move all scripts to Python3 2020-04-29 21:28:52 +02:00
Martin Hořeňovský
d3c0b36487
Update wandbox script to use https endpoint and Python3 2020-04-29 21:28:34 +02:00
Martin Hořeňovský
6e270958a2
Add development build option to CMake and enable it on CI
Development build enables warnings and and `Werror` or equivalent.
2020-02-26 16:07:26 +01:00
Martin Hořeňovský
63b7d6f98e
Improve erasure of test numbers in TAP approvals 2020-02-13 14:22:18 +01:00
Martin Hořeňovský
34bc56340d
Normalize TAP approvals to avoid massive diffs for every change 2020-02-03 20:29:36 +01:00
Martin Hořeňovský
b86ab20154
OpenCppCoverage skips coverage of non-source directories
Previously, we would collect coverage data for all source files in
Catch2's directory, including tests and examples, and we would then
ask codecov.io to ignore those. With this change, OpenCppCoverage
only collects coverage data for source files in the `src/` directory.
This cuts the size of the coverage report in half, and also speeds
up the coverage collection.
2020-02-02 23:15:22 +01:00
Martin Hořeňovský
1327946785
Add all in-repo reporters to approval tests 2020-02-02 15:04:19 +01:00
Martin Hořeňovský
a7b3e087a0
Fix coverage collection on AppVeyor 2020-01-31 14:44:40 +01:00
Martin Hořeňovský
827733fe81
Improve approval tests handling off tagged devel versions 2020-01-25 11:23:40 +01:00
Martin Hořeňovský
acf975cab1
Separate version macros to its own header 2020-01-19 15:39:11 +01:00
Martin Hořeňovský
ec7280379e
Adjust release scripts for v3 2020-01-19 15:39:11 +01:00
Martin Hořeňovský
ebeeaaeec6
Reenable appveyor for CI 2019-12-16 00:15:30 +01:00