Commit Graph

10 Commits

Author SHA1 Message Date
Martin Hořeňovský 860de28b8d Catch and register startup exceptions in autoregistrars
Previously they were registered where they would be thrown otherwise
2017-06-04 22:37:59 +02:00
Martin Hořeňovský da0edcbe25 Collect startup exceptions instead of throwing them
Previously, some errors in Catch configuration would cause exceptions to
be thrown before main was even entered. This leads to call to
`std::terminate`, which is not a particularly nice way of ending the
binary.

Now these exceptions are registered with a global collector and used
once Catch enters main. They can also be optionally ignored, if user
supplies his own main and opts not to check them (or ignored them
intentionally).

Closes #921
2017-06-04 21:39:27 +02:00
Phil Nash 4c5af2089a Added CATCH_ENFORCE (and updated CATCH_INTERNAL_ERROR to be stream based)
replaced all ad-hoc exceptions (where appropriate) with CATCH_ENFORCE or CATCH_INTERNAL_ERROR - no explicit ostringstreams.
2017-05-05 15:43:31 +01:00
Phil Nash 1f3ba8a0b6 Converted (almost) all for-loops with iterators or indices to range-based 2017-04-25 11:07:02 +01:00
Martin Hořeňovský 4597b43912 Throw instead of calling exit in RegistrarForTagAliases constructor
Caries a problem vis-a-vis Windows, just like previous commit, but that
can be fixed later on.

Closes #866
2017-03-22 18:40:07 +01:00
Phil Nash 4ec8d53e91 Tag Alias registry is part of registry hub instead of it’s own singleton
- should now be cleaned up properly
2017-03-15 09:45:37 +00:00
Martin Hořeňovský b2a6fe971b Couple more includes cleaned out 2017-02-12 12:48:25 +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 383d7c06a1 Only use std::cout/ cert via Catch::cout/ cert - and make those conditional on CATCH_CONFIG_NOSTDOUT 2014-10-02 19:08:19 +01:00
Phil Nash 1d210ebd37 Tag aliases feature 2014-06-30 07:33:17 +01:00