diff options
author | onqtam <vik.kirilov@gmail.com> | 2019-05-06 11:39:02 +0300 |
---|---|---|
committer | onqtam <vik.kirilov@gmail.com> | 2019-05-06 11:44:36 +0300 |
commit | 505b05ccc61d731ac82085fce0e3c59633a2bee5 (patch) | |
tree | d719566ff0caa1c7a8e3d64ae80138b62593ef3d | |
parent | 43271a60ed5869e0c09eba716530f8c7e5b84804 (diff) |
version 2.3.2
-rw-r--r-- | doc/html_generated/assertions.html | 2 | ||||
-rw-r--r-- | doc/html_generated/configuration.html | 7 | ||||
-rw-r--r-- | doc/html_generated/features.html | 2 | ||||
-rw-r--r-- | doc/html_generated/reporters.html | 8 | ||||
-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 |
10 files changed, 24 insertions, 11 deletions
diff --git a/doc/html_generated/assertions.html b/doc/html_generated/assertions.html index 18274d64..a9149b3f 100644 --- a/doc/html_generated/assertions.html +++ b/doc/html_generated/assertions.html @@ -116,6 +116,8 @@ Expects that no exception is thrown during evaluation of the expression. Note that these asserts also have a ```_MESSAGE``` form - like ```CHECK_THROWS_MESSAGE(expression, message)``` - these work identically to the ```_MESSAGE``` form of the normal macros (```CHECK_MESSAGE(a < b, "this shouldn't fail")```) described earlier. +One may use the [**```DOCTEST_CONFIG_VOID_CAST_EXPRESSIONS```**](configuration.html#doctest_config_void_cast_expressions) config identifier to cast the expression in these asserts to void to avoid warnings or other issues - for example nodiscard statements whose result isn't checked. This will however limit the ability to write entire ```{}``` blocks of code as the expression (or multiple statements) but in that case a simple lambda can be used. This should have been the default behavior from day 1 of the framework... + ## Using asserts out of a testing context Asserts can be used outside of a testing context (in code not called from a ```TEST_CASE()```) instead of [```assert()```](https://en.cppreference.com/w/cpp/error/assert). diff --git a/doc/html_generated/configuration.html b/doc/html_generated/configuration.html index ef9a2b55..731c4573 100644 --- a/doc/html_generated/configuration.html +++ b/doc/html_generated/configuration.html @@ -20,6 +20,7 @@ Defining something ```globally``` means for every source file of the binary (exe - [**```DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING```**](#doctest_config_treat_char_star_as_string) - [**```DOCTEST_CONFIG_SUPER_FAST_ASSERTS```**](#doctest_config_super_fast_asserts) - [**```DOCTEST_CONFIG_USE_STD_HEADERS```**](#doctest_config_use_std_headers) +- [**```DOCTEST_CONFIG_VOID_CAST_EXPRESSIONS```**](#doctest_config_void_cast_expressions) - [**```DOCTEST_CONFIG_NO_COMPARISON_WARNING_SUPPRESSION```**](#doctest_config_no_comparison_warning_suppression) - [**```DOCTEST_CONFIG_OPTIONS_PREFIX```**](#doctest_config_options_prefix) - [**```DOCTEST_CONFIG_NO_UNPREFIXED_OPTIONS```**](#doctest_config_no_unprefixed_options) @@ -114,6 +115,12 @@ Also it is possible that some STL implementation of a compiler with niche usage This should be defined globally. +### **```DOCTEST_CONFIG_VOID_CAST_EXPRESSIONS```** + +This affects the [asserts dealing with exceptions](assertions.html#exceptions) - the expression is cast to void to avoid problems such as when functions with the ```[[nodiscard]]``` attribute are used but their result isn't checked. + +This can be defined both globally and in specific source files only. + ### **```DOCTEST_CONFIG_NO_COMPARISON_WARNING_SUPPRESSION```** By default the library suppresses warnings about comparing signed and unsigned types, etc. diff --git a/doc/html_generated/features.html b/doc/html_generated/features.html index f566b520..66ba741c 100644 --- a/doc/html_generated/features.html +++ b/doc/html_generated/features.html @@ -27,7 +27,7 @@ ## Extremely portable: - Standards compliant **C++11** code - should work with any **C++11** capable compiler (use tag [**1.2.9**](https://github.com/onqtam/doctest/tree/1.2.9) for C++98 and older compilers) -- tested with **GCC**: **4.8**, **4.9**, **5**, **6**, **7**, **8** +- tested with **GCC**: **4.8**, **4.9**, **5**, **6**, **7**, **8**, **9** - tested with **Clang**: **3.5**, **3.6**, **3.7**, **3.8**, **3.9**, **4**, **5**, **6**, **7**, **8** (XCode 6+) - tested with **MSVC**: **2015**, **2017**, **2019** (also in 32 bit mode) - per-commit tested on [**travis**](https://travis-ci.org/onqtam/doctest) and [**appveyor**](https://ci.appveyor.com/project/onqtam/doctest) CI services diff --git a/doc/html_generated/reporters.html b/doc/html_generated/reporters.html index 99c6262c..68c5f5d9 100644 --- a/doc/html_generated/reporters.html +++ b/doc/html_generated/reporters.html @@ -49,9 +49,13 @@ struct MyXmlReporter : public IReporter void test_case_exception(const TestCaseException& /*in*/) override {} - void subcase_start(const SubcaseSignature& /*in*/) override {} + void subcase_start(const SubcaseSignature& /*in*/) override { + std::lock_guard<std::mutex> lock(mutex); + } - void subcase_end() override {} + void subcase_end() override { + std::lock_guard<std::mutex> lock(mutex); + } void log_assert(const AssertData& in) override { // don't include successful asserts by default - this is done here diff --git a/doctest/doctest.h b/doctest/doctest.h index 6c1fa4fa..69a0fe05 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 1 -#define DOCTEST_VERSION_STR "2.3.1" +#define DOCTEST_VERSION_PATCH 2 +#define DOCTEST_VERSION_STR "2.3.2" #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 523c19e4..43ca2896 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 1 -#define DOCTEST_VERSION_STR "2.3.1" +#define DOCTEST_VERSION_PATCH 2 +#define DOCTEST_VERSION_STR "2.3.2" #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 0e7a031b..b9ec7479 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.1" +[doctest] doctest version is "2.3.2" diff --git a/examples/all_features/test_output/version_xml.txt b/examples/all_features/test_output/version_xml.txt index ab987974..74739c29 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.1"> +<doctest binary="all_features" version="2.3.2"> <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 704cda62..1bb06a10 100644 --- a/meson.build +++ b/meson.build @@ -1,3 +1,3 @@ -project('doctest', ['cpp'], version: '2.3.1', meson_version:'>=0.50') +project('doctest', ['cpp'], version: '2.3.2', meson_version:'>=0.50') doctest_dep = declare_dependency(include_directories: include_directories('doctest')) diff --git a/scripts/version.txt b/scripts/version.txt index a6254504..e7034819 100644 --- a/scripts/version.txt +++ b/scripts/version.txt @@ -1 +1 @@ -2.3.1
\ No newline at end of file +2.3.2
\ No newline at end of file |