Commit Graph

3205 Commits

Author SHA1 Message Date
Daniel Griscom ab520f4e97
Removed unneeded 'using uchar = unsigned char' 2020-02-16 15:12:07 +01:00
Martin Hořeňovský 32617f42d0
Cherry-pick release notes for v2.11.1 2020-02-16 15:11:30 +01:00
melak47 17c4b2d093
Feature: generic matchers (#1843)
This commit extends the Matchers feature with the ability to have type-independent (e.g. templated) matchers. This is done by adding a new base type that Matchers can extend, `MatcherGenericBase`, and overloads of operators `!`, `&&` and `||` that handle matchers extending `MatcherGenericBase` in a special manner.

These new matchers can also take their arguments as values and non-const references.

Closes #1307 
Closes #1553 
Closes #1554 

Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
2020-02-16 11:19:10 +01:00
Martin Hořeňovský db1a0465dc
Outline GeneratorException from generators header 2020-02-14 16:15:47 +01:00
Martin Hořeňovský b2a6523d85
Fix Clang-3.8 compilation of tests
As far as I know, the compilation error is a compiler bug, but I
do not want to just drop the support for something that is trivial
to work around.
2020-02-13 16:57:37 +01:00
Martin Hořeňovský b009d190bf
Avoid detecting Clang as having MSVC's traditional preprocessor
Fixes #1806
2020-02-13 16:28:30 +01:00
ptc-tgamper ac83087bc2
catch_debugger.h - implement break into debugger assembler instructions for iOS 2020-02-13 16:28:02 +01:00
ptc-tgamper 123b449f8d
catch_console_colour.cpp - adjust useColourOnPlatform for iOS 2020-02-13 16:27:56 +01:00
ptc-tgamper 6ad743a62b
catch_debugger.cpp - debugger detection is identical on Mac OS X and iOS 2020-02-13 16:27:46 +01:00
Martin Hořeňovský 0f47fe16bd
Provide const overload of ObjectStorage::stored_object()
Fixes #1820
2020-02-13 16:26:06 +01:00
Joe Burzinski 82baef62e2
Fix forwarding in SingleValueGenerator and generator creation
Fixes #1809
2020-02-13 16:19:50 +01:00
Joe Burzinski 0fbf4f3e15
Fix wrong namespacing of benchmarking constructor helpers 2020-02-13 16:15:50 +01:00
Martin Hořeňovský ad3f50bbc1
Suppress using-namespace lint in GENERATE* macros
Closes #1799
2020-02-13 15:31:09 +01:00
Martin Hořeňovský 13e01d273a
Cherry pick v2.11.0 release notes and docs 2020-02-13 15:30:46 +01:00
Martin Hořeňovský 2788897051
Minor cleanup in the benchmarking tests 2020-02-13 15:12:57 +01:00
Martin Hořeňovský 2945b80f61
Add more constexpr to StringRef 2020-02-13 15:01:03 +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ý c50ba09cde
Split [.foo] into [.][foo] when parsing test specs
b77cec05c0 fixed this problem for tagging tests, so that a test
case tagged with `[.foo]` would be parsed as tagged with `[.][foo]`.
This does the same for the test spec parsing.

Fixes #1798
2020-02-13 13:35:10 +01:00
Martin Hořeňovský c165bd15c5
Forbid copying ReusableStringStream
Copying a `ReusableStringStream` would lead to "double free" of
the stream, and thus it could be used in multiple places at the
same time, breaking the output.
2020-02-12 19:21:15 +01:00
cericks0n 4f0de7bbad
Fix error when period of steady_clock is not nano
On systems where std::chrono::steady_clock::period is not std::nano, benchmark tests fail to compile due to trying to convert analysis.samples from a vector of duration<double, clock::period> to a vector of std::chrono::duration<double, std::nano>.
2020-02-12 19:20:41 +01:00
Martin Hořeňovský 21b24e8326
Remove catch_external_interfaces.h
Its intent was to show which headers are expected to be useable by
Catch2's users, and to enforce their inclusion in the single header
distribution at the right place.

Given the new library model, the second use case is not needed and
the first one is better served with documentation and physical file
layout.
2020-02-12 16:57:15 +01:00
Martin Hořeňovský 0b2874b6b1
Move SonarQube reporter implementation to a cpp file 2020-02-07 11:26:33 +01:00
Martin Hořeňovský e6ea53ab49
Move Automake reporter to a cpp file 2020-02-07 11:26:30 +01:00
Martin Hořeňovský 338572a4f7
Move TAP reporter implementation to a cpp file 2020-02-07 11:26:28 +01:00
Martin Hořeňovský 70836d49ba
Move include of catch_enforce out of the reporter bases 2020-02-07 11:26:24 +01:00
Martin Hořeňovský db148c42d7
Move TeamCity implementation to a cpp file 2020-02-07 11:26:21 +01:00
Martin Hořeňovský cd7d7a1c67
Remove CATCH_CONFIG_ENABLE_BENCHMARKING compilation toggle
Now that Catch2 is a proper library, we can always build the full
library (comparatively minor slowdown) and the user can avoid
including benchmarking headers to avoid the compilation slowdown.
2020-02-06 11:36:46 +01:00
Martin Hořeňovský 86e19b952d
NoAssertions runs only 1 test case instead of all of them 2020-02-04 10:11:55 +01:00
Martin Hořeňovský bce5b364d3
Unconditionally provide <chrono> StringMakers 2020-02-03 20:53:36 +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ý c3a5e21648
Move Approx out of the Detail namespace 2020-02-03 15:14:59 +01:00
offa bd9520c0f9 GCC pragma fixed. 2020-02-03 09:27:34 +01:00
Martin Hořeňovský a3ffc20f57
Provide CTest a hint on test costs (and thus ordering)
When running tests in parallel, CTest runs the tests in decreasing
order of cost (time required), to get the largest speed up from
parallelism. However, the initial cost estimates for all tests are
0, and they are only updated after a test run. This works on a dev
machine, where the tests are ran over and over again, because
eventually the estimates become quite precise, but CI always does
a clean build with 0 estimates.

Because we have 2 slow tests, we want them to run first to avoid
losing parallelism. To do this, we provide them with a cost estimate
manually.
2020-02-03 09:07:23 +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ý a49ab0a162
Do not count test files into coverage 2020-02-02 14:51:41 +01:00
Martin Hořeňovský 3b297cf9b5
Outline Config destructor to avoid including superfluous header 2020-02-02 14:43:26 +01:00
Martin Hořeňovský 66fe591477
Replace C++11 use of ::type with the _t suffix for std traits 2020-02-02 12:59:19 +01:00
Martin Hořeňovský ea6db67063
Use std::make_unique instead of our polyfill or naked new
The use we previously used the polyfill or naked new is that we
supported C++11, which did not yet have `std::make_unique`. However,
with the move to C++14 as the minimum, `std::make_unique` can be
expected to be always available.
2020-02-01 23:34:00 +01:00
Martin Hořeňovský a7b3e087a0
Fix coverage collection on AppVeyor 2020-01-31 14:44:40 +01:00
Martin Hořeňovský ddd0e7218d
Remove the !hide special tag 2020-01-28 20:48:32 +01:00
Alexandr Timofeev 49e000b505
[conan] Fix the Conan package for multiple static library use 2020-01-25 22:39:50 +01:00
Martin Hořeňovský 2e1ce37faa
Try uploading in-development versions of v3 as testing packages 2020-01-25 21:09:48 +01:00
Martin Hořeňovský d0257fc1ff
Do not use shared_ptrs for filters and patterns 2020-01-25 20:39:17 +01:00
Martin Hořeňovský df2379218b
Reduce the use of shared_ptrs for various Config objects
Ideally they would not be used at all, but the main config lifetime
is a weird mess right now and will require further refactoring.
2020-01-25 17:41:38 +01:00
Martin Hořeňovský 7134ad9913
Replace shared_ptr with unique_ptr for reporters 2020-01-25 14:07:29 +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ý 2f4a7dda68
Have the in-development version report as v3.0.0
Because some of the tooling used by Catch2 does not properly support
version postfixes, such as `preview-1`, we will report the
in-development version is `v3.0.0`, and the first real release will
have to be `v3.0.1`.

Closes #1824
2020-01-25 09:15:46 +01:00
Martin Hořeňovský 6c3a5ef625
Remove CATCH_CONFIG_DISABLE_MATCHERS
Now that the recommended distribution and usage method is proper
library, users can just avoid including the matcher headers to get
basically the same effect.
2020-01-25 09:07:36 +01:00
offa c770a9c8b5 Conan topic cleanup. 2020-01-24 15:10:43 +01:00