Commit Graph

882 Commits

Author SHA1 Message Date
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
Josef Kemetmueller
70d3c937c3 Enable breaking into debugger on Mac
The integrated assembler segment was missing an underscore:
"_asm__". Also we remove the "DEBUG" macro check, so we are consistent
with the linux and windows variant.
Now breaking into gdb on failure should work via:
	gdb --args test_executable --break
2017-01-31 16:00:42 +00:00
Martin Hořeňovský
38af8d7035 Fixed SEH deregistration on Windows
Should fix #796
2017-01-30 19:54:16 +01:00
Martin Hořeňovský
615aa071a8 Merge branch 'dev-performance-round2' 2017-01-30 13:02:48 +01:00
Martin Hořeňovský
15816c5760 Revert "use sizeof(expr) for unevaluated syntax check"
Using sizeof(expr) can trigger a compile-time error,
"lambda expressions are not allowed in an unevaluated context", when passing
expression containing lambda, like a std algorithm. This error is considered
a standard defect, as it is meant to prevent lambdas in decltype
or templates, but not in sizeof.

This reverts commit 227598af47.
2017-01-30 11:56:29 +01: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ý
60f8ebec49 Use const char* for filename in SourceLineInfo
This is sane, because those `const char*`s are given to us by compiler,
from the text area and thus we do not have to manage their lifetimes. We
also never want to change them.

Also moved copy constructor to compiler-generated methods, not sure why
it wasn't -- even before it was the same as a compiler would generate.
2017-01-29 22:03:27 +01:00
Alexander Ryabykin
02a69b449f Compilation warnings fix (#791)
* Compilation warnings fix

* Removed unused argument from reportFatal function
2017-01-27 09:32:58 +01:00
Martin Hořeňovský
c390c4cb9f Fixed inconsistent and trailing whitespace
This means that all tabs used in indentation are now 4 spaces and that
there should be no more trailing whitespace.

Ill also look into creating a pre-commit hook that will prevent this
from happening in the future.

Fixes #105
2017-01-26 23:13:12 +01:00
Martin Hořeňovský
60a9ac7e65 Enabled previous commit under MSVC, introduced new feature toggle 2017-01-26 18:47:29 +01:00
Jonathan Coe
c06afe438e Add support for comparison of Approx with strong typedefs
closes #652
2017-01-26 18:44:03 +01:00
Martin Hořeňovský
4ce11d63a6 Merge branch 'dev-performance' 2017-01-25 22:56:36 +01:00
Martin Hořeňovský
83f4b39680 Added benchmark for previous commit, added iterations to failure bench. 2017-01-25 22:39:43 +01:00
Martin Hořeňovský
b1171bd1f2 Merge branch 'dev-signals' 2017-01-25 22:09:52 +01: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
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
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
Mickey Rose
227598af47 use sizeof(expr) for unevaluated syntax check 2017-01-19 21:25:27 +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ý
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