Commit Graph

2753 Commits

Author SHA1 Message Date
Martin Hořeňovský
17e09be3b9
Fix stupid (C4800) warning 2019-01-13 19:01:12 +01:00
Martin Hořeňovský
1c99b0ff81
Minor cleanup in decomposer 2019-01-13 16:23:20 +01:00
Martin Hořeňovský
64a0f466ec
Add missing noexcept in move constructors
Because both copy and move operations are trivial, this doesn't
actually change anything, but it silences a static analysis warning.
2019-01-13 16:17:42 +01:00
Axel Huebl
47602ac556 RunContext: Uninit Member
Fix an uninitialized member in `RunContext`.

Found with coverity in a downstream project.
2019-01-13 10:26:47 +01:00
Axel Huebl
d1e7344f16 ClockEstimate: DivByZero
The clock estimator has a potential division by zero.
Using `iteration + 1` seems also more logical to me for
an average.

Found with coverity in a downstream project.
2019-01-11 11:55:51 +01:00
NeroBurner
3ed5441067 fix ctest output with space before name
When PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME is enabled the cmake helper script fails to extract the testcase name if a whitespace is before the name string. Use regex to consider and remove this whitespace.

fix by Mike-Devel
fixes: https://github.com/catchorg/Catch2/issues/1493
2019-01-10 20:09:00 +01:00
Jozef Grajciar
bdee512057 small cleanup of code 2019-01-10 13:07:54 +01:00
Axel Huebl
188b3e6511 hexEscapeChar: restore stream
The ostream passed as reference to `hexEscapeChar` is manipulated
and its original state not restored. This fixes it.

Seen via coverity in a downstream project.
2019-01-10 13:05:36 +01:00
Antonio Mallia
bbf70ca74b Missing <type_traits> include 2019-01-10 12:52:15 +01:00
NeroBurner
23f023f9ed cpp higlighting for test-cases-and-sections.md
add c++ highlighting for the last two examples, all others already have highlighting
2019-01-10 12:29:21 +01:00
Martin Hořeňovský
c1720d0c42
Fix assert message
I messed up copy-paste when modifying the assert messages in last
commit.
2019-01-03 10:14:15 +01:00
hbina4326
d54c2258e0 Add additional static_assert for the REQUIRE(a == b && c == d) case 2019-01-02 22:44:54 +01:00
BiCapitalization
b3faceede2 Add nice error messages for unsupported && and ||
As explained in issue #1273, `operator&&` and `operator||` should give
a proper compile time error on use instead of the compiler complaining
about them not being defined. This commit adds an `always_false` type in
`catch_meta.hpp` used for implementing a nice `static_assert` for both
of the abovementioned operators.

Closes #1273
2019-01-01 19:13:47 +01:00
Uilian Ries
e7fce90b49 Force to install Conan 1.10.2
- Conan Package Tools is not ready for Conan 1.11.x

Signed-off-by: Uilian Ries <uilianries@gmail.com>
2019-01-01 12:22:11 +01:00
Khem Raj
799c7a2eed Remove redundant move to avoid Wredundant-move with Clang
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2018-12-29 22:56:37 +01:00
Martin Hořeňovský
9bc15939a5
Don't use exception-related std:: functions with -fno-exceptions
This doesn't cause trouble with GCC/Clang and libstdc++, but IAR
and its stdlib apparently doesn't compile when you use `fno-exceptions`
and `std::current_exception`/`std::rethrow_exception`.

Fixes #1462
2018-12-18 20:19:39 +01:00
Martin Hořeňovský
461843b1f0
Merge pull request #1468 from JoeyGrajciar/template_product_test_case
Template product test case
2018-12-10 11:39:26 +01:00
Jozef Grajciar
5b4ffd3c93 Docs: added docs for TEMPLATE_PRODUCT_TEST_CASE 2018-12-10 08:24:08 +01:00
Jozef Grajciar
21a1cd5683 Template tests: added TEMPLATE_PRODUCT_TEST_CASE
support for generating test cases based on multiple template template
types combined with template arguments for each of the template template
types specified

e.g.
```
TEMPLATE_PRODUCT_TEST_CASE("template product","[template]",
			   (std::tuple, std::pair, std::map),
			   ((int,float),(char,double),(int,char)))
```
will effectively create 9 test cases with types:
std::tuple<int,float>
std::tuple<char,double>
std::tuple<int,char>
std::pair<int,float>
std::pair<char, double>
std::pair<int,char>
std::map<int,float>
std::map<char,double>
std::map<int,char>

Tested type is accessible in test case body as TestType
Unique name is created by appending ` - <index>` to test name
since preprocessor has some limitations in recursions

Closes #1454
2018-12-10 08:22:09 +01:00
Uilian Ries
4902cd7215 #926 Fix Conan package reference
- Package channel should be changed automatically when
  matching the stable branch pattern
- Update Bintray upload address

