Commit Graph

523 Commits

Author SHA1 Message Date
Phil Nash
7059b2cdac Added ability to show “invisibles” in strings (just tabs and newline chars, for now). 2014-04-22 18:23:42 +01:00
Phil Nash
48153e8e10 Considers endianness when printing raw memory into a string 2014-04-22 08:19:11 +01:00
Phil Nash
a020865990 Sections are, once again, eagerly entered.
When the section tracking code was rewritten a while back to simplify and iron out some bugs the order of evaluation was changed so that each new section was skipped on the first run through.
This had unwelcome consequences for some people.
This commit restores the original semantics (while maintaining the simpler, less buggy, new code).
2014-04-21 19:02:38 +01:00
Phil Nash
d7e1790347 Merge branch 'master' of https://github.com/gnzlbg/Catch
# By gnzlbg
# Via gnzlbg
* 'master' of https://github.com/gnzlbg/Catch:
  Conditionally removes usage of deprecated features

Conflicts (resolved):
	include/internal/catch_common.h
	include/internal/catch_section.hpp
2014-04-18 08:49:35 +01:00
Phil Nash
9d469b6cb5 build 37 2014-04-18 08:30:31 +01:00
Phil Nash
7303b2b60e Changed branchName to char*, as per #266 2014-04-18 08:28:52 +01:00
Phil Nash
970127e488 Removed some unnecessary core macros 2014-04-16 18:01:31 +01:00
Phil Nash
20cad7cb1d Tags beginning with a non alpha-numeric character are now disallowed.
Added !throws special tag which denotes a test case to be skipped when run with -e
(the idea being that the test case is expected to throw an exception which is not caught within a XXX_THROWS assertion).
2014-04-15 18:44:37 +01:00
Phil Nash
c5406a25bf build 35 2014-04-12 19:21:08 +01:00
Phil Nash
1bccc03213 Secondary fix for #270 (addresses same issue with CHECK) 2014-04-12 19:20:46 +01:00
Phil Nash
a176b93738 Fix for #270 (REQUIRE continues if test throws an exception).
Added test case that reproduced the bug then applied the fix.
2014-04-12 19:07:24 +01:00
Phil Nash
af8cd98f20 New version of Clara that fixes operator= issue with ref member (#265) 2014-03-24 18:15:04 +00:00
gnzlbg
ce6598599b Conditionally removes usage of deprecated features
-add macros to test for C++ version and features
to catch_compiler_capabilities.hpp
- replaces dynamic exception specifications (deprecated)
with noexcept in C++ Version >= 11
- defines defaulted copy constructor/move constructors/assignment
in C++ Version >= 11 since their implicit generation is deprecated
under some circumstances.
- fixes #259
2014-03-20 14:03:51 +01:00
Phil Nash
472dc2a61f New version of Clara
- interface changed slightly
- moved clara.h and tbc_text_format.h into “external” folder
2014-03-17 18:40:58 +00:00
Phil Nash
f9df35b12b Fixed instance of Clara::_ placeholder when using CATCH_CONFIG_RUNNER 2014-03-10 18:02:18 +00:00
Phil Nash
dd2810d60a build 30
- with Clara fix for null deref crash
2014-03-07 06:58:33 +00:00
Phil Nash
9abb27676d Fix problem (hopefully) with single source definitions from Clara
- define CLARA_CONFIG_MAIN in the right place
2014-03-06 21:53:34 +00:00
Phil Nash
fd879f7e77 Build 28
- new version of Clara
- removed command line tests
2014-03-06 08:17:24 +00:00
Phil Nash
b9fea75109 New version of Clara.
- updated command line setup with new API
- updated STITCH macros
- force embedded Clara to use Catch’s console width (but restore it after)
- remove command line tests (as these have now moved into the Clara project)
2014-03-06 08:16:06 +00:00
Phil Nash
1f1ee3c63d New version of Clara
- Clara now built with new stitch script (based on generateSingleInclude)
- also fixed python scripts for python 3 (print now a function rather than a keyword)
2014-03-01 10:38:14 +00:00
Phil Nash
1c2fbe146b build 26 2014-02-11 18:12:41 +00:00
Phil Nash
b15726beba Added #include for <memory> to Clara
- thanks again, Martin
2014-02-11 17:45:15 +00:00
Phil Nash
160b74d6c7 … and <stdexcept> 2014-02-11 17:41:11 +00:00
Phil Nash
633feaa4a6 Added #include <algorithm> to clara.h
- thanks Martin
2014-02-11 17:40:11 +00:00
Phil Nash
0dc49d1b57 Extracted stand-alone micro-library, tbc_text_format.h, from catch_text.h.
- use this version in clara.h so clara can stand alone.
2014-02-11 06:32:56 +00:00
Phil Nash
b756243935 Fixed some comments 2014-02-10 17:31:31 +00:00
Phil Nash
c98a97cf90 Tweaked Cliche macros/ names 2014-02-10 17:30:12 +00:00
Phil Nash
4554155e3d Made Clara a “Cliche” header, which will be usable independently of Catch.
- This is just a first step. It still has a dependency on catch_text.h, which also needs to be made a Cliche header.
- These then need their own homes on GitHub.
2014-02-10 17:20:30 +00:00
Phil Nash
7eb5acc183 build 25
- fix for #231
2014-01-08 17:17:31 +00:00
Phil Nash
46a1fc7615 Removed unnecessary union name 2014-01-07 17:43:18 +00:00
Phil Nash
be890d0c15 build 24 2014-01-07 17:26:59 +00:00
Phil Nash
e091018514 Fixes toString() for function pointers and added support for member function pointers.
- thanks to Malcolm Noyes for supplying sample code on which the solution here was based
2014-01-07 17:25:27 +00:00
Phil Nash
440a47011f Convert pointers to integrates when printing.
- handles function pointers that way too (otherwise printed as 1 by gcc and clang)
2014-01-04 19:12:05 +00:00
Phil Nash
e45e3a139a Clara ignores anything after a lone — (double dash)
- this allows use within an environment that appends additional arguments that Clara will otherwise reject
- generated build 23
2013-12-23 10:24:06 +00:00
Phil Nash
91ef5f7d40 build 22 2013-12-20 19:06:26 +00:00
Phil Nash
886d9d397c Reporter command line parser errors more eagerly
- show all “unrecognised option” errors
2013-12-20 19:06:02 +00:00
Phil Nash
f385a0b13d build 21 2013-12-19 18:42:25 +00:00
Phil Nash
1aa60fada9 Changed Approx::toString() to be implemented in terms of toString( double ) (as proposed in #233) 2013-12-19 18:41:55 +00:00
Phil Nash
eb760f689b Build 20 2013-12-18 08:38:33 +00:00
Phil Nash
2851b4a55a Try again with nullptr compatibility check in GCC 2013-12-14 23:04:06 +00:00
Phil Nash
9d7b77956c build 19
- fixes nullptr regression (I had accidentally left in some dev changes)
2013-12-14 22:53:28 +00:00
Phil Nash
859760abb4 Build 18 2013-12-14 14:34:05 +00:00
Phil Nash
563429d9a3 Compile in CATCH_CONFIG_CPP11_NULLPTR for some compilers 2013-12-14 14:32:26 +00:00
Phil Nash
b4625208d0 Test for FAIL that doesn’t take an argument 2013-12-14 14:30:58 +00:00
Phil Nash
274ed3ea76 Allow FAIL() to be empty 2013-12-12 23:02:31 +00:00
Phil Nash
a6d74bd55a Build 17 2013-12-11 08:28:15 +00:00
Phil Nash
0b63e0d868 Fixed warnings for platforms that don’t implement CATCH_BREAK_INTO_DEBUGGER
- as discussed in #229
2013-12-11 08:26:56 +00:00
Phil Nash
a1e87a4b7d trim test/ section names in xml reporter
- BDD-style test names have leading spaces for alignment in the console reporter
2013-12-10 08:20:46 +00:00
Phil Nash
de49ec4d7c Fixed broken single header following script change
- fixed the script (was missing #ifdefs)
- also fixed single include (Xcode) test project
- build 16
2013-12-04 20:25:14 +00:00
Phil Nash
87b20e8dab SourceLineInfo takes char*s instead of std::strings 2013-12-04 08:12:30 +00:00
Phil Nash
47a5ad3038 Normalised “hidden” tags 2013-12-04 07:58:39 +00:00
Phil Nash
3649fdf285 Build 15 2013-12-03 18:53:55 +00:00
Phil Nash
c4a089c12b Refactored a lot of code from headers into impl headers only compiled into one TU
- also added noimpl option to single header script - which only generates the non impl code
2013-12-03 18:52:41 +00:00
Phil Nash
8ba6555acd Merge pull request #224 from PetterS/cygwinfix
Fix fileno not always present. fileno(stdout) = 1.
2013-11-26 15:33:37 -08:00
Petter Strandmark
c032dfa41c Fix fileno not always present. fileno(stdout) = STDOUT_FILENO.
This was a problem when compiling on Cygwin with gcc 4.8.
2013-11-26 23:20:05 +01:00
Phil Nash
5ecb72b9bb Build 14 2013-11-26 20:57:45 +00:00
Phil Nash
782c2b5891 Added ability to load names of tests to run from a file
- use -f to specify filename. Blank lines and lines starting with # are ignored
- also added --list-test-names-only to list test names out to file in a form that can be immediate read in by -f
2013-11-26 20:57:34 +00:00
Phil Nash
200197f0b2 Merge branch 'master' of github.com:philsquared/Catch 2013-11-19 07:22:24 +00:00
Phil Nash
337dc25ed7 Converted all test case names to "modern" style (freeform text + tags) 2013-11-19 07:21:03 +00:00
Adam Strzelecki
d1e5480d95 std::auto_ptr is deprecated in c++11/c++0x
This will use std::unique_ptr on C++11 and remove deprecation warning.
2013-11-17 18:44:35 +01:00
Phil Nash
8d44f2dbb2 build 13 2013-11-13 08:10:45 +00:00
Phil Nash
ecb9432763 Simplified and tidied test case and tag listing 2013-11-12 18:59:34 +00:00
Phil Nash
5320518dbc Build 12 2013-11-09 07:47:09 +00:00
Phil Nash
0712bbb251 Merge pull request #207 from Fraser999/list_tests_issue
List tests issue
2013-11-07 03:11:19 -08:00
Phil Nash
c2b0c6fb08 Added missing #include for <vector> 2013-11-07 10:35:59 +00:00
Fraser Hutchison
6253386458 Fixes overflow issue when listing tests. 2013-10-24 02:53:13 +01:00
Phil Nash
93a945cee9 Fixed uninitialised members in Context object 2013-10-23 15:35:07 +01:00
Phil Nash
380f98ed1f Regenerated single include 2013-10-17 22:45:21 +01:00
Phil Nash
39ef46a02e Truncate excessively long messages rather than asserting 2013-10-17 18:02:38 +01:00
Phil Nash
0b097c26b6 Fix wrapping width when listing tests
- addresses #201
2013-10-02 08:07:52 +01:00
Phil Nash
b4af9b9620 Merge commit '22ded1f2bb3caf96d90c2f1981ede29d3aeb1c74' 2013-09-25 18:48:53 +01:00
Phil Nash
41b27af45b Fix for comma separated tags on the command line
- also added more test for tags
2013-09-25 18:40:07 +01:00
Phil Nash
358b7b29e1 Eliminate a warning in the latest clang with Xcode 2013-09-24 07:41:18 +01:00
Andy Sawyer
d6f23a9a36 catch_tostring : moved defintion of rangeToString
Detail::rangeToString is now defined after the various toString
overloads. This results in them being accessible with rangeToString is
instantiated (in this case, by StringMaker<vector>). This (sort-of)
fixes the problem where contained types are toString'd incorrectly.

Consider:
  std::vector<std::string> v { "abc" };

Before:
  Catch::toString( v ) == "{ abc }"
After:
  Catch::toString( v ) == "{ "abc" }"

(note the extra pair of quotes around the "abc" - these are added by
Catch::toString( std::string ) which is now called by rangeToString)
2013-09-21 18:45:42 +01:00
Andy Sawyer
0dbcf218c3 Add allocator support to StringMaker<vector>
- also extracted out 'rangeToString', in an attempt to make it easier
   to add support for other containers
2013-09-17 22:22:47 +01:00
Phil Nash
1e2f1d1603 Fixes toString forward reference issue:
- as raised in https://github.com/philsquared/Catch/pull/195
2013-09-14 19:58:45 +01:00
Phil Nash
f7378eebb6 Fixed string indexing bug 2013-09-07 12:07:38 +01:00
Phil Nash
638cf9feb4 Separated out catch_platform.h 2013-08-16 19:08:39 +01:00
Phil Nash
46118714b1 Build 8
- includes command line tweaks and fixes for durations
2013-08-16 19:01:32 +01:00
Phil Nash
1870ca8455 Some Clara/ command line clean-up and tweaks 2013-08-16 18:57:57 +01:00
Phil Nash
357d654641 Added missing assert include 2013-08-16 08:01:16 +01:00
Phil Nash
3faa412855 Removed basic reporter 2013-08-15 19:09:07 +01:00
Phil Nash
aa7123b696 Build 7
- New Junit reporter
- New Timer class
2013-08-15 19:01:00 +01:00
Phil Nash
d68510d6e3 Removed legacy JUnit reporter 2013-08-15 18:49:38 +01:00
Phil Nash
2ddb9d3802 Completed CumulativeReporterBase and reimplemented JUnitReporter in terms of it 2013-08-15 18:39:55 +01:00
Phil Nash
1f519dd856 Added LazyStat wrapper 2013-08-08 08:24:37 +01:00
Phil Nash
29ccaa67ad Replaced currentSectionInfo and m_rootSection with m_sectionStack 2013-08-08 08:05:19 +01:00
Phil Nash
6339254cb2 First cut of Timer class.
- started integrating with reporters (now (optionally) supported in console reporter).
- introduced Node<> template to help with cumulative reporting and used it instead of ThreadedSectionInfo.
2013-08-07 18:56:35 +01:00
Phil Nash
649f8c24b1 Removed now redundant handling for missing assertions in test cases
- handled as part of sections
2013-07-26 19:28:34 +01:00
Phil Nash
e8cf726a23 Refactored missing assertions handling 2013-07-26 19:26:08 +01:00
Phil Nash
b80280f428 Tidied up reporting of missing assertions in test cases
- also removed basic reporter from approval test
2013-07-26 19:19:44 +01:00
Phil Nash
801672b962 Fix MSVC warning 2013-07-25 08:18:09 +01:00
Phil Nash
8a52a39fdc Build 6
- fixes infinite loop bug (#185 and #166)
2013-07-25 08:12:03 +01:00
Phil Nash
28d3881ff9 Merged TestCaseTracker and SectionTracker and introduced TestCaseTracker::Guard 2013-07-25 08:07:55 +01:00
Phil Nash
ee647f5099 Removed displaced RunningTest class 2013-07-25 07:49:00 +01:00
Phil Nash
9aff9aa328 Integrated new section tracker.
- also pass extra section to reporter - one for each test case - ignore it in headers
  (this is so we know a test case has restarted)
- significant effect on regression test due to change of ordering of sections
- fixes infinite loop issue
2013-07-24 19:13:08 +01:00
Phil Nash
6a484fdb02 Reworked SectionTracker and moved into own header 2013-07-23 18:48:36 +01:00
Phil Nash
372a6c6fed Small fixes and started new section tracking code 2013-07-23 08:15:34 +01:00
Phil Nash
f3d1f08c3b Removed all trailing whitespace
- addresses #105
2013-07-03 19:14:59 +01:00
Phil Nash
503d5d0c8e Converted stray tabs to spaces 2013-07-03 08:25:11 +01:00