diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | doc/html_generated/assertions.html | 8 | ||||
-rw-r--r-- | doc/html_generated/commandline.html | 2 | ||||
-rw-r--r-- | doc/html_generated/faq.html | 20 | ||||
-rw-r--r-- | doc/html_generated/reporters.html | 3 | ||||
-rw-r--r-- | doctest/doctest.h | 4 | ||||
-rw-r--r-- | doctest/parts/doctest_fwd.h | 4 | ||||
-rw-r--r-- | examples/all_features/test_output/version.txt | 2 | ||||
-rw-r--r-- | examples/all_features/test_output/version_xml.txt | 2 | ||||
-rw-r--r-- | meson.build | 2 | ||||
-rw-r--r-- | scripts/version.txt | 2 |
11 files changed, 31 insertions, 20 deletions
@@ -46,7 +46,7 @@ [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/503/badge)](https://bestpractices.coreinfrastructure.org/projects/503) [![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/onqtam/doctest.svg)](https://lgtm.com/projects/g/onqtam/doctest/context:cpp) [![Join the chat at https://gitter.im/onqtam/doctest](https://badges.gitter.im/onqtam/doctest.svg)](https://gitter.im/onqtam/doctest?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![Try it online](https://img.shields.io/badge/try%20it-online-orange.svg)](https://wandbox.org/permlink/HbnLHVjkODZV3eU2) +[![Try it online](https://img.shields.io/badge/try%20it-online-orange.svg)](https://wandbox.org/permlink/3J7otx2TvFQNSZsb) <!-- [![Language](https://img.shields.io/badge/language-C++-blue.svg)](https://isocpp.org/) [![documentation](https://img.shields.io/badge/documentation%20%20-online-blue.svg)](https://github.com/onqtam/doctest/blob/master/doc/markdown/readme.md#reference) diff --git a/doc/html_generated/assertions.html b/doc/html_generated/assertions.html index a9149b3f..3d2b4f31 100644 --- a/doc/html_generated/assertions.html +++ b/doc/html_generated/assertions.html @@ -110,6 +110,14 @@ Expects that an exception is thrown during evaluation of the expression and is s CHECK_THROWS_WITH(func(), "invalid operation!"); ``` +- ```<LEVEL>_THROWS_WITH_AS(expression, c_string, exception_type)``` + +This is a combination of ```<LEVEL>_THROWS_WITH``` and ```<LEVEL>_THROWS_AS```. + +``` +CHECK_THROWS_WITH_AS(func(), "invalid operation!", std::runtime_error); +``` + - ```<LEVEL>_NOTHROW(expression)``` Expects that no exception is thrown during evaluation of the expression. diff --git a/doc/html_generated/commandline.html b/doc/html_generated/commandline.html index 88f27c40..02062f08 100644 --- a/doc/html_generated/commandline.html +++ b/doc/html_generated/commandline.html @@ -37,7 +37,7 @@ All the options can also be set with code (defaults/overrides) if the user [**su | ```-sce``` ```--subcase-exclude=<filters>``` | Same as ```--test-case-exclude=<filters>``` but filters based on subcase names | | ```-r``` ```--reporters=<filters>``` | List of [**reporters**](reporters.html) to use (default is ```console```) | | ```-o``` ```--out=<string>``` | Output filename | -| ```-ob``` ```--order-by=<string>``` | Test cases will be sorted before being executed either by **the file in which they are** / **the test suite they are in** / **their name** / **random**. The possible values of ```<string>``` are ```file```/```suite```/```name```/```rand```. The default is ```file```. **NOTE: the order produced by ```file``` is compiler-dependent and might differ depending on the compiler used.** | +| ```-ob``` ```--order-by=<string>``` | Test cases will be sorted before being executed either by **the file in which they are** / **the test suite they are in** / **their name** / **random**. The possible values of ```<string>``` are ```file```/```suite```/```name```/```rand```. The default is ```file```. **NOTE: the order produced by the ```file```, ```suite``` and ```name``` options is compiler-dependent and might differ depending on the compiler used.** | | ```-rs``` ```--rand-seed=<int>``` | The seed for random ordering | | ```-f``` ```--first=<int>``` | The **first** test case to execute which passes the current filters - for range-based execution - see [**the example python script**](../../examples/range_based_execution.py) | | ```-l``` ```--last=<int>``` | The **last** test case to execute which passes the current filters - for range-based execution - see [**the example python script**](../../examples/range_based_execution.py) | diff --git a/doc/html_generated/faq.html b/doc/html_generated/faq.html index 15d968e3..80542be4 100644 --- a/doc/html_generated/faq.html +++ b/doc/html_generated/faq.html @@ -67,20 +67,20 @@ using doctest::Approx; Here are a couple of differences: -– the main one is that only doctest from the C++ frameworks is usable next to your production code (speed of compilation, ability to remove the tests from the binary, ability to execute tests/code/both, ability to have tests in multiple shared objects and still a single registry for all of them) -– doctest is a single header – Google Test has to be built as a separate static library and linked against. -– doctest has the concept of [**Subcases**](https://github.com/onqtam/doctest/blob/master/doc/markdown/tutorial.html#test-cases-and-subcases) which is a much cleaner way to share setup and teardown code between tests compared to fixtures and class inheritance – Google Test is quite verbose! -– doctest compiles faster and probably runs faster (although the runtime becomes an issue only when you have millions of asserts) -– doctest asserts are thread-safe even on Windows (Google Test uses pthreads so thread-safe asserts are available only on UNIX) -– doctest overall has a simpler API +- the main one is that only doctest from the C++ frameworks is usable next to your production code (speed of compilation, ability to remove the tests from the binary, ability to execute tests/code/both, ability to have tests in multiple shared objects and still a single registry for all of them) +- doctest is a single header - Google Test has to be built as a separate static library and linked against. +- doctest has the concept of [**Subcases**](https://github.com/onqtam/doctest/blob/master/doc/markdown/tutorial.html#test-cases-and-subcases) which is a much cleaner way to share setup and teardown code between tests compared to fixtures and class inheritance - Google Test is quite verbose! +- doctest compiles faster and probably runs faster (although the runtime becomes an issue only when you have millions of asserts) +- doctest asserts are thread-safe even on Windows (Google Test uses pthreads so thread-safe asserts are available only on UNIX) +- doctest overall has a simpler API but there are also some areas in which doctest is lacking: -– value-parameterized tests -– death tests (where you check if calling a certain function doesn’t simply throw but if it crashes the process) -– doctest has some integration with mocking libraries but Google Test works perfectly with Google Mock (although doctest should in theory work with it as well) +- value-parameterized tests +- death tests (where you check if calling a certain function doesn’t simply throw but if it crashes the process) +- doctest has some integration with mocking libraries but Google Test works perfectly with Google Mock (although doctest should in theory work with it as well) -The areas where doctest is behind are planned for improvement in the future. There are many other smaller differences – it would be impractical to cover them all. +The areas where doctest is behind are planned for improvement in the future. There are many other smaller differences - it would be impractical to cover them all. ### How to get the best compile-time performance with the framework? diff --git a/doc/html_generated/reporters.html b/doc/html_generated/reporters.html index fdaa4107..42bd6b5c 100644 --- a/doc/html_generated/reporters.html +++ b/doc/html_generated/reporters.html @@ -45,6 +45,9 @@ struct MyXmlReporter : public IReporter void test_case_start(const TestCaseData& in) override { tc = ∈ } + // called when a test case is reentered because of unfinished subcases + void test_case_reenter(const TestCaseData& /*in*/) override {} + void test_case_end(const CurrentTestCaseStats& /*in*/) override {} void test_case_exception(const TestCaseException& /*in*/) override {} diff --git a/doctest/doctest.h b/doctest/doctest.h index 8784a151..8b76419a 100644 --- a/doctest/doctest.h +++ b/doctest/doctest.h @@ -48,8 +48,8 @@ #define DOCTEST_VERSION_MAJOR 2 #define DOCTEST_VERSION_MINOR 3 -#define DOCTEST_VERSION_PATCH 4 -#define DOCTEST_VERSION_STR "2.3.4" +#define DOCTEST_VERSION_PATCH 5 +#define DOCTEST_VERSION_STR "2.3.5" #define DOCTEST_VERSION \ (DOCTEST_VERSION_MAJOR * 10000 + DOCTEST_VERSION_MINOR * 100 + DOCTEST_VERSION_PATCH) diff --git a/doctest/parts/doctest_fwd.h b/doctest/parts/doctest_fwd.h index 247f4026..6645c577 100644 --- a/doctest/parts/doctest_fwd.h +++ b/doctest/parts/doctest_fwd.h @@ -45,8 +45,8 @@ #define DOCTEST_VERSION_MAJOR 2 #define DOCTEST_VERSION_MINOR 3 -#define DOCTEST_VERSION_PATCH 4 -#define DOCTEST_VERSION_STR "2.3.4" +#define DOCTEST_VERSION_PATCH 5 +#define DOCTEST_VERSION_STR "2.3.5" #define DOCTEST_VERSION \ (DOCTEST_VERSION_MAJOR * 10000 + DOCTEST_VERSION_MINOR * 100 + DOCTEST_VERSION_PATCH) diff --git a/examples/all_features/test_output/version.txt b/examples/all_features/test_output/version.txt index e631dcea..fc63942c 100644 --- a/examples/all_features/test_output/version.txt +++ b/examples/all_features/test_output/version.txt @@ -1 +1 @@ -[doctest] doctest version is "2.3.4" +[doctest] doctest version is "2.3.5" diff --git a/examples/all_features/test_output/version_xml.txt b/examples/all_features/test_output/version_xml.txt index cf44de6d..6d498cbd 100644 --- a/examples/all_features/test_output/version_xml.txt +++ b/examples/all_features/test_output/version_xml.txt @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> -<doctest binary="all_features" version="2.3.4"> +<doctest binary="all_features" version="2.3.5"> <Options order_by="file" rand_seed="324" first="0" last="4294967295" abort_after="0" subcase_filter_levels="2147483647" case_sensitive="false" no_throw="false" no_skip="false"/> </doctest> diff --git a/meson.build b/meson.build index 0704edc3..6a164359 100644 --- a/meson.build +++ b/meson.build @@ -1,2 +1,2 @@ -project('doctest', ['cpp'], version: '2.3.4') +project('doctest', ['cpp'], version: '2.3.5', meson_version:'>=0.50') doctest_dep = declare_dependency(include_directories: include_directories('doctest')) diff --git a/scripts/version.txt b/scripts/version.txt index fd06a926..3b265248 100644 --- a/scripts/version.txt +++ b/scripts/version.txt @@ -1 +1 @@ -2.3.4
\ No newline at end of file +2.3.5
\ No newline at end of file |