Commit Graph

3222 Commits

Author SHA1 Message Date
Martin Hořeňovský
1715b6b923
Check for Windows instead of WIN32 for wmain entry point
Closes #1849
2020-02-03 09:33:42 +01:00
Martin Hořeňovský
f20a9dbc6e
Fix significant bug with storing composed matchers
Given that in the 2 or so years that matchers are thing nobody complained,
it seems that people do not actually write this sort of code, and the
possibility will be removed in v3. However, to avoid correctness bugs,
we will have to support this weird code in v2.
2020-02-01 21:06:07 +01:00
Martin Hořeňovský
273c3f85eb
Add missing ToC entry in release notes 2020-02-01 20:24:53 +01:00
Martin Hořeňovský
6a3d0dc176
Add a test for custom debug break macros
See #1846
2020-02-01 20:18:05 +01:00
khyperia
ccb1f70629 Make CATCH_BREAK_INTO_DEBUGGER be user-configurable 2020-02-01 17:01:50 +01:00
khyperia
4a5bc0f39a Make CATCH_BREAK_INTO_DEBUGGER be user-configurable 2020-02-01 12:20:40 +01:00
Rosen Penev
f96e89e016
catch_compiler_capabilities.h: use proper math define
C++11 math requires _GLIBCXX_USE_C99_MATH_TR1 to be true with gcc/clang.

