Commit Graph

1820 Commits

Author SHA1 Message Date
Martin Hořeňovský
b1171bd1f2 Merge branch 'dev-signals' 2017-01-25 22:09:52 +01:00
Phil Nash
6c23a6582b Mark CHECKed-throw test as [failing] 2017-01-24 09:53:04 +00:00
Phil Nash
7bcb42496d Changed exception tests to allow for now throw-from-CHECK behaviour 2017-01-23 17:56:41 +00:00
Martin Hořeňovský
184865358c CHECK no longer stops running SECTION on exception.
This seems to be much closer to desired behaviour than the current one, where
CHECK(false) lets the execution continue, but CHECK(<throws>) does not.
2017-01-23 17:52:17 +00:00
Phil Nash
225e90d8ba Don’t include tests that rely on varying two-phase-lookup behaviour in approval tests 2017-01-23 17:47:58 +00:00
Phil Nash
31c23b9489 Added [!nonportable] tag 2017-01-23 17:44:55 +00:00
Phil Nash
f347611403 Restated text format loop to avoid out-of-bounds condition 2017-01-23 16:58:49 +00:00
Phil Nash
1efd8d3067 Added missing <iterator> #include 2017-01-23 15:19:42 +00:00
Phil Nash
876af874f3 Added surrogate cpp for catch_test_case_tracker 2017-01-23 15:18:23 +00:00
Phil Nash
e7bcbb35c0 First cut of -c/—section option for running specific sections 2017-01-23 12:36:03 +00:00
Phil Nash
4a04682e49 Text formatting rework
Rewrote main wrapping loop. Now uses iterators instead of indices and intermediate strings.
Differentiates between chars to wrap before, after or instead of.
Doesn’t preserve trailing newlines.
Wraps or more characters.
Dropped support for using tab character as an indent setting control char.
Hopefully avoids all the undefined behaviour and other bugs of the previous implementation.
2017-01-23 12:28:40 +00:00
Martin Hořeňovský
9a56609569 v1.6.1 build 2017-01-20 12:49:59 +01:00
Martin Hořeňovský
81159838a5 Python scripts can now be run directly from bash 2017-01-20 12:28:40 +01:00
Martin Hořeňovský
78a2866dc7 Approval tests are now mostly Windows compatible
There are some differences in output between Catch on Windows and
Catch on Linux, that indicate a minor bug, but those have to be fixed separately.
2017-01-19 23:56:31 +01:00
Martin Hořeňovský
9acc6b9673 Approval tests now use Python std lib instead of call to diff
This needed to change to let it run on Windows as well as on the Unices
2017-01-19 22:52:47 +01:00
Martin Hořeňovský
c4b5057094 Approval tests now uses path relative to cwd, not the catch folder.
This means that bash's autocompletion is actually helpful.
2017-01-19 22:08:51 +01:00
Mickey Rose
d38b9266e7 simplify output filtering in approvalTests.py 2017-01-19 22:04:29 +01:00
Mickey Rose
227598af47 use sizeof(expr) for unevaluated syntax check 2017-01-19 21:25:27 +01:00
Martin Hořeňovský
cfaf906417 Changed documentation to use standard main function signature 2017-01-19 17:05:01 +01:00
Martin Hořeňovský
ee0ca512ea Force short-circuited evaluation for types that have overloaded &&.
This fixes #574.
2017-01-17 23:31:03 +01:00
Martin Hořeňovský
b71a06cf98 JUnit reporter outputs timestamps now
Also extended approval tests script to support the change
2017-01-16 20:21:43 +01:00
Martin Hořeňovský
531d26739f Added the new proxy header to CMakeLists.txt 2017-01-16 19:56:57 +01:00
Martin Hořeňovský
2e87f8e328 Merge branch 'windows-header-defines' of https://github.com/horenmar/Catch 2017-01-16 17:00:43 +01:00
Martin Hořeňovský
afe46ff270 Extracted NOMINMAX and WIN32_LEAN_AND_MEAN guards into a proxy header 2017-01-16 16:52:44 +01:00
Phil Nash
c65aeaf25f Clean up generator state 2017-01-16 10:34:16 +00:00
Phil Nash
750b52b814 suppress use of __COUNTER__ when being parsed by CLion (or AppCode). 2017-01-16 10:34:16 +00:00
jbo-ableton
e12fc4aca0 Fix missing CATCH_ for CHECK_THAT in prefixed macro version 2017-01-15 22:11:43 +01:00
Martin Hořeňovský
99cdc62fef Enabled CMake dev warnings in travis. 2017-01-15 22:08:12 +01:00
Martin Hořeňovský
e6ef60a2c4 CMake will now warn if a file is in folder, but not in variable 2017-01-15 22:07:36 +01:00
Vadim Zeitlin
e1c4a4bd9b Use inline assembly with gcc under Linux for CATCH_TRAP
This is more convenient than using the generic portable raise(SIGTRAP) as it
avoids having another stack frame in the debugger when the break happens.
2017-01-15 19:29:34 +01:00
Vadim Zeitlin
25d017763b Refactor CATCH_BREAK_INTO_DEBUGGER() to avoid repetition
Don't duplicate Catch::isDebuggerActive() check many times, do it just once
in CATCH_BREAK_INTO_DEBUGGER() definition and use a separate CATCH_TRAP()
macro for the really platform-dependent part.
2017-01-15 19:29:34 +01:00
Vadim Zeitlin
b634e592da Add support for breaking into debugger for Linux
Use Linux-specific /proc/$PID/status file to check whether we're being
debugged and a generic raise(SIGTRAP) to actually break into the debugger.
2017-01-15 19:29:34 +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
Martin Hořeňovský
877fd523bc Added benchmark with Mickey Rose's improvements. 2017-01-14 22:51:44 +01:00
Mickey Rose
a1e9b841ff lazily stringify expressions 2017-01-14 21:56:16 +01:00
Martin Hořeňovský
3b7511e564 First commit of benchmarks for Catch runtime perf.
So far its very much a WIP with some problems that are known already and
not very representative tests.
2017-01-14 21:55:37 +01:00
Martin Hořeňovský
ffc4a9dc14 If we receive a signal, we re-register ALL previous signal handlers.
This fixes the case when we pass signal to previously registered
handler, and it needs to transform the signal into different one.

