Commit Graph

36 Commits

Author SHA1 Message Date
Martin Hořeňovský
d08e31d89e Fix inverted CATCH_CONFIG_DISABLE_MATCHERS toggle 2017-07-29 08:43:32 +02:00
Martin Hořeňovský
0ca4cfb743 Introduce compile time toggle to remove Matchers from TU
The toggle is `CATCH_CONFIG_DISABLE_MATCHERS` and the only use is
to speed up compilation of small TUs. For large ones it is likely
insignificant, because the speed up is constant relative to
number of tests/assertions in TU.
2017-07-28 21:34:34 +02:00
Phil Nash
f0890dcdf8 removed redundant virtuals on override functions (and added a couple of overrides) 2017-07-20 16:23:52 +01:00
Martin Hořeňovský
87a66b8479 Address results of PVS-Studio static analysis
Couple are left un-addressed, see #958 for details.
2017-07-20 00:27:28 +02:00
Martin Hořeňovský
d7ff62430a Removed superfluous inline specifications 2017-07-19 13:40:00 +02:00
Martin Hořeňovský
fc32165d48 Started work on splitting out .cpp files from header files 2017-07-06 22:28:42 +02:00
Martin Hořeňovský
71df66365e Gutted catch_compiler_capabilities
All C++11 toggles are now removed. What is left is either platform
specific (POSIX_SIGNALS, WINDOWS_SEH), or possibly still needed
(USE_COUNTER).

If current CLion is compatible with `__COUNTER__`, then we should also
force `__COUNTER__` usage.

Changed
* CATCH_AUTO_PTR    -> std::unique_ptr
* CATCH_OVERRIDE    -> override
* CATCH_NULL        -> nullptr
* CATCH_NOEXCEPT    -> noexcept
* CATCH_NOEXCEPT_IS -> noexcept

Removed
* CATCH_CONFIG_CPP11_UNIQUE_PTR
* CATCH_CONFIG_CPP11_SHUFFLE
* CATCH_CONFIG_CPP11_TYPE_TRAITS
* CATCH_CONFIG_CPP11_OVERRIDE
* CATCH_CONFIG_CPP11_LONG_LONG
* CATCH_CONFIG_CPP11_TUPLE
* CATCH_CONFIG_CPP11_IS_ENUM
* CATCH_CONFIG_CPP11_GENERATED_METHODS
* CATCH_CONFIG_CPP11_NOEXCEPT
* CATCH_CONFIG_CPP11_NULLPTR
* CATCH_CONFIG_VARIADIC_MACROS
2017-04-25 12:43:19 +02:00
Phil Nash
1f3ba8a0b6 Converted (almost) all for-loops with iterators or indices to range-based 2017-04-25 11:07:02 +01:00
Phil Nash
0afd52b98d Fix Objective-C Matchers
Fixes #854
2017-03-13 15:40:21 +00:00
Phil Nash
041498b221 Fixed unintentional tabs 2017-03-06 09:23:31 +00:00
philsquared
d5a5883a10 Fixed mssing virtual destructor warnings
In Visual Studio with warning 4265 enabled
Closes #844
2017-03-06 08:59:52 +00:00
Phil Nash
d8c4512b25 Removed tabs 2017-02-22 08:26:52 +00:00
Phil Nash
45d4096756 Generalised Matchers so objects and comparators can be different types 2017-02-21 15:52:03 +00:00
philsquared
ca66dd243c Added a couple more unimplemented assignment operators to silence VS2013 warnings 2017-02-21 09:10:44 +00:00
Phil Nash
2081caa452 Import MatcherBase to Catch namespace 2017-02-14 09:16:54 +00:00
Phil Nash
a5a013811c Renamed toStringUncached -> describe 2017-02-14 09:16:54 +00:00
Phil Nash
7fed25ad1f New Matchers implementation
- simpler
- less templates and machinery
- no cloning, copying or unnecessary heap allocations
- better factored
2017-02-14 09:16:54 +00:00
Martin Hořeňovský
bcaa2f9646 Use char literal instead of string literal with 1 char
In reality, this is a relatively small performance improvement,
especially with the previous improvements removing lots of superfluous
string handling, but still was measurable.
2017-01-29 23:07:15 +01:00
Martin Hořeňovský
3b98a0166f Various small string usage performance improvements.
* Empty strings are now direct constructed as `std::string()`, not as empty string literals.
* `startsWith` and `endsWith` no longer construct new a string. This should be an improvement
for libstdc++ when using older standards, as it doesn't use SSO but COW and thus even short
strings are expensive to first create.
* Various places now use char literal instead of string literals containing single char.
** `startsWith` and `endsWith` now also have overload that takes single char.

Generally the performance improvements under VS2015 are small, as going from short string
to char is mostly meaningless because of SSO (Catch doesn't push string handling that hard)
and previous commit removed most string handling if tests pass, which is the expect case.
2017-01-15 10:05:01 +01:00
Phil Nash
b84e08ad6f Fix EndsWith Matcher (and refactored EndsWith and StartsWith in terms of endsWith and startsWith) (see Issue #573) 2016-01-22 07:59:06 +00:00
Phil Nash
722315a1f5 Removed some trailing whitespace 2015-12-04 10:20:33 +00:00
Phil Nash
d10b73f9f1 changed Not struct to a class.
- it was forward declared as a class, which caused warnings on some compilers. It should really have been a class anyway.
- this addresses the same issue as PR #534, albeit from the other angle.
2015-11-06 18:07:29 +00:00
Phil Nash
054e3c5b43 Added &&, || and ! operator overloads for matchers
(syntactic sugar for AllOf, AnyOf and Not compositional matchers, respectively)
2015-11-05 18:46:00 +00:00
Phil Nash
e91738103c Stripped trailing whitespace from all source code lines
(replaces need for PRs #310 and #504)
2015-11-04 18:04:15 +00:00
Phil Nash
d234ed1a67 dev build 13 2015-08-24 06:28:25 +01:00
Simon Warta
312b94e532 Add matcher: Not() 2015-08-12 11:07:55 +02:00
Phil Nash
72868920bb Exception message assertions now work with matchers 2015-07-15 23:02:25 +01:00
Phil Nash
f3d1f08c3b Removed all trailing whitespace
- addresses #105
2013-07-03 19:14:59 +01:00
Phil Nash
2a9d8d9e36 Changed "const X ref"s to "X const ref"s
- Brought older code up to current convention (with the help of a Python script)
2013-04-23 18:58:56 +01:00
Phil Nash
06548a5b61 Fix for #144
- string matchers now work with NULLs
2013-04-23 07:59:56 +01:00
Phil Nash
442463473d Updated obj-c bindings for new Matchers and TestCaseInfo changes 2012-12-06 08:41:38 +00:00
Phil Nash
9444bbcb7b Added AllOf and AnyOf matchers 2012-10-12 07:58:17 +01:00
Phil Nash
1c98fc98ef Added Equals matcher for strings 2012-05-24 08:27:50 +01:00
Phil Nash
2efc1146bf Reformatting 2012-05-15 07:42:26 +01:00
Phil Nash
e0dd4a5469 Sanitised some comments 2012-05-09 19:37:14 +01:00
Phil Nash
a6a40b3ba9 Added a handful of "built-in" matchers 2012-03-04 20:10:36 +00:00