Signed-off-by: Uilian Ries <uilianries@gmail.com>
2018-11-28 19:55:47 +01:00
offa
18ff34788c Deprecated 'sudo: false' removed from travis config. 2018-11-26 22:51:23 +01:00
Martin Hořeňovský
d0de666362
Merge pull request #1458 from ndusart/cppcodec
Add cppcodec in opensource users
2018-11-26 21:11:51 +01:00
Martin Hořeňovský
6ccd467094
v2.5.0 2018-11-26 20:50:38 +01:00
Martin Hořeňovský
34dcd2c436
Remove remains of the old conan things from release script 2018-11-26 20:47:40 +01:00
Martin Hořeňovský
16656c4c9e
Update the release process documentation 2018-11-26 20:41:14 +01:00
Nicolas Dusart
862955d657
add cppcodec in opensource users 2018-11-26 11:49:14 +01:00
Martin Hořeňovský
df019cc113
Turn "deprecations" into "deprecations and planned changes"
This captures the intent better, as some changes are indeed plain
deprecations leading to removal, but other changes can be viewed
as minor tune-ups instead.
2018-11-24 18:04:56 +01:00
Martin Hořeňovský
695e6eafc5
Merge pull request #1448 from catchorg/dev-redo-capturer-parsing
Fix CAPTURE macro for nontrivial uses
2018-11-21 21:21:03 +01:00
Martin Hořeňovský
59087f74d9
Fix CAPTURE macro for nontrivial uses
The previous implemetation was just plain broken for most of
possible uses, the new one should work (even though it is ugly
as all hell, and should be improved ASAP).

Fixes #1436
2018-11-21 16:48:09 +01:00
Martin Hořeňovský
62460fafe6
Merge pull request #1443 from uilianries/feature/conanio
Conan recipe Update + Conan package upload
2018-11-19 15:34:40 +01:00
Uilian Ries
ac0a83a35d Update Conan recipe
- Apply new conventions introduced on Conan 1.8
- Removed outdated settings
- Update license to follow SPDX format

Closes #926
Closes #943
2018-11-19 15:27:47 +01:00
Martin Hořeňovský
77f29c2f1c
Add more deprecations 2018-11-17 21:13:56 +01:00
Martin Hořeňovský
c6a89f14c2
Add std::isnan polyfill, fixing compilation under Embarcadero
Fixes #1438
2018-11-17 20:52:18 +01:00
Martin Hořeňovský
a9d5b7193d
Add note about release signing to release docs 2018-11-17 14:41:34 +01:00
Martin Hořeňovský
396e0951c8
Add ToC to "Test cases and sections" documentation 2018-11-17 11:09:15 +01:00
Martin Hořeňovský
68860ff129
Add deprecations documentation 2018-11-17 11:08:38 +01:00
Martin Hořeňovský
99b37a4c62
Merge pull request #1445 from thecppzoo/master
operator<< works from the global namespace
2018-11-17 10:36:37 +01:00
Martin Hořeňovský
1dccd26de7
Fix link in documentation 2018-11-17 10:21:46 +01:00
thecppzoo
3f3238edf0
operator<< works from the global namespace
Since https://github.com/catchorg/Catch2/pull/1405 was merged and propagated to the single include declaring a user operator<< in the global namespace makes it available to Catch2 string converters.
2018-11-16 16:45:13 -08:00
Martin Hořeňovský
450dd0562b
Merge pull request #1437 from JoeyGrajciar/type_params_tests_v2
Type parametrised test cases v2
2018-11-16 21:24:19 +01:00
Martin Hořeňovský
00d4f5d3c6
Add documentation for templated tests 2018-11-16 21:21:30 +01:00
Jozef Grajciar
2d906a92cb Add support for templated tests
This adds support for templated tests and test methods via
`TEMPLATE_TEST_CASE` and `TEMPLATE_TEST_CASE_METHOD` macros. These
work mostly just like their regular counterparts*, but take an
unlimited** number of types as their last arguments.

* Unlike the plain `TEST_CASE*` macros, the `TEMPLATE*` variants
require a tag string.

** In practice there is limit of about 300 types.
2018-11-16 21:21:23 +01:00
Jozef Grajciar
489a41012e ConsoleReporter: minor formatting fix
PASSED will now appear on the same line as filename and line number,
just like the case with FAILED message formatting
2018-11-10 19:35:25 +01:00
Martin Hořeňovský
eccbffec0f Add MSVC warning 5038 (Wreorder equivalent) to CMakeLists 2018-11-05 20:07:33 +01:00
Martin Hořeňovský
c51f2edfb1 Make TestEventListenerBase register all verbosities
This is a temporarily workaround until we can nuke the current
verbosities system from the orbit and replace it with something
actually sane.

Fixes #1426
2018-11-05 20:05:17 +01:00
Martin Hořeňovský
de6bfb5c25 Remove obsolete comment 2018-11-05 20:05:17 +01:00
Antonio Borondo
87950d9cfa Fix Cute test framework URL 2018-11-05 19:38:37 +01:00
Martin Hořeňovský
d0eb9dfb9b Remove unused partial specialization for MatcherMethod<T>
No matcher actually uses it, and there is no good reason for it,
as the best it can do for user is removing a single indirection
when using the pointer inside the matcher. Given the overhead of
other code that will be running during such time, it is completely
meaningless.

This also fixes compilation for PredicateMatcher<const char*>.
2018-11-04 00:00:36 +01:00
Martin Hořeňovský
03d122a35c v2.4.2 2018-10-26 21:14:16 +02:00
Martin Hořeňovský
1d9b506e39 Add documentation for some miscellaneous and less important macros
Fixes #1367
2018-10-26 20:50:32 +02:00