Commit Graph

908 Commits

Author SHA1 Message Date
philsquared b1835e1de9 Moved WIndows leak detector code out of main() 2017-02-17 23:43:31 +00:00
Martin Hořeňovský 8cd413572a Merge branch 'dev-windows-leakdetection' 2017-02-17 14:25:08 +01:00
Martin Hořeňovský 30e4dbef1c Report leaks to debugger in addition to stderr
This branch should also close #120.
2017-02-17 14:22:57 +01:00
Phil Nash 90b3946e9c Add file/line to TestCase, Section and Failure elements in Xml Reporter 2017-02-17 10:26:17 +00:00
Martin Hořeňovský d8230a8d4d Add opt-in leak detection under MSVC + Windows.
Closes #439
2017-02-16 11:09:09 +01:00
Martin Hořeňovský c6178601c5 Cygwin compatibility fixes 2017-02-15 17:57:22 +01:00
Martin Hořeňovský 2e0ae01b05 Improve -Wparentheses supression for gcc
If the gcc version supports `_Pragma` properly, we use that to disable
it locally inside assertions.

Otherwise we disable it for the entire TU.

Fixes #674
2017-02-15 17:11:44 +01:00
Phil Nash fe690a68ef push/pop warnings when disabling parentheses warnings within assertion (gcc/ clang) 2017-02-15 10:03:28 +00:00
Martin Hořeňovský 3cfef738e7 Merge branch 'dev-performance-round3' 2017-02-15 10:35:01 +01:00
Martin Hořeňovský 7b13a8f85a Move debug break out of tests, speeds up compilation time
This is hidden behind CATCH_CONFIG_FAST_COMPILE
2017-02-14 15:35:12 +01: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 1400127d6f Extracted string matchers impl into cpp that is only compiled into main TU 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
Phil Nash d08cee288f v1.7.2 build 2017-02-13 16:15:42 +00:00
Phil Nash 873ef276b6 XML Reporter closes tag and flushes stream at end of TestCase and Section tags.
This fixes an issue where XML reports on stdout are broken by printf statements
2017-02-13 15:56:25 +00:00
Martin Hořeňovský bc68b9f454 More include simplifications 2017-02-13 14:12:22 +01:00
Phil Nash 67d513aa73 Removed single char contains()
- had incorrect prototype anyway
2017-02-13 08:20:45 +00:00
Phil Nash 9a3486a705 Replaced use of dynamic_cast with static_cast.
It wasn't necessary anyway.
This addresses #821
2017-02-12 22:00:17 +00:00
Martin Hořeňovský 50dee9ae57 Fixed typo in CLI error reporting 2017-02-12 13:50:15 +01:00
Martin Hořeňovský b2a6fe971b Couple more includes cleaned out 2017-02-12 12:48:25 +01:00
Martin Hořeňovský 9012f95964 Moved some std includes out from catch_common.h 2017-02-12 12:17:07 +01:00
Martin Hořeňovský d0620c3495 Added std:: qualification to some functions from C stdlib
This should solve #543, once Clara changes are in as well.
2017-02-11 23:20:09 +01:00
Phil Nash 005787f1c5 Marked IConfig implementations in Config CATCH_OVERRIDE
(silences warnings)
2017-02-10 22:39:27 +00:00
Martin Hořeňovský f75a511b5c Fix MSVC /analyze warning about inconsistent annotations 2017-02-10 17:12:41 +01:00
Phil Nash ab44fb6811 The file/ line in sections is now of the section. not the test case 2017-02-10 11:56:46 +00:00
Martin Hořeňovský 73159ace3d REQUIRE_THROWS_AS now catches exception by const&
Prevents some warnings caused by catching complex types by value.