Also fixes an issue with uClibc-ng where __UCLIBC__ is defined in features.h but
that is not included here and is thus no-op.
2020-01-31 22:20:59 -08:00
dmsteck
481f54b357
Make hidden tags behave identically (#1847)
Add both `[.]` and `[!hide]` tags when registering a hidden test case, as per documentation.

Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
2020-01-31 21:44:06 +01:00
offa
2d172dc688 Some refactorings:
- Overrides added
 - usages of push_back() replaced with emplace_back()
 - Loop variable made const-refernce
 - NULL replaced with nullptr
 - Names used in the declaration and definition unified
 - size() replaced with empty
 - Identical cases merged
2020-01-25 09:01:04 +01:00
Daniel Griscom
587a20b312 Removed unneeded 'using uchar = unsigned char' 2020-01-24 14:26:22 +01:00
Martin Hořeňovský
bff44f8b01
Merge pull request #1831 from matt77hias/master
Added <random> include for std::uniform_int_distribution
2020-01-14 14:05:50 +01:00
Matthias Moulin
4ea74ff966
Added <random> include for std::uniform_int_distribution 2020-01-14 12:48:09 +01:00
Martin Hořeňovský
d10b9bd02e
v2.11.1 2019-12-28 21:24:04 +01:00
Martin Hořeňovský
55794e9b27
Avoid detecting Clang as having MSVC's traditional preprocessor
Fixes #1806
2019-12-28 18:57:24 +01:00
ptc-tgamper
fa6211bfc2 catch_debugger.h - implement break into debugger assembler instructions for iOS 2019-12-23 21:26:13 +01:00
ptc-tgamper
4e90f910dc catch_console_colour.cpp - adjust useColourOnPlatform for iOS 2019-12-23 21:26:13 +01:00
ptc-tgamper
0c59cc83cf catch_debugger.cpp - debugger detection is identical on Mac OS X and iOS 2019-12-23 21:26:13 +01:00
Martin Hořeňovský
e4004e0adb
Provide const overload of ObjectStorage::stored_object()
Fixes #1820
2019-12-23 21:22:32 +01:00
Joe Burzinski
6c9a255dc2 Fix forwarding in SingleValueGenerator and generator creation
Fixes #1809
2019-12-15 20:50:43 +01:00
Joe Burzinski
9a8963133f Update single header generation script to warn about unused headers 2019-11-21 16:22:04 +01:00
Joe Burzinski
cfba9dce97 Fix wrong namespacing of benchmarking constructor helpers 2019-11-21 16:22:04 +01:00
Martin Hořeňovský
a537ccae22
Suppress using-namespace lint in GENERATE* macros
Closes #1799
2019-11-16 17:39:28 +01:00
Martin Hořeňovský
e1c9d5569d
v2.11.0 2019-11-15 15:06:17 +01:00
Martin Hořeňovský
d512decaac
Mention the sonarqube reporter in release process 2019-11-15 14:59:35 +01:00
Martin Hořeňovský
f23f96883a
Ensure the full benchmarking support is present in the single header
Fixes #1800
2019-11-15 11:59:43 +01:00
Martin Hořeňovský
d7b8c3ace3
Minor cleanup in the benchmarking tests 2019-11-15 11:59:35 +01:00
Martin Hořeňovský
32733e08c0
Use newer version of Python on AppVeyor 2019-11-13 20:58:15 +01:00
Martin Hořeňovský
930f49a641
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
2019-11-05 23:28:47 +01:00
Martin Hořeňovský
c409dccee5
Cleanup tests for C++20 2019-11-04 10:42:34 +01:00
Martin Hořeňovský
95bfb33167
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.
2019-11-04 00:05:35 +01:00
Martin Hořeňovský
59d2d08c0f
Merge pull request #1794 from cericks0n/patch-1
Fix error when period of steady_clock is not nano
2019-11-03 18:22:56 +01:00
cericks0n
fa6d52e2a3
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>.
2019-11-01 15:52:38 -05:00
Martin Hořeňovský
5ac348cd6e
Fix compilation error in examples 2019-10-31 16:08:37 +01:00
Martin Hořeňovský
776a4686c7
Warning fixes in examples and tests 2019-10-31 14:29:59 +01:00
Martin Hořeňovský
3136c4fb6a
Refactored XMLWriter to provide finer-grained control over formatting 2019-10-29 13:59:18 +01:00
Martin Hořeňovský
74e0e737a6
Remove useless test 2019-10-29 11:44:24 +01:00
Martin Hořeňovský
0685216175
Mark type erasure in PredicateFunction as deprecated 2019-10-28 15:15:13 +01:00
Martin Hořeňovský
fc320f6b8f
Extract FunctionReturnType to catch_meta.hpp 2019-10-28 15:15:13 +01:00
Martin Hořeňovský
5290d4bedc
Merge pull request #1791 from catchorg/dev-reorganize-warning-suppression
Rework how warning suppression in macros is done
2019-10-28 13:13:23 +01:00
Martin Hořeňovský
7ada02e21e
Avoid technically UB type punning when determining endianness 2019-10-27 22:07:10 +01:00
Martin Hořeňovský
849f2848bd
Rework how warning suppression in macros is done
Previously, each warning suppression was self-contained, with its
own pair of `SUPPRESS_X_WARNING` and `UNSUPPRESS_X_WARNING` macros.
This had the obvious advantage of being self-containing, but it
also meant that if we needed to suppress more than one warning
in a single place, then we would manipulate the compiler's warning
state multiple times, even though logically we would only need one
layer.

The new way of suppressing warnings in macros is to push compiler's
warning state with `CATCH_INTERNAL_START_WARNINGS_SUPPRESSION` macro,
then disable whatever macros we need with the
`CATCH_INTERNAL_SUPPRESS_X_WARNINGS` macro, and then return to the
previous state using `CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION`.
2019-10-27 21:07:21 +01:00
Alexander Stein
2fbd66c51c Improve JUnit failure report
The JUnit report is improved in that:
* The message shows the testing condition, not the result
* The actual message has similar output than the console one
2019-10-27 18:02:14 +01:00
sp-dani-garcia
51b29ced1a Add SonarQube Generic Test Data reporter
It outputs reports in the `Generic Execution Test Data` format, see
https://docs.sonarqube.org/latest/analysis/generic-test/, specifically
https://docs.sonarqube.org/latest/analysis/generic-test/#header-2

Close #1738 (this is a cherry-pick and fixup of that PR)
2019-10-27 10:02:41 +01:00
Martin Hořeňovský
9a558171d8
Merge pull request #1776 from mvd4/bugfix/enable-floating-point-ranges
Enable floating point ranges
2019-10-27 09:17:15 +01:00
Martin Hořeňovský
c5c688820c
Document that matcher combinators (&&, ||, !) do not take ownership
Closes #1781
2019-10-26 21:07:38 +02:00
Martin Hořeňovský
6a08225863
Add documentation for floating point range generator 2019-10-26 20:52:40 +02:00
Manuel Drews
4327baba40 Enable range generator for floating point types 2019-10-26 20:52:09 +02:00
Martin Hořeňovský
50cc14c94c
Rework StringRef interface and internals
Now it no longer tries to be this weird hybrid between an owning
and non-owning reference, and is only ever non-owning. This is also
reflected in its interface, for example `StringRef::isNullTerminated`
is now public, and `StringRef::c_str()` has the precondition that it
is true.

Overview of the changes:
* The `StringRef::m_data` member has been completely removed, as it
had no more uses.
* `StringRef::isSubstring()` has been made public and renamed to
`StringRef::isNullTerminated()`, so that the name reflects what the
method actually does.
* `StringRef::currentData()` has been renamed to `StringRef::data()`,
to be in line with common C++ containers and container-alikes.
* `StringRef::c_str()` will no longer silently make copies. It instead
has a precondition that `isNullTerminated()` is true.
* If the user needs a null-terminated string, they should use the
`std::string` conversion operator and call `c_str()` on the resulting
`std::string`.
* Some small optimizations in various places.
* Basic functionality is now `constexpr`.
2019-10-25 13:57:52 +02:00
Jozef Grajciar
87b745da66
v2.10.2 2019-10-24 18:41:25 +02:00
Martin Hořeňovský
7d0b205564
Prevent warning suppression from leaking when registering a listener 2019-10-22 00:10:01 +02:00