Still problematic: What if the signal handler we replaced does not
terminate the application? We can end up in a weird state and loop
forever.

Possible solution: Deregister our signal handlers, CALL the previous
signal handler explicitly and if control returns, abort. This would
however complicate our code quite a bit, as we would have to parse the
sigaction we delegate to, decide whether to use signal handler or signal
action, etc...
2017-01-14 15:21:44 +01:00
Martin Hořeňovský
7c8b93eac3 Removed superfluous comments (bad merge after cherry pick). 2017-01-14 15:08:00 +01:00
Phil Nash
e3659cdddd Added single char version of logo 2017-01-13 18:49:49 +00:00
Phil Nash
40dbdf6cb2 Reset signals immediately after use and re-raise orginal signal instead of just exiting 2017-01-12 17:31:56 +01:00
Martin Hořeňovský
70f43d719b Added signal handling under Windows.
Only some "signals" are handled under Windows, because Windows does not
use signals per-se and the mechanics are different. For now, we handle
sigsegv, stack overflow, div-by-zero and sigill. We can also
meaningfully
add various floating point errors, but not sigterm and family, because
sigterm is not a structured exception under Windows.

There is also no catch-all, because that would also catch various
debugger-related exceptions, like EXCEPTION_BREAKPOINT.
2017-01-12 16:40:14 +01:00
Martin Hořeňovský
a281173099 Fix for sigsegv stack overflow behavior
Also stops Catch from assuming its the only signal user in the binary,
and makes it restore the signal handlers it has replaced. Same goes for
the signal stack.

The signal stack itself probably shouldn't be always reallocated for
fragmentation reasons, but that can be fixed later on.
2017-01-12 16:23:55 +01:00
Martin Hořeňovský
b3907a78e1 Added NOMINMAX and WIN32_LEAN_AND_MEAN defines before including windows.h
This stops the `windows.h` header from defining `min` and `max` macros
and including lot of Windows APIs that are not needed by Catch.
2017-01-12 16:00:02 +01:00
Phil Nash
d5360e8e29 Sorted file lists in CMakeLists.txt for easier maintainence 2017-01-12 11:54:53 +00:00
Phil Nash
9062ebe390 Removed make file (now generated from CMake) 2017-01-12 11:22:30 +00:00
Phil Nash
e6aa1f4e4e Added note on escaping names on command line to docs 2017-01-11 17:14:28 +00:00
Phil Nash
1ff0acfe22 Tweaked release notes page with better formatting 2017-01-11 16:50:35 +00:00
Phil Nash
713ec400e8 Fixed type in “Release Notes” link 2017-01-11 16:46:09 +00:00
Phil Nash
3b2f206191 v1.6.0 build - including release notes 2017-01-11 16:44:36 +00:00
Phil Nash
4e4d733f90 Added \ as escape character in test names on the command line - so you can run tests by name when they contain , or [ 2017-01-11 16:27:16 +00:00