Closes #542
2017-02-09 12:57:01 +01:00
Martin Hořeňovský 9952dda524 REQUIRE_THROWS_AS is now reported with expected type as well
Also updated tests to reflect this change.
2017-02-09 12:51:43 +01:00
Martin Hořeňovský e543cc0646 Removed an obsolete file that somehow got into the previous master. 2017-02-09 11:12:25 +01:00
Martin Hořeňovský a38ccec33a Added 3rd party bug to documentation 2017-02-08 20:53:39 +01:00
Marek Klus ab199d9cf9 XmlReporter: Trim test case name; added description and tags attributes to the test case element in the xml report. 2017-02-07 23:12:58 +00:00
Phil Nash 97d8003a71 XmlWriter can specify a stylesheet
Provide an extension point on XmlReporter to be able to supply a stylesheet url in a derived implementation
2017-02-07 23:09:43 +00:00
Phil Nash 1f271c9944 XmlWriter reverts to XML 1.0.
Character encodings that are not valid in XML 1.0 are instead written using C-style escapes
2017-02-07 22:48:06 +00:00
Martin Hořeňovský 7b8a27eadb v1.7.1 build 2017-02-07 10:06:52 +01:00
Phil Nash 2b74613c54 Revert "First cut of Evaluate refactoring to remove int specialisations, among other things"
This reverts commit 39753558eb.
2017-02-06 22:37:23 +00:00
Martin Hořeňovský 23600609c0 Deregister SEH handler before reporting SE. 2017-02-06 20:40:46 +01:00
Martin Hořeňovský 4feb2dbb50 Removed const qualification to disambiguate between operator overloads 2017-02-06 20:39:32 +01:00
Phil Nash 84af6bc955 XmllWriter flushes the stream after every endElement now 2017-02-06 16:25:36 +00:00
Phil Nash 88b760276d Revert "XmlWriter reverts to XML 1.0."
This reverts commit a189387f49.
2017-02-06 16:21:01 +00:00
Phil Nash 23eb4cc580 Added stdout and stderr to XML Reporter 2017-02-06 16:14:06 +00:00
Phil Nash a189387f49 XmlWriter reverts to XML 1.0.
Character encodings that are not valid in XML 1.0 are instead written using C-style escapes
2017-02-06 16:00:05 +00:00
Phil Nash 39753558eb First cut of Evaluate refactoring to remove int specialisations, among other things 2017-02-06 15:15:43 +00:00
Martin Hořeňovský e991c006b7 Fixes for MinGW compatibility
Some versions of MinGW do not support enough of Win32 API to let us work
with SEH, so SEH is now MSVC only (+ configurable toggle).

Also made use of gmtime_s MSVC only (as oposed to Windows only).

Fixes #805
2017-02-06 01:43:53 +01:00
Martin Hořeňovský 712323ab7c Include windows.h proxy header, instead of windows.h itself
Because the signal changes were in a different branch from the windows.h
related changes, the SEH handling code included the header directly.

Fixes #803
2017-02-03 14:09:17 +01:00
Martin Hořeňovský ce37f48ffa v1.7.0 build 2017-02-01 21:47:43 +01:00
Martin Hořeňovský f58ff0c540 Remove \l, add \f in character pretty printing
I have never head of \l and MSVC warns about unknown escape sequence, so
I changed it into \f that definitely exists and potentially might be
useful.
2017-02-01 21:31:14 +01:00
Phil Nash b524fa7cd8 Fixed bugs in escape char handling in test names
1. If escape char is first char, sets start of range
2. Multiple escape chars are handled (offsets chars to remove)
2017-02-01 14:13:20 +00:00
Eric Schmidt 5121b5b058 Put quote marks around printed characters; also nicely print some escapes 2017-01-31 21:53:36 +01:00
Jan Včelák 1e5176bd69 Cap main exit code to 255 (#797)
Changed default main to clamp exit code to 8 bits because of POSIX limitations.

Updated documentation about declaring non-default main.
2017-01-31 20:48:14 +01:00
Martin Hořeňovský 0dabd951ba expr is now cast to void in THROWS family of assertions.
This prevents Clang from complaining about unused value in expressions
containing explicit casts used in the THROW assertion macro family.

Example:
`REQUIRE_THROWS_AS(static_cast<bool>(object), std::bad_cast);` would
trigger `-Wunused-value` warning. Now it does not.

Credits to Arto Bendiken, who submitted a PR almost 3 years ago, but his
branch has since died and I was unable to merge it.
2017-01-31 18:02:11 +01:00