diff -Nru doctest-2.4.0+repack0/CHANGELOG.md doctest-2.4.1+repack0/CHANGELOG.md --- doctest-2.4.0+repack0/CHANGELOG.md 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/CHANGELOG.md 2020-11-06 17:28:50.000000000 +0000 @@ -1,5 +1,38 @@ # Change Log +## [2.4.1](https://github.com/onqtam/doctest/tree/2.4.1) (2020-11-04) +[Full Changelog](https://github.com/onqtam/doctest/compare/2.4.0...2.4.1) + +**Closed issues:** + +- Avoid old C-style casts [\#424](https://github.com/onqtam/doctest/issues/424) +- Segfault in unwind [\#422](https://github.com/onqtam/doctest/issues/422) +- Inspect exception with gdb [\#421](https://github.com/onqtam/doctest/issues/421) +- use-of-uninitialized-value [\#414](https://github.com/onqtam/doctest/issues/414) +- Support unit tests with MPI [\#413](https://github.com/onqtam/doctest/issues/413) +- Break into debugger support is missing for Linux [\#411](https://github.com/onqtam/doctest/issues/411) +- What if built doctest as static library instead of header-only [\#408](https://github.com/onqtam/doctest/issues/408) +- \[Question\] How to get test case name [\#407](https://github.com/onqtam/doctest/issues/407) +- create extensions header for optional features requiring more std includes or newer C++ features [\#405](https://github.com/onqtam/doctest/issues/405) +- tests/asserts summary lines are misaligned when counts exceed 999999 [\#402](https://github.com/onqtam/doctest/issues/402) +- Call to 'ne' is ambiguous -- with solution [\#395](https://github.com/onqtam/doctest/issues/395) +- Intermittent Segfaults [\#391](https://github.com/onqtam/doctest/issues/391) +- Junit classname [\#390](https://github.com/onqtam/doctest/issues/390) +- Add default printers for enums [\#121](https://github.com/onqtam/doctest/issues/121) + +**Merged pull requests:** + +- Enum support \(fix for Issue \#121\) [\#429](https://github.com/onqtam/doctest/pull/429) ([jkriegshauser](https://github.com/jkriegshauser)) +- Support Clang 3.4 [\#428](https://github.com/onqtam/doctest/pull/428) ([AlexanderLanin](https://github.com/AlexanderLanin)) +- Silence remarks on old C-style casts [\#425](https://github.com/onqtam/doctest/pull/425) ([UnePierre](https://github.com/UnePierre)) +- Initial MPI unit tests implementation [\#418](https://github.com/onqtam/doctest/pull/418) ([BerengerBerthoul](https://github.com/BerengerBerthoul)) +- Add JUNIT\_OUTPUT\_DIR option to doctest\_discover\_tests [\#417](https://github.com/onqtam/doctest/pull/417) ([Tradias](https://github.com/Tradias)) +- Add option to build with std headers. [\#416](https://github.com/onqtam/doctest/pull/416) ([avostrik](https://github.com/avostrik)) +- Port Catch2 break into debugger for Linux. closes \#411 [\#412](https://github.com/onqtam/doctest/pull/412) ([mikezackles](https://github.com/mikezackles)) +- summary: align even large values \#402 [\#403](https://github.com/onqtam/doctest/pull/403) ([dankamongmen](https://github.com/dankamongmen)) +- Add breakpoint inline assembly for the Apple Silicon macOS. [\#400](https://github.com/onqtam/doctest/pull/400) ([bruvzg](https://github.com/bruvzg)) +- fix google's death test URI in roadmap [\#393](https://github.com/onqtam/doctest/pull/393) ([ashutosh108](https://github.com/ashutosh108)) + ## [2.4.0](https://github.com/onqtam/doctest/tree/2.4.0) (2020-06-27) [Full Changelog](https://github.com/onqtam/doctest/compare/2.3.8...2.4.0) diff -Nru doctest-2.4.0+repack0/CMakeLists.txt doctest-2.4.1+repack0/CMakeLists.txt --- doctest-2.4.0+repack0/CMakeLists.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/CMakeLists.txt 2020-11-06 17:28:50.000000000 +0000 @@ -14,21 +14,24 @@ option(DOCTEST_WITH_TESTS "Build tests/examples" ON) option(DOCTEST_WITH_MAIN_IN_STATIC_LIB "Build a static lib (cmake target) with a default main entry point" ON) option(DOCTEST_NO_INSTALL "Skip the installation process" OFF) +option(DOCTEST_USE_STD_HEADERS "Use std headers" OFF) add_library(${PROJECT_NAME} INTERFACE) add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) -if(NOT CMAKE_VERSION VERSION_LESS 3.8) +if(NOT CMAKE_VERSION VERSION_LESS 3.8) target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_11) endif() set(doctest_parts_folder "${CMAKE_CURRENT_SOURCE_DIR}/doctest/parts") +set(doctest_folder "${CMAKE_CURRENT_SOURCE_DIR}/") # in order to have the mpi extension files, not included into the doctest.h single header if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) # use a special hidden version of the header which directly includes the 2 parts - proper reporting of file/line locations during dev target_include_directories(${PROJECT_NAME} INTERFACE $ - $) + $ + $) # add a custom target that assembles the single header when any of the parts are touched add_custom_command( @@ -50,6 +53,10 @@ DOCTEST_THREAD_LOCAL=${DOCTEST_THREAD_LOCAL}) endif() +if(DOCTEST_USE_STD_HEADERS) + target_compile_definitions(${PROJECT_NAME} INTERFACE DOCTEST_CONFIG_USE_STD_HEADERS) +endif() + ################################################################################ ## TESTS/EXAMPLES/HELPERS ################################################################################ @@ -72,6 +79,7 @@ add_subdirectory(examples/exe_with_static_libs) add_subdirectory(examples/executable_dll_and_plugin) add_subdirectory(scripts/playground) + add_subdirectory(examples/mpi) endif() endif() diff -Nru doctest-2.4.0+repack0/debian/changelog doctest-2.4.1+repack0/debian/changelog --- doctest-2.4.0+repack0/debian/changelog 2020-06-30 11:10:23.000000000 +0000 +++ doctest-2.4.1+repack0/debian/changelog 2020-11-06 17:32:32.000000000 +0000 @@ -1,3 +1,9 @@ +doctest (2.4.1+repack0-1) unstable; urgency=medium + + * Update to new upstream version 2.4.1+repack0 + + -- Didier Raboud Fri, 06 Nov 2020 18:32:32 +0100 + doctest (2.4.0+repack0-1) unstable; urgency=medium * Update to new upstream version 2.4.0+repack0 diff -Nru doctest-2.4.0+repack0/doc/markdown/extensions.md doctest-2.4.1+repack0/doc/markdown/extensions.md --- doctest-2.4.0+repack0/doc/markdown/extensions.md 1970-01-01 00:00:00.000000000 +0000 +++ doctest-2.4.1+repack0/doc/markdown/extensions.md 2020-11-06 17:28:50.000000000 +0000 @@ -0,0 +1,148 @@ +## Extensions + +The doctest header doesn't include any external or stdlib headers in it's interface part in order to provide the most optimal build times but that means it is limited in what it can provide as functionality => that's when extensions come into play. They are located as header files in [`doctest/extensions`](../../doctest/extensions) and each of them is documented in a section here. + +# [Utils](../../doctest/extensions/doctest_util.h) + +nothing here yet... + +# [Distributed tests with MPI](../../doctest/extensions/doctest_mpi.h) + +[Bruno Maugars and BĂ©renger Berthoul, ONERA] + +Testing code over distributed processes requires support from the testing framework. **Doctest** support for MPI parallel communication is provided in the ```"doctest/extensions/doctest_mpi.h"``` header. + +## Example + +See [**the complete test**](../../examples/mpi/mpi.cpp) and [**the configuration of main()**](../../examples/mpi/main.cpp) + +### MPI_TEST_CASE + +```c++ +#include "doctest/extensions/doctest_mpi.h" + +int my_function_to_test(MPI_Comm comm) { + int rank; + MPI_comm_rank(comm,&rank); + if (rank == 0) { + return 10; + } + return 11; +} + + +MPI_TEST_CASE("test over two processes",2) { // Parallel test on 2 processes + int x = my_function_to_test(test_comm); + + MPI_CHECK( 0, x==10 ); // CHECK for rank 0, that x==10 + MPI_CHECK( 1, x==11 ); // CHECK for rank 1, that x==11 +} +``` + +An ```MPI_TEST_CASE``` is like a regular ```TEST_CASE```, except it takes a second argument, which is the number of processes needed to run the test. If the number of processes is less than 2, the test will fail. If the number of processes is greater than or equal to 2, it will create a sub-communicator over 2 processes, called ```test_comm```, and execute the test over these processes. Three objects are provided by ```MPI_TEST_CASE```: + * ```test_comm```, of type ```MPI_Comm```: the mpi communicator on which the test is running, + * ```test_rank``` and ```test_nb_procs```, two ```int``` giving respectively the rank of the current process and the size of the communicator for ```test_comm```. These last two are just here for convenience and could be retrived from ```test_comm```. + +We always have: + +```c++ +MPI_TEST_CASE("my_test",N) { + CHECK( test_nb_procs == N ); + MPI_CHECK( i, test_rank==i ); // for any i On rank [2] with 1 test failed +[doctest] Status: FAILURE! +``` + +### MpiFileReporter +The ```MpiFileReporter``` will just print the result of each process in its own file, named ```doctest_[rank].log```. Only use this reporter as a debug facility if you want to know what is going on exactly when a parallel test case is failing. + +### Other reporters +Other reporters (jUnit, XML) are not supported directly, which mean that you can always print the result of each process to its own file, but there is (currently) no equivalent of the ```MpiConsoleReporter``` that will aggregate the results of all processes. + + +## Note + +This feature is provided to unit-test mpi-distributed code. It is **not** a way to parallelize many unit tests over several processes (for that, see [**the example python script**](../../examples/range_based_execution.py)). + +## TODO + + * Pass ```s``` member variable of ```ConsoleReporter``` as an argument to member functions so we can use them with another object (would help to factorize ```MPIConsoleReporter```) + * Only MPI_CHECK tested. MPI_REQUIRE, exception handling: nothing tested + * If the number of processes is not enought, prints the correct message, but then deadlocks (comes from ```MPI_Probe``` in ```MpiConsoleReporter```) + * [[maybe_unused]] is C++17 + * More testing, automatic testing + * Packaging: create a new target ```mpi_doctest```? (probably cleaner to depend explicitly on MPI for mpi/doctest.h) + * Later, maybe: have a general mechanism to represent assertions so we can separate the report format (console, xml, junit...) from the reporting strategy (sequential vs. MPI) + +--------------- + +[Home](readme.md#reference) + +

diff -Nru doctest-2.4.0+repack0/doc/markdown/features.md doctest-2.4.1+repack0/doc/markdown/features.md --- doctest-2.4.0+repack0/doc/markdown/features.md 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/doc/markdown/features.md 2020-11-06 17:28:50.000000000 +0000 @@ -66,7 +66,8 @@ - integration with the output window of Visual Studio for failing tests - a ```main()``` can be provided when implementing the library with the [**```DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN```**](main.md#doctest_config_implement_with_main) identifier - can write tests in headers - they will still be registered only once in the executable/shared object -- [**range-based**](commandline.md) execution of tests - see the [**example python script**](../../examples/range_based_execution.py) +- [**range-based**](commandline.md) execution of tests within a binary - see the [**example python script**](../../examples/range_based_execution.py) +- [**extension headers**](extensions.md) for extra functionality which doesn't need to go into the main `doctest.h` header - colored output in the console - controlling the order of test execution - different ```doctest::Context```s can be created and ran many times within a single execution of the program diff -Nru doctest-2.4.0+repack0/doc/markdown/readme.md doctest-2.4.1+repack0/doc/markdown/readme.md --- doctest-2.4.0+repack0/doc/markdown/readme.md 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/doc/markdown/readme.md 2020-11-06 17:28:50.000000000 +0000 @@ -21,6 +21,7 @@ - [Configuration](configuration.md) - [String conversions](stringification.md) - [Reporters](reporters.md) +- [Extensions](extensions.md) - [FAQ](faq.md) - [Build systems](build-systems.md) - [Examples](../../examples) diff -Nru doctest-2.4.0+repack0/doc/markdown/roadmap.md doctest-2.4.1+repack0/doc/markdown/roadmap.md --- doctest-2.4.0+repack0/doc/markdown/roadmap.md 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/doc/markdown/roadmap.md 2020-11-06 17:28:50.000000000 +0000 @@ -95,7 +95,7 @@ - support for LibIdentify - add CHECKED_IF & friends: https://github.com/catchorg/Catch2/issues/1278 - support for running tests in parallel in multiple threads -- death tests - as in [google test](https://github.com/google/googletest/blob/master/googletest/docs/AdvancedGuide.md#death-tests) +- death tests - as in [google test](https://github.com/google/googletest/blob/master/googletest/docs/advanced.md#death-tests) - config options - test case name uniqueness - reject the ones with identical names - command line options diff -Nru doctest-2.4.0+repack0/doctest/doctest.h doctest-2.4.1+repack0/doctest/doctest.h --- doctest-2.4.0+repack0/doctest/doctest.h 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/doctest/doctest.h 2020-11-06 17:28:50.000000000 +0000 @@ -4,7 +4,7 @@ // // doctest.h - the lightest feature-rich C++ single-header testing framework for unit tests and TDD // -// Copyright (c) 2016-2019 Viktor Kirilov +// Copyright (c) 2016-2020 Viktor Kirilov // // Distributed under the MIT Software License // See accompanying file LICENSE.txt or copy at @@ -48,8 +48,8 @@ #define DOCTEST_VERSION_MAJOR 2 #define DOCTEST_VERSION_MINOR 4 -#define DOCTEST_VERSION_PATCH 0 -#define DOCTEST_VERSION_STR "2.4.0" +#define DOCTEST_VERSION_PATCH 1 +#define DOCTEST_VERSION_STR "2.4.1" #define DOCTEST_VERSION \ (DOCTEST_VERSION_MAJOR * 10000 + DOCTEST_VERSION_MINOR * 100 + DOCTEST_VERSION_PATCH) @@ -301,11 +301,15 @@ #define DOCTEST_NOINLINE __declspec(noinline) #define DOCTEST_UNUSED #define DOCTEST_ALIGNMENT(x) -#else // MSVC +#elif DOCTEST_CLANG && DOCTEST_CLANG < DOCTEST_COMPILER(3, 5, 0) +#define DOCTEST_NOINLINE +#define DOCTEST_UNUSED +#define DOCTEST_ALIGNMENT(x) +#else #define DOCTEST_NOINLINE __attribute__((noinline)) #define DOCTEST_UNUSED __attribute__((unused)) #define DOCTEST_ALIGNMENT(x) __attribute__((aligned(x))) -#endif // MSVC +#endif #ifndef DOCTEST_NORETURN #define DOCTEST_NORETURN [[noreturn]] @@ -355,8 +359,20 @@ #ifndef DOCTEST_BREAK_INTO_DEBUGGER // should probably take a look at https://github.com/scottt/debugbreak -#ifdef DOCTEST_PLATFORM_MAC +#ifdef DOCTEST_PLATFORM_LINUX +#if defined(__GNUC__) && (defined(__i386) || defined(__x86_64)) +// Break at the location of the failing check if possible #define DOCTEST_BREAK_INTO_DEBUGGER() __asm__("int $3\n" : :) +#else +#include +#define DOCTEST_BREAK_INTO_DEBUGGER() raise(SIGTRAP) +#endif +#elif defined(DOCTEST_PLATFORM_MAC) +#if defined(__x86_64) || defined(__x86_64__) || defined(__amd64__) +#define DOCTEST_BREAK_INTO_DEBUGGER() __asm__("int $3\n" : :) +#else +#define DOCTEST_BREAK_INTO_DEBUGGER() __asm__("brk #0"); +#endif #elif DOCTEST_MSVC #define DOCTEST_BREAK_INTO_DEBUGGER() __debugbreak() #elif defined(__MINGW32__) @@ -365,7 +381,7 @@ DOCTEST_GCC_SUPPRESS_WARNING_POP #define DOCTEST_BREAK_INTO_DEBUGGER() ::DebugBreak() #else // linux -#define DOCTEST_BREAK_INTO_DEBUGGER() ((void)0) +#define DOCTEST_BREAK_INTO_DEBUGGER() (static_cast(0)) #endif // linux #endif // DOCTEST_BREAK_INTO_DEBUGGER @@ -375,6 +391,9 @@ #endif // DOCTEST_CONFIG_USE_IOSFWD #ifdef DOCTEST_CONFIG_USE_STD_HEADERS +#ifndef DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS +#define DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS +#endif // DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS #include #include #include @@ -740,7 +759,6 @@ }; namespace detail { -#if defined(DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING) || defined(DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS) template struct enable_if {}; @@ -748,7 +766,6 @@ template struct enable_if { typedef TYPE type; }; -#endif // DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING) || DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS // clang-format off template struct remove_reference { typedef T type; }; @@ -757,6 +774,14 @@ template struct remove_const { typedef T type; }; template struct remove_const { typedef T type; }; +#ifdef DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS + template struct is_enum : public std::is_enum {}; + template struct underlying_type : public std::underlying_type {}; +#else + // Use compiler intrinsics + template struct is_enum { constexpr static bool value = __is_enum(T); }; + template struct underlying_type { typedef __underlying_type(T) type; }; +#endif // clang-format on template @@ -771,12 +796,12 @@ template struct check { - static constexpr auto value = false; + static constexpr bool value = false; }; template struct check(), void())> { - static constexpr auto value = true; + static constexpr bool value = true; }; } // namespace has_insertion_operator_impl @@ -845,7 +870,7 @@ } }; -template +template ::value, bool>::type = true> String toString(const DOCTEST_REF_WRAP(T) value) { return StringMaker::convert(value); } @@ -872,6 +897,12 @@ DOCTEST_INTERFACE String toString(int long long unsigned in); DOCTEST_INTERFACE String toString(std::nullptr_t in); +template ::value, bool>::type = true> +String toString(const DOCTEST_REF_WRAP(T) value) { + typedef typename detail::underlying_type::type UT; + return toString(static_cast(value)); +} + #if DOCTEST_MSVC >= DOCTEST_COMPILER(19, 20, 0) // see this issue on why this is needed: https://github.com/onqtam/doctest/issues/183 DOCTEST_INTERFACE String toString(const std::string& in); @@ -1283,12 +1314,12 @@ template struct RelationalComparator { bool operator()(const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) const { return op(lhs, rhs); } }; // clang-format on - DOCTEST_BINARY_RELATIONAL_OP(0, eq) - DOCTEST_BINARY_RELATIONAL_OP(1, ne) - DOCTEST_BINARY_RELATIONAL_OP(2, gt) - DOCTEST_BINARY_RELATIONAL_OP(3, lt) - DOCTEST_BINARY_RELATIONAL_OP(4, ge) - DOCTEST_BINARY_RELATIONAL_OP(5, le) + DOCTEST_BINARY_RELATIONAL_OP(0, doctest::detail::eq) + DOCTEST_BINARY_RELATIONAL_OP(1, doctest::detail::ne) + DOCTEST_BINARY_RELATIONAL_OP(2, doctest::detail::gt) + DOCTEST_BINARY_RELATIONAL_OP(3, doctest::detail::lt) + DOCTEST_BINARY_RELATIONAL_OP(4, doctest::detail::ge) + DOCTEST_BINARY_RELATIONAL_OP(5, doctest::detail::le) struct DOCTEST_INTERFACE ResultBuilder : public AssertData { @@ -1415,9 +1446,9 @@ } catch(T ex) { // NOLINT res = m_translateFunction(ex); //!OCLINT parameter reassignment return true; - } catch(...) {} //!OCLINT - empty catch statement -#endif // DOCTEST_CONFIG_NO_EXCEPTIONS - ((void)res); // to silence -Wunused-parameter + } catch(...) {} //!OCLINT - empty catch statement +#endif // DOCTEST_CONFIG_NO_EXCEPTIONS + static_cast(res); // to silence -Wunused-parameter return false; } @@ -2183,37 +2214,37 @@ #ifdef DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS -#define DOCTEST_WARN_THROWS(...) ((void)0) -#define DOCTEST_CHECK_THROWS(...) ((void)0) -#define DOCTEST_REQUIRE_THROWS(...) ((void)0) -#define DOCTEST_WARN_THROWS_AS(expr, ...) ((void)0) -#define DOCTEST_CHECK_THROWS_AS(expr, ...) ((void)0) -#define DOCTEST_REQUIRE_THROWS_AS(expr, ...) ((void)0) -#define DOCTEST_WARN_THROWS_WITH(expr, ...) ((void)0) -#define DOCTEST_CHECK_THROWS_WITH(expr, ...) ((void)0) -#define DOCTEST_REQUIRE_THROWS_WITH(expr, ...) ((void)0) -#define DOCTEST_WARN_THROWS_WITH_AS(expr, with, ...) ((void)0) -#define DOCTEST_CHECK_THROWS_WITH_AS(expr, with, ...) ((void)0) -#define DOCTEST_REQUIRE_THROWS_WITH_AS(expr, with, ...) ((void)0) -#define DOCTEST_WARN_NOTHROW(...) ((void)0) -#define DOCTEST_CHECK_NOTHROW(...) ((void)0) -#define DOCTEST_REQUIRE_NOTHROW(...) ((void)0) - -#define DOCTEST_WARN_THROWS_MESSAGE(expr, msg) ((void)0) -#define DOCTEST_CHECK_THROWS_MESSAGE(expr, msg) ((void)0) -#define DOCTEST_REQUIRE_THROWS_MESSAGE(expr, msg) ((void)0) -#define DOCTEST_WARN_THROWS_AS_MESSAGE(expr, ex, msg) ((void)0) -#define DOCTEST_CHECK_THROWS_AS_MESSAGE(expr, ex, msg) ((void)0) -#define DOCTEST_REQUIRE_THROWS_AS_MESSAGE(expr, ex, msg) ((void)0) -#define DOCTEST_WARN_THROWS_WITH_MESSAGE(expr, with, msg) ((void)0) -#define DOCTEST_CHECK_THROWS_WITH_MESSAGE(expr, with, msg) ((void)0) -#define DOCTEST_REQUIRE_THROWS_WITH_MESSAGE(expr, with, msg) ((void)0) -#define DOCTEST_WARN_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) ((void)0) -#define DOCTEST_CHECK_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) ((void)0) -#define DOCTEST_REQUIRE_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) ((void)0) -#define DOCTEST_WARN_NOTHROW_MESSAGE(expr, msg) ((void)0) -#define DOCTEST_CHECK_NOTHROW_MESSAGE(expr, msg) ((void)0) -#define DOCTEST_REQUIRE_NOTHROW_MESSAGE(expr, msg) ((void)0) +#define DOCTEST_WARN_THROWS(...) (static_cast(0)) +#define DOCTEST_CHECK_THROWS(...) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS(...) (static_cast(0)) +#define DOCTEST_WARN_THROWS_AS(expr, ...) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_AS(expr, ...) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_AS(expr, ...) (static_cast(0)) +#define DOCTEST_WARN_THROWS_WITH(expr, ...) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_WITH(expr, ...) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_WITH(expr, ...) (static_cast(0)) +#define DOCTEST_WARN_THROWS_WITH_AS(expr, with, ...) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_WITH_AS(expr, with, ...) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_WITH_AS(expr, with, ...) (static_cast(0)) +#define DOCTEST_WARN_NOTHROW(...) (static_cast(0)) +#define DOCTEST_CHECK_NOTHROW(...) (static_cast(0)) +#define DOCTEST_REQUIRE_NOTHROW(...) (static_cast(0)) + +#define DOCTEST_WARN_THROWS_MESSAGE(expr, msg) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_MESSAGE(expr, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_MESSAGE(expr, msg) (static_cast(0)) +#define DOCTEST_WARN_THROWS_AS_MESSAGE(expr, ex, msg) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_AS_MESSAGE(expr, ex, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_AS_MESSAGE(expr, ex, msg) (static_cast(0)) +#define DOCTEST_WARN_THROWS_WITH_MESSAGE(expr, with, msg) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_WITH_MESSAGE(expr, with, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_WITH_MESSAGE(expr, with, msg) (static_cast(0)) +#define DOCTEST_WARN_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) (static_cast(0)) +#define DOCTEST_WARN_NOTHROW_MESSAGE(expr, msg) (static_cast(0)) +#define DOCTEST_CHECK_NOTHROW_MESSAGE(expr, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_NOTHROW_MESSAGE(expr, msg) (static_cast(0)) #else // DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS @@ -2304,86 +2335,86 @@ #define DOCTEST_REGISTER_REPORTER(name, priority, reporter) #define DOCTEST_REGISTER_LISTENER(name, priority, reporter) -#define DOCTEST_INFO(x) ((void)0) -#define DOCTEST_CAPTURE(x) ((void)0) -#define DOCTEST_ADD_MESSAGE_AT(file, line, x) ((void)0) -#define DOCTEST_ADD_FAIL_CHECK_AT(file, line, x) ((void)0) -#define DOCTEST_ADD_FAIL_AT(file, line, x) ((void)0) -#define DOCTEST_MESSAGE(x) ((void)0) -#define DOCTEST_FAIL_CHECK(x) ((void)0) -#define DOCTEST_FAIL(x) ((void)0) - -#define DOCTEST_WARN(...) ((void)0) -#define DOCTEST_CHECK(...) ((void)0) -#define DOCTEST_REQUIRE(...) ((void)0) -#define DOCTEST_WARN_FALSE(...) ((void)0) -#define DOCTEST_CHECK_FALSE(...) ((void)0) -#define DOCTEST_REQUIRE_FALSE(...) ((void)0) - -#define DOCTEST_WARN_MESSAGE(cond, msg) ((void)0) -#define DOCTEST_CHECK_MESSAGE(cond, msg) ((void)0) -#define DOCTEST_REQUIRE_MESSAGE(cond, msg) ((void)0) -#define DOCTEST_WARN_FALSE_MESSAGE(cond, msg) ((void)0) -#define DOCTEST_CHECK_FALSE_MESSAGE(cond, msg) ((void)0) -#define DOCTEST_REQUIRE_FALSE_MESSAGE(cond, msg) ((void)0) - -#define DOCTEST_WARN_THROWS(...) ((void)0) -#define DOCTEST_CHECK_THROWS(...) ((void)0) -#define DOCTEST_REQUIRE_THROWS(...) ((void)0) -#define DOCTEST_WARN_THROWS_AS(expr, ...) ((void)0) -#define DOCTEST_CHECK_THROWS_AS(expr, ...) ((void)0) -#define DOCTEST_REQUIRE_THROWS_AS(expr, ...) ((void)0) -#define DOCTEST_WARN_THROWS_WITH(expr, ...) ((void)0) -#define DOCTEST_CHECK_THROWS_WITH(expr, ...) ((void)0) -#define DOCTEST_REQUIRE_THROWS_WITH(expr, ...) ((void)0) -#define DOCTEST_WARN_THROWS_WITH_AS(expr, with, ...) ((void)0) -#define DOCTEST_CHECK_THROWS_WITH_AS(expr, with, ...) ((void)0) -#define DOCTEST_REQUIRE_THROWS_WITH_AS(expr, with, ...) ((void)0) -#define DOCTEST_WARN_NOTHROW(...) ((void)0) -#define DOCTEST_CHECK_NOTHROW(...) ((void)0) -#define DOCTEST_REQUIRE_NOTHROW(...) ((void)0) - -#define DOCTEST_WARN_THROWS_MESSAGE(expr, msg) ((void)0) -#define DOCTEST_CHECK_THROWS_MESSAGE(expr, msg) ((void)0) -#define DOCTEST_REQUIRE_THROWS_MESSAGE(expr, msg) ((void)0) -#define DOCTEST_WARN_THROWS_AS_MESSAGE(expr, ex, msg) ((void)0) -#define DOCTEST_CHECK_THROWS_AS_MESSAGE(expr, ex, msg) ((void)0) -#define DOCTEST_REQUIRE_THROWS_AS_MESSAGE(expr, ex, msg) ((void)0) -#define DOCTEST_WARN_THROWS_WITH_MESSAGE(expr, with, msg) ((void)0) -#define DOCTEST_CHECK_THROWS_WITH_MESSAGE(expr, with, msg) ((void)0) -#define DOCTEST_REQUIRE_THROWS_WITH_MESSAGE(expr, with, msg) ((void)0) -#define DOCTEST_WARN_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) ((void)0) -#define DOCTEST_CHECK_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) ((void)0) -#define DOCTEST_REQUIRE_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) ((void)0) -#define DOCTEST_WARN_NOTHROW_MESSAGE(expr, msg) ((void)0) -#define DOCTEST_CHECK_NOTHROW_MESSAGE(expr, msg) ((void)0) -#define DOCTEST_REQUIRE_NOTHROW_MESSAGE(expr, msg) ((void)0) - -#define DOCTEST_WARN_EQ(...) ((void)0) -#define DOCTEST_CHECK_EQ(...) ((void)0) -#define DOCTEST_REQUIRE_EQ(...) ((void)0) -#define DOCTEST_WARN_NE(...) ((void)0) -#define DOCTEST_CHECK_NE(...) ((void)0) -#define DOCTEST_REQUIRE_NE(...) ((void)0) -#define DOCTEST_WARN_GT(...) ((void)0) -#define DOCTEST_CHECK_GT(...) ((void)0) -#define DOCTEST_REQUIRE_GT(...) ((void)0) -#define DOCTEST_WARN_LT(...) ((void)0) -#define DOCTEST_CHECK_LT(...) ((void)0) -#define DOCTEST_REQUIRE_LT(...) ((void)0) -#define DOCTEST_WARN_GE(...) ((void)0) -#define DOCTEST_CHECK_GE(...) ((void)0) -#define DOCTEST_REQUIRE_GE(...) ((void)0) -#define DOCTEST_WARN_LE(...) ((void)0) -#define DOCTEST_CHECK_LE(...) ((void)0) -#define DOCTEST_REQUIRE_LE(...) ((void)0) - -#define DOCTEST_WARN_UNARY(...) ((void)0) -#define DOCTEST_CHECK_UNARY(...) ((void)0) -#define DOCTEST_REQUIRE_UNARY(...) ((void)0) -#define DOCTEST_WARN_UNARY_FALSE(...) ((void)0) -#define DOCTEST_CHECK_UNARY_FALSE(...) ((void)0) -#define DOCTEST_REQUIRE_UNARY_FALSE(...) ((void)0) +#define DOCTEST_INFO(x) (static_cast(0)) +#define DOCTEST_CAPTURE(x) (static_cast(0)) +#define DOCTEST_ADD_MESSAGE_AT(file, line, x) (static_cast(0)) +#define DOCTEST_ADD_FAIL_CHECK_AT(file, line, x) (static_cast(0)) +#define DOCTEST_ADD_FAIL_AT(file, line, x) (static_cast(0)) +#define DOCTEST_MESSAGE(x) (static_cast(0)) +#define DOCTEST_FAIL_CHECK(x) (static_cast(0)) +#define DOCTEST_FAIL(x) (static_cast(0)) + +#define DOCTEST_WARN(...) (static_cast(0)) +#define DOCTEST_CHECK(...) (static_cast(0)) +#define DOCTEST_REQUIRE(...) (static_cast(0)) +#define DOCTEST_WARN_FALSE(...) (static_cast(0)) +#define DOCTEST_CHECK_FALSE(...) (static_cast(0)) +#define DOCTEST_REQUIRE_FALSE(...) (static_cast(0)) + +#define DOCTEST_WARN_MESSAGE(cond, msg) (static_cast(0)) +#define DOCTEST_CHECK_MESSAGE(cond, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_MESSAGE(cond, msg) (static_cast(0)) +#define DOCTEST_WARN_FALSE_MESSAGE(cond, msg) (static_cast(0)) +#define DOCTEST_CHECK_FALSE_MESSAGE(cond, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_FALSE_MESSAGE(cond, msg) (static_cast(0)) + +#define DOCTEST_WARN_THROWS(...) (static_cast(0)) +#define DOCTEST_CHECK_THROWS(...) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS(...) (static_cast(0)) +#define DOCTEST_WARN_THROWS_AS(expr, ...) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_AS(expr, ...) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_AS(expr, ...) (static_cast(0)) +#define DOCTEST_WARN_THROWS_WITH(expr, ...) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_WITH(expr, ...) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_WITH(expr, ...) (static_cast(0)) +#define DOCTEST_WARN_THROWS_WITH_AS(expr, with, ...) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_WITH_AS(expr, with, ...) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_WITH_AS(expr, with, ...) (static_cast(0)) +#define DOCTEST_WARN_NOTHROW(...) (static_cast(0)) +#define DOCTEST_CHECK_NOTHROW(...) (static_cast(0)) +#define DOCTEST_REQUIRE_NOTHROW(...) (static_cast(0)) + +#define DOCTEST_WARN_THROWS_MESSAGE(expr, msg) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_MESSAGE(expr, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_MESSAGE(expr, msg) (static_cast(0)) +#define DOCTEST_WARN_THROWS_AS_MESSAGE(expr, ex, msg) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_AS_MESSAGE(expr, ex, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_AS_MESSAGE(expr, ex, msg) (static_cast(0)) +#define DOCTEST_WARN_THROWS_WITH_MESSAGE(expr, with, msg) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_WITH_MESSAGE(expr, with, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_WITH_MESSAGE(expr, with, msg) (static_cast(0)) +#define DOCTEST_WARN_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) (static_cast(0)) +#define DOCTEST_WARN_NOTHROW_MESSAGE(expr, msg) (static_cast(0)) +#define DOCTEST_CHECK_NOTHROW_MESSAGE(expr, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_NOTHROW_MESSAGE(expr, msg) (static_cast(0)) + +#define DOCTEST_WARN_EQ(...) (static_cast(0)) +#define DOCTEST_CHECK_EQ(...) (static_cast(0)) +#define DOCTEST_REQUIRE_EQ(...) (static_cast(0)) +#define DOCTEST_WARN_NE(...) (static_cast(0)) +#define DOCTEST_CHECK_NE(...) (static_cast(0)) +#define DOCTEST_REQUIRE_NE(...) (static_cast(0)) +#define DOCTEST_WARN_GT(...) (static_cast(0)) +#define DOCTEST_CHECK_GT(...) (static_cast(0)) +#define DOCTEST_REQUIRE_GT(...) (static_cast(0)) +#define DOCTEST_WARN_LT(...) (static_cast(0)) +#define DOCTEST_CHECK_LT(...) (static_cast(0)) +#define DOCTEST_REQUIRE_LT(...) (static_cast(0)) +#define DOCTEST_WARN_GE(...) (static_cast(0)) +#define DOCTEST_CHECK_GE(...) (static_cast(0)) +#define DOCTEST_REQUIRE_GE(...) (static_cast(0)) +#define DOCTEST_WARN_LE(...) (static_cast(0)) +#define DOCTEST_CHECK_LE(...) (static_cast(0)) +#define DOCTEST_REQUIRE_LE(...) (static_cast(0)) + +#define DOCTEST_WARN_UNARY(...) (static_cast(0)) +#define DOCTEST_CHECK_UNARY(...) (static_cast(0)) +#define DOCTEST_REQUIRE_UNARY(...) (static_cast(0)) +#define DOCTEST_WARN_UNARY_FALSE(...) (static_cast(0)) +#define DOCTEST_CHECK_UNARY_FALSE(...) (static_cast(0)) +#define DOCTEST_REQUIRE_UNARY_FALSE(...) (static_cast(0)) #endif // DOCTEST_CONFIG_DISABLE @@ -3736,8 +3767,8 @@ DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH("-Wdeprecated-declarations") void color_to_stream(std::ostream& s, Color::Enum code) { - ((void)s); // for DOCTEST_CONFIG_COLORS_NONE or DOCTEST_CONFIG_COLORS_WINDOWS - ((void)code); // for DOCTEST_CONFIG_COLORS_NONE + static_cast(s); // for DOCTEST_CONFIG_COLORS_NONE or DOCTEST_CONFIG_COLORS_WINDOWS + static_cast(code); // for DOCTEST_CONFIG_COLORS_NONE #ifdef DOCTEST_CONFIG_COLORS_ANSI if(g_no_colors || (isatty(STDOUT_FILENO) == false && getContextOptions()->force_colors == false)) @@ -3843,7 +3874,28 @@ #ifdef DOCTEST_IS_DEBUGGER_ACTIVE bool isDebuggerActive() { return DOCTEST_IS_DEBUGGER_ACTIVE(); } #else // DOCTEST_IS_DEBUGGER_ACTIVE -#ifdef DOCTEST_PLATFORM_MAC +#ifdef DOCTEST_PLATFORM_LINUX + class ErrnoGuard { + public: + ErrnoGuard() : m_oldErrno(errno) {} + ~ErrnoGuard() { errno = m_oldErrno; } + private: + int m_oldErrno; + }; + // See the comments in Catch2 for the reasoning behind this implementation: + // https://github.com/catchorg/Catch2/blob/v2.13.1/include/internal/catch_debugger.cpp#L79-L102 + bool isDebuggerActive() { + ErrnoGuard guard; + std::ifstream in("/proc/self/status"); + for(std::string line; std::getline(in, line);) { + static const int PREFIX_LEN = 11; + if(line.compare(0, PREFIX_LEN, "TracerPid:\t") == 0) { + return line.length() > PREFIX_LEN && line[PREFIX_LEN] != '0'; + } + } + return false; + } +#elif defined(DOCTEST_PLATFORM_MAC) // The following function is taken directly from the following technical note: // https://developer.apple.com/library/archive/qa/qa1361/_index.html // Returns true if the current process is being debugged (either @@ -5454,25 +5506,28 @@ separator_to_stream(); s << std::dec; + auto totwidth = int(std::ceil(log10((std::max(p.numTestCasesPassingFilters, static_cast(p.numAsserts))) + 1))); + auto passwidth = int(std::ceil(log10((std::max(p.numTestCasesPassingFilters - p.numTestCasesFailed, static_cast(p.numAsserts - p.numAssertsFailed))) + 1))); + auto failwidth = int(std::ceil(log10((std::max(p.numTestCasesFailed, static_cast(p.numAssertsFailed))) + 1))); const bool anythingFailed = p.numTestCasesFailed > 0 || p.numAssertsFailed > 0; - s << Color::Cyan << "[doctest] " << Color::None << "test cases: " << std::setw(6) + s << Color::Cyan << "[doctest] " << Color::None << "test cases: " << std::setw(totwidth) << p.numTestCasesPassingFilters << " | " << ((p.numTestCasesPassingFilters == 0 || anythingFailed) ? Color::None : Color::Green) - << std::setw(6) << p.numTestCasesPassingFilters - p.numTestCasesFailed << " passed" + << std::setw(passwidth) << p.numTestCasesPassingFilters - p.numTestCasesFailed << " passed" << Color::None << " | " << (p.numTestCasesFailed > 0 ? Color::Red : Color::None) - << std::setw(6) << p.numTestCasesFailed << " failed" << Color::None << " | "; + << std::setw(failwidth) << p.numTestCasesFailed << " failed" << Color::None << " |"; if(opt.no_skipped_summary == false) { const int numSkipped = p.numTestCases - p.numTestCasesPassingFilters; - s << (numSkipped == 0 ? Color::None : Color::Yellow) << std::setw(6) << numSkipped + s << " " << (numSkipped == 0 ? Color::None : Color::Yellow) << numSkipped << " skipped" << Color::None; } s << "\n"; - s << Color::Cyan << "[doctest] " << Color::None << "assertions: " << std::setw(6) + s << Color::Cyan << "[doctest] " << Color::None << "assertions: " << std::setw(totwidth) << p.numAsserts << " | " << ((p.numAsserts == 0 || anythingFailed) ? Color::None : Color::Green) - << std::setw(6) << (p.numAsserts - p.numAssertsFailed) << " passed" << Color::None - << " | " << (p.numAssertsFailed > 0 ? Color::Red : Color::None) << std::setw(6) + << std::setw(passwidth) << (p.numAsserts - p.numAssertsFailed) << " passed" << Color::None + << " | " << (p.numAssertsFailed > 0 ? Color::Red : Color::None) << std::setw(failwidth) << p.numAssertsFailed << " failed" << Color::None << " |\n"; s << Color::Cyan << "[doctest] " << Color::None << "Status: " << (p.numTestCasesFailed > 0 ? Color::Red : Color::Green) diff -Nru doctest-2.4.0+repack0/doctest/extensions/doctest_mpi.h doctest-2.4.1+repack0/doctest/extensions/doctest_mpi.h --- doctest-2.4.0+repack0/doctest/extensions/doctest_mpi.h 1970-01-01 00:00:00.000000000 +0000 +++ doctest-2.4.1+repack0/doctest/extensions/doctest_mpi.h 2020-11-06 17:28:50.000000000 +0000 @@ -0,0 +1,120 @@ +#pragma once + +#ifdef DOCTEST_CONFIG_IMPLEMENT + +#include "doctest/doctest.h" +#include "mpi_reporter.h" + +#else + +#include "mpi.h" +#include +#include +#include "doctest/doctest.h" +#include +#include + +namespace doctest { + +inline +int mpi_world_nb_procs() { + int n; + MPI_Comm_size(MPI_COMM_WORLD, &n); + return n; +} + +struct mpi_sub_comm { + int nb_procs; + int rank; + MPI_Comm comm; + + mpi_sub_comm( mpi_sub_comm const& ) = delete; + mpi_sub_comm& operator=( mpi_sub_comm const& ) = delete; + + mpi_sub_comm(int nb_prcs) noexcept + : nb_procs(nb_prcs) + , rank(-1) + , comm(MPI_COMM_NULL) + { + int comm_world_rank; + MPI_Comm_rank(MPI_COMM_WORLD, &comm_world_rank); + if (nb_procs>mpi_world_nb_procs()) { + if (comm_world_rank==0) { + MESSAGE( + "Unable to run test: need "+std::to_string(nb_procs) + " procs" + + " but program launched with only "+std::to_string(doctest::mpi_world_nb_procs()) + "." + ); + CHECK(nb_procs<=mpi_world_nb_procs()); + } + } else { + int color = MPI_UNDEFINED; + if(comm_world_rank < nb_procs){ + color = 0; + } + MPI_Comm_split(MPI_COMM_WORLD, color, comm_world_rank, &comm); + + if(comm != MPI_COMM_NULL){ + MPI_Comm_rank(comm, &rank); + assert(rank==comm_world_rank); + } + } + } + + ~mpi_sub_comm() { + if(comm != MPI_COMM_NULL){ + MPI_Comm_free(&comm); + } + } +}; + + +template +void execute_mpi_test_case(F func) { + mpi_sub_comm sub(nb_procs); + if (sub.comm != MPI_COMM_NULL) { + func(sub.rank,nb_procs,sub.comm,std::integral_constant{}); + }; +} + +} // doctest + + +#define DOCTEST_MPI_GEN_ASSERTION(rank_to_test, assertion, ...) \ + static_assert(rank_to_test); \ + TEST_CASE(name * doctest::description("MPI_TEST_CASE")) { \ + doctest::execute_mpi_test_case(func); \ + } \ + static void func(DOCTEST_UNUSED int test_rank, DOCTEST_UNUSED int test_nb_procs, DOCTEST_UNUSED MPI_Comm test_comm, DOCTEST_UNUSED std::integral_constant test_nb_procs_as_int_constant) + // DOC: test_rank, test_nb_procs, and test_comm are available UNDER THESE SPECIFIC NAMES in the body of the unit test + // DOC: test_nb_procs_as_int_constant is equal to test_nb_procs, but as a compile time value + // (used in CHECK-like macros to assert the checked rank exists) + +#define DOCTEST_MPI_TEST_CASE(name,nb_procs) \ + DOCTEST_CREATE_MPI_TEST_CASE(name,nb_procs,DOCTEST_ANONYMOUS(DOCTEST_MPI_FUNC)) + + +// == SHORT VERSIONS OF THE MACROS +#if !defined(DOCTEST_CONFIG_NO_SHORT_MACRO_NAMES) +#define MPI_WARN DOCTEST_MPI_WARN +#define MPI_CHECK DOCTEST_MPI_CHECK +#define MPI_REQUIRE DOCTEST_MPI_REQUIRE +#define MPI_WARN_FALSE DOCTEST_MPI_WARN_FALSE +#define MPI_CHECK_FALSE DOCTEST_MPI_CHECK_FALSE +#define MPI_REQUIRE_FALSE DOCTEST_MPI_REQUIRE_FALSE + +#define MPI_TEST_CASE DOCTEST_MPI_TEST_CASE +#endif // DOCTEST_CONFIG_NO_SHORT_MACRO_NAMES + + +#endif // DOCTEST_CONFIG_IMPLEMENT diff -Nru doctest-2.4.0+repack0/doctest/extensions/doctest_util.h doctest-2.4.1+repack0/doctest/extensions/doctest_util.h --- doctest-2.4.0+repack0/doctest/extensions/doctest_util.h 1970-01-01 00:00:00.000000000 +0000 +++ doctest-2.4.1+repack0/doctest/extensions/doctest_util.h 2020-11-06 17:28:50.000000000 +0000 @@ -0,0 +1,34 @@ +// +// doctest_util.h - an accompanying extensions header to the main doctest.h header +// +// Copyright (c) 2016-2020 Viktor Kirilov +// +// Distributed under the MIT Software License +// See accompanying file LICENSE.txt or copy at +// https://opensource.org/licenses/MIT +// +// The documentation can be found at the library's page: +// https://github.com/onqtam/doctest/blob/master/doc/markdown/readme.md +// + +#pragma once + +#ifndef DOCTEST_LIBRARY_INCLUDED +#include "../doctest.h" +#endif + +#include +#include +#include + +namespace doctest { + + inline void applyCommandLine(doctest::Context& ctx, const std::vector& args) { + auto doctest_args = std::make_unique(args.size()); + for (size_t i = 0; i < args.size(); ++i) { + doctest_args[i] = args[i].c_str(); + } + ctx.applyCommandLine(args.size(), doctest_args.get()); + } + +} // namespace doctest diff -Nru doctest-2.4.0+repack0/doctest/extensions/mpi_reporter.h doctest-2.4.1+repack0/doctest/extensions/mpi_reporter.h --- doctest-2.4.0+repack0/doctest/extensions/mpi_reporter.h 1970-01-01 00:00:00.000000000 +0000 +++ doctest-2.4.1+repack0/doctest/extensions/mpi_reporter.h 2020-11-06 17:28:50.000000000 +0000 @@ -0,0 +1,236 @@ +#pragma once + +// #include +#include +#include +#include "mpi.h" + + +#include +#include + +namespace doctest { + +namespace { + +// https://stackoverflow.com/a/11826666/1583122 +struct NullBuffer : std::streambuf { + int overflow(int c) { return c; } +}; +class NullStream : public std::ostream { + public: + NullStream() + : std::ostream(&nullBuff) + {} + private: + NullBuffer nullBuff = {}; +}; +static NullStream nullStream; + + +/* \brief Extends the ConsoleReporter of doctest + * Each process writes its results to its own file + * Intended to be used when a test assertion fails and the user wants to know exactly what happens on which process + */ +struct MpiFileReporter : public ConsoleReporter { + std::ofstream logfile_stream = {}; + + MpiFileReporter(const ContextOptions& co) + : ConsoleReporter(co,logfile_stream) + { + int rank = 0; + MPI_Comm_rank(MPI_COMM_WORLD, &rank); + + std::string logfile_name = "doctest_" + std::to_string(rank) + ".log"; + + logfile_stream = std::ofstream(logfile_name.c_str(), std::fstream::out); + } +}; + + +/* \brief Extends the ConsoleReporter of doctest + * Allows to manage the execution of tests in a parallel framework + * All results are collected on rank 0 + */ +struct MpiConsoleReporter : public ConsoleReporter { +private: + static std::ostream& replace_by_null_if_not_rank_0(std::ostream* os) { + int rank = 0; + MPI_Comm_rank(MPI_COMM_WORLD, &rank); + if (rank==0) { + return *os; + } else { + return nullStream; + } + } +public: + MpiConsoleReporter(const ContextOptions& co) + : ConsoleReporter(co,replace_by_null_if_not_rank_0(co.cout)) + {} + + std::string file_line_to_string(const char* file, int line, + const char* tail = ""){ + std::stringstream ss; + ss << skipPathFromFilename(file) + << (opt.gnu_file_line ? ":" : "(") + << (opt.no_line_numbers ? 0 : line) // 0 or the real num depending on the option + << (opt.gnu_file_line ? ":" : "):") << tail; + return ss.str(); + } + + void test_run_end(const TestRunStats& p) override { + ConsoleReporter::test_run_end(p); + + const bool anythingFailed = p.numTestCasesFailed > 0 || p.numAssertsFailed > 0; + + // ----------------------------------------------------- + // > Gather information in rank 0 + int n_rank, rank; + MPI_Comm_rank(MPI_COMM_WORLD, &rank); + MPI_Comm_size(MPI_COMM_WORLD, &n_rank); + + int g_numAsserts = 0; + int g_numAssertsFailed = 0; + int g_numTestCasesFailed = 0; + + MPI_Reduce(&p.numAsserts , &g_numAsserts , 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); + MPI_Reduce(&p.numAssertsFailed , &g_numAssertsFailed , 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); + MPI_Reduce(&p.numTestCasesFailed, &g_numTestCasesFailed, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); + + std::vector numAssertsFailedByRank; + if(rank == 0){ + numAssertsFailedByRank.resize(static_cast(n_rank)); + } + + MPI_Gather(&p.numAssertsFailed, 1, MPI_INT, numAssertsFailedByRank.data(), 1, MPI_INT, 0, MPI_COMM_WORLD); + + if(rank == 0) { + separator_to_stream(); + s << Color::Cyan << "[doctest] " << Color::None << "glob assertions: " << std::setw(6) + << g_numAsserts << " | " + << ((g_numAsserts == 0 || anythingFailed) ? Color::None : Color::Green) + << std::setw(6) << (g_numAsserts - g_numAssertsFailed) << " passed" << Color::None + << " | " << (g_numAssertsFailed > 0 ? Color::Red : Color::None) << std::setw(6) + << g_numAssertsFailed << " failed" << Color::None << " |\n"; + + separator_to_stream(); + if(g_numAssertsFailed > 0){ + + s << Color::Cyan << "[doctest] " << Color::None << "fail on rank:" << std::setw(6) << "\n"; + for(std::size_t i = 0; i < numAssertsFailedByRank.size(); ++i){ + if( numAssertsFailedByRank[i] > 0 ){ + s << std::setw(16) << " -> On rank [" << i << "] with " << numAssertsFailedByRank[i] << " test failed" << std::endl; + } + } + } + s << Color::Cyan << "[doctest] " << Color::None + << "Status: " << (g_numTestCasesFailed > 0 ? Color::Red : Color::Green) + << ((g_numTestCasesFailed > 0) ? "FAILURE!" : "SUCCESS!") << Color::None << std::endl; + } + } + + void test_case_end(const CurrentTestCaseStats& st) override { + if (is_mpi_test_case()) { + // function called by every rank at the end of a test + // if failed assertions happended, they have been sent to rank 0 + // here rank zero gathers them and prints them all + + int rank; + MPI_Comm_rank(MPI_COMM_WORLD, &rank); + + // Compute the number of assert with fail among all procs + int nb_fail_asserts_glob = 0; + MPI_Reduce(&st.numAssertsFailedCurrentTest, &nb_fail_asserts_glob, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); + + if(rank == 0) { + MPI_Status status; + MPI_Status status_recv; + + using id_string = std::pair; + std::vector msgs(static_cast(nb_fail_asserts_glob)); + + for (std::size_t i=0; i(nb_fail_asserts_glob); ++i) { + MPI_Probe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status); + + int count; + MPI_Get_count(&status, MPI_BYTE, &count); + + std::string recv_msg(static_cast(count),'\0'); + void* recv_msg_data = const_cast(recv_msg.data()); // const_cast needed. Non-const .data() exists in C++11 though... + MPI_Recv(recv_msg_data, count, MPI_BYTE, status.MPI_SOURCE, + status.MPI_TAG, MPI_COMM_WORLD, &status_recv); + + msgs[i] = {status.MPI_SOURCE,recv_msg}; + } + + std::sort(begin(msgs),end(msgs),[](const id_string& x, const id_string& y){ return x.first < y.first; }); + + // print + if (nb_fail_asserts_glob>0) { + separator_to_stream(); + file_line_to_stream(tc->m_file.c_str(), static_cast(tc->m_line), "\n"); + if(tc->m_test_suite && tc->m_test_suite[0] != '\0') + s << Color::Yellow << "TEST SUITE: " << Color::None << tc->m_test_suite << "\n"; + if(strncmp(tc->m_name, " Scenario:", 11) != 0) + s << Color::Yellow << "TEST CASE: "; + s << Color::None << tc->m_name << "\n\n"; + for(const auto& msg : msgs) { + s << msg.second; + } + s << "\n"; + } + } + } + + ConsoleReporter::test_case_end(st); + } + + bool is_mpi_test_case() const { + return tc->m_description != nullptr + && std::string(tc->m_description) == std::string("MPI_TEST_CASE"); + } + + void log_assert(const AssertData& rb) override { + if (!is_mpi_test_case()) { + ConsoleReporter::log_assert(rb); + } else { + int rank; + MPI_Comm_rank(MPI_COMM_WORLD, &rank); + + + if(!rb.m_failed && !opt.success) + return; + + std::lock_guard lock(mutex); + + std::stringstream failure_msg; + failure_msg << Color::Red << "On rank [" << rank << "] : " << Color::None; + failure_msg << file_line_to_string(rb.m_file, rb.m_line, " "); + + if((rb.m_at & (assertType::is_throws_as | assertType::is_throws_with)) ==0){ + failure_msg << Color::Cyan + << assertString(rb.m_at) + << "( " << rb.m_expr << " ) " + << Color::None + + << (!rb.m_failed ? "is correct!\n" : "is NOT correct!\n") + << " values: " + << assertString(rb.m_at) + << "( " << rb.m_decomp.c_str() << " )\n"; + } + + std::string failure_str = failure_msg.str(); + int failure_msg_size = static_cast(failure_str.size()); + + MPI_Send(failure_str.c_str(), failure_msg_size, MPI_BYTE, + 0, rb.m_line, MPI_COMM_WORLD); // Tag = file line + } + } +}; // MpiConsoleReporter + +// "1" is the priority - used for ordering when multiple reporters/listeners are used +REGISTER_REPORTER("MpiConsoleReporter", 1, MpiConsoleReporter); +REGISTER_REPORTER("MpiFileReporter", 1, MpiFileReporter); + +} // anonymous +} // doctest diff -Nru doctest-2.4.0+repack0/doctest/parts/doctest.cpp doctest-2.4.1+repack0/doctest/parts/doctest.cpp --- doctest-2.4.0+repack0/doctest/parts/doctest.cpp 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/doctest/parts/doctest.cpp 2020-11-06 17:28:50.000000000 +0000 @@ -1125,8 +1125,8 @@ DOCTEST_CLANG_SUPPRESS_WARNING_WITH_PUSH("-Wdeprecated-declarations") void color_to_stream(std::ostream& s, Color::Enum code) { - ((void)s); // for DOCTEST_CONFIG_COLORS_NONE or DOCTEST_CONFIG_COLORS_WINDOWS - ((void)code); // for DOCTEST_CONFIG_COLORS_NONE + static_cast(s); // for DOCTEST_CONFIG_COLORS_NONE or DOCTEST_CONFIG_COLORS_WINDOWS + static_cast(code); // for DOCTEST_CONFIG_COLORS_NONE #ifdef DOCTEST_CONFIG_COLORS_ANSI if(g_no_colors || (isatty(STDOUT_FILENO) == false && getContextOptions()->force_colors == false)) @@ -1232,7 +1232,28 @@ #ifdef DOCTEST_IS_DEBUGGER_ACTIVE bool isDebuggerActive() { return DOCTEST_IS_DEBUGGER_ACTIVE(); } #else // DOCTEST_IS_DEBUGGER_ACTIVE -#ifdef DOCTEST_PLATFORM_MAC +#ifdef DOCTEST_PLATFORM_LINUX + class ErrnoGuard { + public: + ErrnoGuard() : m_oldErrno(errno) {} + ~ErrnoGuard() { errno = m_oldErrno; } + private: + int m_oldErrno; + }; + // See the comments in Catch2 for the reasoning behind this implementation: + // https://github.com/catchorg/Catch2/blob/v2.13.1/include/internal/catch_debugger.cpp#L79-L102 + bool isDebuggerActive() { + ErrnoGuard guard; + std::ifstream in("/proc/self/status"); + for(std::string line; std::getline(in, line);) { + static const int PREFIX_LEN = 11; + if(line.compare(0, PREFIX_LEN, "TracerPid:\t") == 0) { + return line.length() > PREFIX_LEN && line[PREFIX_LEN] != '0'; + } + } + return false; + } +#elif defined(DOCTEST_PLATFORM_MAC) // The following function is taken directly from the following technical note: // https://developer.apple.com/library/archive/qa/qa1361/_index.html // Returns true if the current process is being debugged (either @@ -2843,25 +2864,28 @@ separator_to_stream(); s << std::dec; + auto totwidth = int(std::ceil(log10((std::max(p.numTestCasesPassingFilters, static_cast(p.numAsserts))) + 1))); + auto passwidth = int(std::ceil(log10((std::max(p.numTestCasesPassingFilters - p.numTestCasesFailed, static_cast(p.numAsserts - p.numAssertsFailed))) + 1))); + auto failwidth = int(std::ceil(log10((std::max(p.numTestCasesFailed, static_cast(p.numAssertsFailed))) + 1))); const bool anythingFailed = p.numTestCasesFailed > 0 || p.numAssertsFailed > 0; - s << Color::Cyan << "[doctest] " << Color::None << "test cases: " << std::setw(6) + s << Color::Cyan << "[doctest] " << Color::None << "test cases: " << std::setw(totwidth) << p.numTestCasesPassingFilters << " | " << ((p.numTestCasesPassingFilters == 0 || anythingFailed) ? Color::None : Color::Green) - << std::setw(6) << p.numTestCasesPassingFilters - p.numTestCasesFailed << " passed" + << std::setw(passwidth) << p.numTestCasesPassingFilters - p.numTestCasesFailed << " passed" << Color::None << " | " << (p.numTestCasesFailed > 0 ? Color::Red : Color::None) - << std::setw(6) << p.numTestCasesFailed << " failed" << Color::None << " | "; + << std::setw(failwidth) << p.numTestCasesFailed << " failed" << Color::None << " |"; if(opt.no_skipped_summary == false) { const int numSkipped = p.numTestCases - p.numTestCasesPassingFilters; - s << (numSkipped == 0 ? Color::None : Color::Yellow) << std::setw(6) << numSkipped + s << " " << (numSkipped == 0 ? Color::None : Color::Yellow) << numSkipped << " skipped" << Color::None; } s << "\n"; - s << Color::Cyan << "[doctest] " << Color::None << "assertions: " << std::setw(6) + s << Color::Cyan << "[doctest] " << Color::None << "assertions: " << std::setw(totwidth) << p.numAsserts << " | " << ((p.numAsserts == 0 || anythingFailed) ? Color::None : Color::Green) - << std::setw(6) << (p.numAsserts - p.numAssertsFailed) << " passed" << Color::None - << " | " << (p.numAssertsFailed > 0 ? Color::Red : Color::None) << std::setw(6) + << std::setw(passwidth) << (p.numAsserts - p.numAssertsFailed) << " passed" << Color::None + << " | " << (p.numAssertsFailed > 0 ? Color::Red : Color::None) << std::setw(failwidth) << p.numAssertsFailed << " failed" << Color::None << " |\n"; s << Color::Cyan << "[doctest] " << Color::None << "Status: " << (p.numTestCasesFailed > 0 ? Color::Red : Color::Green) diff -Nru doctest-2.4.0+repack0/doctest/parts/doctest_fwd.h doctest-2.4.1+repack0/doctest/parts/doctest_fwd.h --- doctest-2.4.0+repack0/doctest/parts/doctest_fwd.h 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/doctest/parts/doctest_fwd.h 2020-11-06 17:28:50.000000000 +0000 @@ -1,7 +1,7 @@ // // doctest.h - the lightest feature-rich C++ single-header testing framework for unit tests and TDD // -// Copyright (c) 2016-2019 Viktor Kirilov +// Copyright (c) 2016-2020 Viktor Kirilov // // Distributed under the MIT Software License // See accompanying file LICENSE.txt or copy at @@ -45,8 +45,8 @@ #define DOCTEST_VERSION_MAJOR 2 #define DOCTEST_VERSION_MINOR 4 -#define DOCTEST_VERSION_PATCH 0 -#define DOCTEST_VERSION_STR "2.4.0" +#define DOCTEST_VERSION_PATCH 1 +#define DOCTEST_VERSION_STR "2.4.1" #define DOCTEST_VERSION \ (DOCTEST_VERSION_MAJOR * 10000 + DOCTEST_VERSION_MINOR * 100 + DOCTEST_VERSION_PATCH) @@ -298,11 +298,15 @@ #define DOCTEST_NOINLINE __declspec(noinline) #define DOCTEST_UNUSED #define DOCTEST_ALIGNMENT(x) -#else // MSVC +#elif DOCTEST_CLANG && DOCTEST_CLANG < DOCTEST_COMPILER(3, 5, 0) +#define DOCTEST_NOINLINE +#define DOCTEST_UNUSED +#define DOCTEST_ALIGNMENT(x) +#else #define DOCTEST_NOINLINE __attribute__((noinline)) #define DOCTEST_UNUSED __attribute__((unused)) #define DOCTEST_ALIGNMENT(x) __attribute__((aligned(x))) -#endif // MSVC +#endif #ifndef DOCTEST_NORETURN #define DOCTEST_NORETURN [[noreturn]] @@ -352,8 +356,20 @@ #ifndef DOCTEST_BREAK_INTO_DEBUGGER // should probably take a look at https://github.com/scottt/debugbreak -#ifdef DOCTEST_PLATFORM_MAC +#ifdef DOCTEST_PLATFORM_LINUX +#if defined(__GNUC__) && (defined(__i386) || defined(__x86_64)) +// Break at the location of the failing check if possible +#define DOCTEST_BREAK_INTO_DEBUGGER() __asm__("int $3\n" : :) +#else +#include +#define DOCTEST_BREAK_INTO_DEBUGGER() raise(SIGTRAP) +#endif +#elif defined(DOCTEST_PLATFORM_MAC) +#if defined(__x86_64) || defined(__x86_64__) || defined(__amd64__) #define DOCTEST_BREAK_INTO_DEBUGGER() __asm__("int $3\n" : :) +#else +#define DOCTEST_BREAK_INTO_DEBUGGER() __asm__("brk #0"); +#endif #elif DOCTEST_MSVC #define DOCTEST_BREAK_INTO_DEBUGGER() __debugbreak() #elif defined(__MINGW32__) @@ -362,7 +378,7 @@ DOCTEST_GCC_SUPPRESS_WARNING_POP #define DOCTEST_BREAK_INTO_DEBUGGER() ::DebugBreak() #else // linux -#define DOCTEST_BREAK_INTO_DEBUGGER() ((void)0) +#define DOCTEST_BREAK_INTO_DEBUGGER() (static_cast(0)) #endif // linux #endif // DOCTEST_BREAK_INTO_DEBUGGER @@ -372,6 +388,9 @@ #endif // DOCTEST_CONFIG_USE_IOSFWD #ifdef DOCTEST_CONFIG_USE_STD_HEADERS +#ifndef DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS +#define DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS +#endif // DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS #include #include #include @@ -737,7 +756,6 @@ }; namespace detail { -#if defined(DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING) || defined(DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS) template struct enable_if {}; @@ -745,7 +763,6 @@ template struct enable_if { typedef TYPE type; }; -#endif // DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING) || DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS // clang-format off template struct remove_reference { typedef T type; }; @@ -754,6 +771,14 @@ template struct remove_const { typedef T type; }; template struct remove_const { typedef T type; }; +#ifdef DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS + template struct is_enum : public std::is_enum {}; + template struct underlying_type : public std::underlying_type {}; +#else + // Use compiler intrinsics + template struct is_enum { constexpr static bool value = __is_enum(T); }; + template struct underlying_type { typedef __underlying_type(T) type; }; +#endif // clang-format on template @@ -768,12 +793,12 @@ template struct check { - static constexpr auto value = false; + static constexpr bool value = false; }; template struct check(), void())> { - static constexpr auto value = true; + static constexpr bool value = true; }; } // namespace has_insertion_operator_impl @@ -842,7 +867,7 @@ } }; -template +template ::value, bool>::type = true> String toString(const DOCTEST_REF_WRAP(T) value) { return StringMaker::convert(value); } @@ -869,6 +894,12 @@ DOCTEST_INTERFACE String toString(int long long unsigned in); DOCTEST_INTERFACE String toString(std::nullptr_t in); +template ::value, bool>::type = true> +String toString(const DOCTEST_REF_WRAP(T) value) { + typedef typename detail::underlying_type::type UT; + return toString(static_cast(value)); +} + #if DOCTEST_MSVC >= DOCTEST_COMPILER(19, 20, 0) // see this issue on why this is needed: https://github.com/onqtam/doctest/issues/183 DOCTEST_INTERFACE String toString(const std::string& in); @@ -1280,12 +1311,12 @@ template struct RelationalComparator { bool operator()(const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) const { return op(lhs, rhs); } }; // clang-format on - DOCTEST_BINARY_RELATIONAL_OP(0, eq) - DOCTEST_BINARY_RELATIONAL_OP(1, ne) - DOCTEST_BINARY_RELATIONAL_OP(2, gt) - DOCTEST_BINARY_RELATIONAL_OP(3, lt) - DOCTEST_BINARY_RELATIONAL_OP(4, ge) - DOCTEST_BINARY_RELATIONAL_OP(5, le) + DOCTEST_BINARY_RELATIONAL_OP(0, doctest::detail::eq) + DOCTEST_BINARY_RELATIONAL_OP(1, doctest::detail::ne) + DOCTEST_BINARY_RELATIONAL_OP(2, doctest::detail::gt) + DOCTEST_BINARY_RELATIONAL_OP(3, doctest::detail::lt) + DOCTEST_BINARY_RELATIONAL_OP(4, doctest::detail::ge) + DOCTEST_BINARY_RELATIONAL_OP(5, doctest::detail::le) struct DOCTEST_INTERFACE ResultBuilder : public AssertData { @@ -1412,9 +1443,9 @@ } catch(T ex) { // NOLINT res = m_translateFunction(ex); //!OCLINT parameter reassignment return true; - } catch(...) {} //!OCLINT - empty catch statement -#endif // DOCTEST_CONFIG_NO_EXCEPTIONS - ((void)res); // to silence -Wunused-parameter + } catch(...) {} //!OCLINT - empty catch statement +#endif // DOCTEST_CONFIG_NO_EXCEPTIONS + static_cast(res); // to silence -Wunused-parameter return false; } @@ -2180,37 +2211,37 @@ #ifdef DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS -#define DOCTEST_WARN_THROWS(...) ((void)0) -#define DOCTEST_CHECK_THROWS(...) ((void)0) -#define DOCTEST_REQUIRE_THROWS(...) ((void)0) -#define DOCTEST_WARN_THROWS_AS(expr, ...) ((void)0) -#define DOCTEST_CHECK_THROWS_AS(expr, ...) ((void)0) -#define DOCTEST_REQUIRE_THROWS_AS(expr, ...) ((void)0) -#define DOCTEST_WARN_THROWS_WITH(expr, ...) ((void)0) -#define DOCTEST_CHECK_THROWS_WITH(expr, ...) ((void)0) -#define DOCTEST_REQUIRE_THROWS_WITH(expr, ...) ((void)0) -#define DOCTEST_WARN_THROWS_WITH_AS(expr, with, ...) ((void)0) -#define DOCTEST_CHECK_THROWS_WITH_AS(expr, with, ...) ((void)0) -#define DOCTEST_REQUIRE_THROWS_WITH_AS(expr, with, ...) ((void)0) -#define DOCTEST_WARN_NOTHROW(...) ((void)0) -#define DOCTEST_CHECK_NOTHROW(...) ((void)0) -#define DOCTEST_REQUIRE_NOTHROW(...) ((void)0) - -#define DOCTEST_WARN_THROWS_MESSAGE(expr, msg) ((void)0) -#define DOCTEST_CHECK_THROWS_MESSAGE(expr, msg) ((void)0) -#define DOCTEST_REQUIRE_THROWS_MESSAGE(expr, msg) ((void)0) -#define DOCTEST_WARN_THROWS_AS_MESSAGE(expr, ex, msg) ((void)0) -#define DOCTEST_CHECK_THROWS_AS_MESSAGE(expr, ex, msg) ((void)0) -#define DOCTEST_REQUIRE_THROWS_AS_MESSAGE(expr, ex, msg) ((void)0) -#define DOCTEST_WARN_THROWS_WITH_MESSAGE(expr, with, msg) ((void)0) -#define DOCTEST_CHECK_THROWS_WITH_MESSAGE(expr, with, msg) ((void)0) -#define DOCTEST_REQUIRE_THROWS_WITH_MESSAGE(expr, with, msg) ((void)0) -#define DOCTEST_WARN_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) ((void)0) -#define DOCTEST_CHECK_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) ((void)0) -#define DOCTEST_REQUIRE_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) ((void)0) -#define DOCTEST_WARN_NOTHROW_MESSAGE(expr, msg) ((void)0) -#define DOCTEST_CHECK_NOTHROW_MESSAGE(expr, msg) ((void)0) -#define DOCTEST_REQUIRE_NOTHROW_MESSAGE(expr, msg) ((void)0) +#define DOCTEST_WARN_THROWS(...) (static_cast(0)) +#define DOCTEST_CHECK_THROWS(...) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS(...) (static_cast(0)) +#define DOCTEST_WARN_THROWS_AS(expr, ...) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_AS(expr, ...) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_AS(expr, ...) (static_cast(0)) +#define DOCTEST_WARN_THROWS_WITH(expr, ...) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_WITH(expr, ...) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_WITH(expr, ...) (static_cast(0)) +#define DOCTEST_WARN_THROWS_WITH_AS(expr, with, ...) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_WITH_AS(expr, with, ...) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_WITH_AS(expr, with, ...) (static_cast(0)) +#define DOCTEST_WARN_NOTHROW(...) (static_cast(0)) +#define DOCTEST_CHECK_NOTHROW(...) (static_cast(0)) +#define DOCTEST_REQUIRE_NOTHROW(...) (static_cast(0)) + +#define DOCTEST_WARN_THROWS_MESSAGE(expr, msg) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_MESSAGE(expr, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_MESSAGE(expr, msg) (static_cast(0)) +#define DOCTEST_WARN_THROWS_AS_MESSAGE(expr, ex, msg) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_AS_MESSAGE(expr, ex, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_AS_MESSAGE(expr, ex, msg) (static_cast(0)) +#define DOCTEST_WARN_THROWS_WITH_MESSAGE(expr, with, msg) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_WITH_MESSAGE(expr, with, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_WITH_MESSAGE(expr, with, msg) (static_cast(0)) +#define DOCTEST_WARN_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) (static_cast(0)) +#define DOCTEST_WARN_NOTHROW_MESSAGE(expr, msg) (static_cast(0)) +#define DOCTEST_CHECK_NOTHROW_MESSAGE(expr, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_NOTHROW_MESSAGE(expr, msg) (static_cast(0)) #else // DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS @@ -2301,86 +2332,86 @@ #define DOCTEST_REGISTER_REPORTER(name, priority, reporter) #define DOCTEST_REGISTER_LISTENER(name, priority, reporter) -#define DOCTEST_INFO(x) ((void)0) -#define DOCTEST_CAPTURE(x) ((void)0) -#define DOCTEST_ADD_MESSAGE_AT(file, line, x) ((void)0) -#define DOCTEST_ADD_FAIL_CHECK_AT(file, line, x) ((void)0) -#define DOCTEST_ADD_FAIL_AT(file, line, x) ((void)0) -#define DOCTEST_MESSAGE(x) ((void)0) -#define DOCTEST_FAIL_CHECK(x) ((void)0) -#define DOCTEST_FAIL(x) ((void)0) - -#define DOCTEST_WARN(...) ((void)0) -#define DOCTEST_CHECK(...) ((void)0) -#define DOCTEST_REQUIRE(...) ((void)0) -#define DOCTEST_WARN_FALSE(...) ((void)0) -#define DOCTEST_CHECK_FALSE(...) ((void)0) -#define DOCTEST_REQUIRE_FALSE(...) ((void)0) - -#define DOCTEST_WARN_MESSAGE(cond, msg) ((void)0) -#define DOCTEST_CHECK_MESSAGE(cond, msg) ((void)0) -#define DOCTEST_REQUIRE_MESSAGE(cond, msg) ((void)0) -#define DOCTEST_WARN_FALSE_MESSAGE(cond, msg) ((void)0) -#define DOCTEST_CHECK_FALSE_MESSAGE(cond, msg) ((void)0) -#define DOCTEST_REQUIRE_FALSE_MESSAGE(cond, msg) ((void)0) - -#define DOCTEST_WARN_THROWS(...) ((void)0) -#define DOCTEST_CHECK_THROWS(...) ((void)0) -#define DOCTEST_REQUIRE_THROWS(...) ((void)0) -#define DOCTEST_WARN_THROWS_AS(expr, ...) ((void)0) -#define DOCTEST_CHECK_THROWS_AS(expr, ...) ((void)0) -#define DOCTEST_REQUIRE_THROWS_AS(expr, ...) ((void)0) -#define DOCTEST_WARN_THROWS_WITH(expr, ...) ((void)0) -#define DOCTEST_CHECK_THROWS_WITH(expr, ...) ((void)0) -#define DOCTEST_REQUIRE_THROWS_WITH(expr, ...) ((void)0) -#define DOCTEST_WARN_THROWS_WITH_AS(expr, with, ...) ((void)0) -#define DOCTEST_CHECK_THROWS_WITH_AS(expr, with, ...) ((void)0) -#define DOCTEST_REQUIRE_THROWS_WITH_AS(expr, with, ...) ((void)0) -#define DOCTEST_WARN_NOTHROW(...) ((void)0) -#define DOCTEST_CHECK_NOTHROW(...) ((void)0) -#define DOCTEST_REQUIRE_NOTHROW(...) ((void)0) - -#define DOCTEST_WARN_THROWS_MESSAGE(expr, msg) ((void)0) -#define DOCTEST_CHECK_THROWS_MESSAGE(expr, msg) ((void)0) -#define DOCTEST_REQUIRE_THROWS_MESSAGE(expr, msg) ((void)0) -#define DOCTEST_WARN_THROWS_AS_MESSAGE(expr, ex, msg) ((void)0) -#define DOCTEST_CHECK_THROWS_AS_MESSAGE(expr, ex, msg) ((void)0) -#define DOCTEST_REQUIRE_THROWS_AS_MESSAGE(expr, ex, msg) ((void)0) -#define DOCTEST_WARN_THROWS_WITH_MESSAGE(expr, with, msg) ((void)0) -#define DOCTEST_CHECK_THROWS_WITH_MESSAGE(expr, with, msg) ((void)0) -#define DOCTEST_REQUIRE_THROWS_WITH_MESSAGE(expr, with, msg) ((void)0) -#define DOCTEST_WARN_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) ((void)0) -#define DOCTEST_CHECK_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) ((void)0) -#define DOCTEST_REQUIRE_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) ((void)0) -#define DOCTEST_WARN_NOTHROW_MESSAGE(expr, msg) ((void)0) -#define DOCTEST_CHECK_NOTHROW_MESSAGE(expr, msg) ((void)0) -#define DOCTEST_REQUIRE_NOTHROW_MESSAGE(expr, msg) ((void)0) - -#define DOCTEST_WARN_EQ(...) ((void)0) -#define DOCTEST_CHECK_EQ(...) ((void)0) -#define DOCTEST_REQUIRE_EQ(...) ((void)0) -#define DOCTEST_WARN_NE(...) ((void)0) -#define DOCTEST_CHECK_NE(...) ((void)0) -#define DOCTEST_REQUIRE_NE(...) ((void)0) -#define DOCTEST_WARN_GT(...) ((void)0) -#define DOCTEST_CHECK_GT(...) ((void)0) -#define DOCTEST_REQUIRE_GT(...) ((void)0) -#define DOCTEST_WARN_LT(...) ((void)0) -#define DOCTEST_CHECK_LT(...) ((void)0) -#define DOCTEST_REQUIRE_LT(...) ((void)0) -#define DOCTEST_WARN_GE(...) ((void)0) -#define DOCTEST_CHECK_GE(...) ((void)0) -#define DOCTEST_REQUIRE_GE(...) ((void)0) -#define DOCTEST_WARN_LE(...) ((void)0) -#define DOCTEST_CHECK_LE(...) ((void)0) -#define DOCTEST_REQUIRE_LE(...) ((void)0) - -#define DOCTEST_WARN_UNARY(...) ((void)0) -#define DOCTEST_CHECK_UNARY(...) ((void)0) -#define DOCTEST_REQUIRE_UNARY(...) ((void)0) -#define DOCTEST_WARN_UNARY_FALSE(...) ((void)0) -#define DOCTEST_CHECK_UNARY_FALSE(...) ((void)0) -#define DOCTEST_REQUIRE_UNARY_FALSE(...) ((void)0) +#define DOCTEST_INFO(x) (static_cast(0)) +#define DOCTEST_CAPTURE(x) (static_cast(0)) +#define DOCTEST_ADD_MESSAGE_AT(file, line, x) (static_cast(0)) +#define DOCTEST_ADD_FAIL_CHECK_AT(file, line, x) (static_cast(0)) +#define DOCTEST_ADD_FAIL_AT(file, line, x) (static_cast(0)) +#define DOCTEST_MESSAGE(x) (static_cast(0)) +#define DOCTEST_FAIL_CHECK(x) (static_cast(0)) +#define DOCTEST_FAIL(x) (static_cast(0)) + +#define DOCTEST_WARN(...) (static_cast(0)) +#define DOCTEST_CHECK(...) (static_cast(0)) +#define DOCTEST_REQUIRE(...) (static_cast(0)) +#define DOCTEST_WARN_FALSE(...) (static_cast(0)) +#define DOCTEST_CHECK_FALSE(...) (static_cast(0)) +#define DOCTEST_REQUIRE_FALSE(...) (static_cast(0)) + +#define DOCTEST_WARN_MESSAGE(cond, msg) (static_cast(0)) +#define DOCTEST_CHECK_MESSAGE(cond, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_MESSAGE(cond, msg) (static_cast(0)) +#define DOCTEST_WARN_FALSE_MESSAGE(cond, msg) (static_cast(0)) +#define DOCTEST_CHECK_FALSE_MESSAGE(cond, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_FALSE_MESSAGE(cond, msg) (static_cast(0)) + +#define DOCTEST_WARN_THROWS(...) (static_cast(0)) +#define DOCTEST_CHECK_THROWS(...) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS(...) (static_cast(0)) +#define DOCTEST_WARN_THROWS_AS(expr, ...) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_AS(expr, ...) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_AS(expr, ...) (static_cast(0)) +#define DOCTEST_WARN_THROWS_WITH(expr, ...) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_WITH(expr, ...) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_WITH(expr, ...) (static_cast(0)) +#define DOCTEST_WARN_THROWS_WITH_AS(expr, with, ...) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_WITH_AS(expr, with, ...) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_WITH_AS(expr, with, ...) (static_cast(0)) +#define DOCTEST_WARN_NOTHROW(...) (static_cast(0)) +#define DOCTEST_CHECK_NOTHROW(...) (static_cast(0)) +#define DOCTEST_REQUIRE_NOTHROW(...) (static_cast(0)) + +#define DOCTEST_WARN_THROWS_MESSAGE(expr, msg) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_MESSAGE(expr, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_MESSAGE(expr, msg) (static_cast(0)) +#define DOCTEST_WARN_THROWS_AS_MESSAGE(expr, ex, msg) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_AS_MESSAGE(expr, ex, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_AS_MESSAGE(expr, ex, msg) (static_cast(0)) +#define DOCTEST_WARN_THROWS_WITH_MESSAGE(expr, with, msg) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_WITH_MESSAGE(expr, with, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_WITH_MESSAGE(expr, with, msg) (static_cast(0)) +#define DOCTEST_WARN_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) (static_cast(0)) +#define DOCTEST_CHECK_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_THROWS_WITH_AS_MESSAGE(expr, with, ex, msg) (static_cast(0)) +#define DOCTEST_WARN_NOTHROW_MESSAGE(expr, msg) (static_cast(0)) +#define DOCTEST_CHECK_NOTHROW_MESSAGE(expr, msg) (static_cast(0)) +#define DOCTEST_REQUIRE_NOTHROW_MESSAGE(expr, msg) (static_cast(0)) + +#define DOCTEST_WARN_EQ(...) (static_cast(0)) +#define DOCTEST_CHECK_EQ(...) (static_cast(0)) +#define DOCTEST_REQUIRE_EQ(...) (static_cast(0)) +#define DOCTEST_WARN_NE(...) (static_cast(0)) +#define DOCTEST_CHECK_NE(...) (static_cast(0)) +#define DOCTEST_REQUIRE_NE(...) (static_cast(0)) +#define DOCTEST_WARN_GT(...) (static_cast(0)) +#define DOCTEST_CHECK_GT(...) (static_cast(0)) +#define DOCTEST_REQUIRE_GT(...) (static_cast(0)) +#define DOCTEST_WARN_LT(...) (static_cast(0)) +#define DOCTEST_CHECK_LT(...) (static_cast(0)) +#define DOCTEST_REQUIRE_LT(...) (static_cast(0)) +#define DOCTEST_WARN_GE(...) (static_cast(0)) +#define DOCTEST_CHECK_GE(...) (static_cast(0)) +#define DOCTEST_REQUIRE_GE(...) (static_cast(0)) +#define DOCTEST_WARN_LE(...) (static_cast(0)) +#define DOCTEST_CHECK_LE(...) (static_cast(0)) +#define DOCTEST_REQUIRE_LE(...) (static_cast(0)) + +#define DOCTEST_WARN_UNARY(...) (static_cast(0)) +#define DOCTEST_CHECK_UNARY(...) (static_cast(0)) +#define DOCTEST_REQUIRE_UNARY(...) (static_cast(0)) +#define DOCTEST_WARN_UNARY_FALSE(...) (static_cast(0)) +#define DOCTEST_CHECK_UNARY_FALSE(...) (static_cast(0)) +#define DOCTEST_REQUIRE_UNARY_FALSE(...) (static_cast(0)) #endif // DOCTEST_CONFIG_DISABLE diff -Nru doctest-2.4.0+repack0/examples/all_features/CMakeLists.txt doctest-2.4.1+repack0/examples/all_features/CMakeLists.txt --- doctest-2.4.0+repack0/examples/all_features/CMakeLists.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/CMakeLists.txt 2020-11-06 17:28:50.000000000 +0000 @@ -15,6 +15,7 @@ templated_test_cases.cpp test_cases_and_suites.cpp asserts_used_outside_of_tests.cpp + enums.cpp ) set(files_all diff -Nru doctest-2.4.0+repack0/examples/all_features/enums.cpp doctest-2.4.1+repack0/examples/all_features/enums.cpp --- doctest-2.4.0+repack0/examples/all_features/enums.cpp 1970-01-01 00:00:00.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/enums.cpp 2020-11-06 17:28:50.000000000 +0000 @@ -0,0 +1,109 @@ +#include + +#include "header.h" + +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN +#include +#include +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END + +namespace +{ + +enum StandardEnum +{ + Zero, + One, + Two, +}; + +enum TypedEnum : int64_t +{ + TypedZero, + TypedOne, + TypedTwo, +}; + +enum class EnumClassC : char +{ + Zero = '0', + One = '1', + Two = '2', +}; + +enum class EnumClassSC : signed char +{ + Zero = '0', + One = '1', + Two = '2', +}; + +enum class EnumClassUC : unsigned char +{ + Zero = '0', + One = '1', + Two = '2', +}; + +enum class EnumClassU8 : uint8_t +{ + Zero, + One, + Two, +}; + +template::type> +T printable(E val) +{ + return T(val); +} + +} + +TEST_CASE("enum 1") +{ + std::ostringstream ostr; + ostr << Zero << One << Two; + ostr << TypedZero << TypedOne << TypedTwo; + static_assert(std::is_enum::value, ""); + ostr << printable(EnumClassSC::Zero) << printable(EnumClassSC::One) << printable(EnumClassSC::Two); + + CHECK_EQ(Zero, 0); + CHECK_EQ(One, 1); + CHECK_EQ(Two, 2); + + CHECK_EQ(TypedZero, 0); + CHECK_EQ(TypedOne, 1); + CHECK_EQ(TypedTwo, 2); + + CHECK_EQ(EnumClassSC::Zero, EnumClassSC::Zero); + CHECK_EQ(EnumClassSC::One, EnumClassSC::One); + CHECK_EQ(EnumClassSC::Two, EnumClassSC::Two); +} + +TEST_CASE("enum 2" * doctest::should_fail()) +{ + CHECK_EQ(Zero, 1); + CHECK_EQ(One, 2); + CHECK_EQ(Two, 3); + + CHECK_EQ(TypedZero, 1); + CHECK_EQ(TypedOne, 2); + CHECK_EQ(TypedTwo, 3); + + CHECK_EQ(EnumClassC::Zero, EnumClassC::One); + CHECK_EQ(EnumClassC::One, EnumClassC::Two); + CHECK_EQ(EnumClassC::Two, EnumClassC::Zero); + + CHECK_EQ(EnumClassSC::Zero, EnumClassSC::One); + CHECK_EQ(EnumClassSC::One, EnumClassSC::Two); + CHECK_EQ(EnumClassSC::Two, EnumClassSC::Zero); + + CHECK_EQ(EnumClassUC::Zero, EnumClassUC::One); + CHECK_EQ(EnumClassUC::One, EnumClassUC::Two); + CHECK_EQ(EnumClassUC::Two, EnumClassUC::Zero); + + CHECK_EQ(EnumClassU8::Zero, EnumClassU8::One); + CHECK_EQ(EnumClassU8::One, EnumClassU8::Two); + CHECK_EQ(EnumClassU8::Two, EnumClassU8::Zero); +} diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/abort_after.txt doctest-2.4.1+repack0/examples/all_features/test_output/abort_after.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/abort_after.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/abort_after.txt 2020-11-06 17:28:50.000000000 +0000 @@ -13,7 +13,7 @@ Aborting - too many failed asserts! =============================================================================== -[doctest] test cases: 1 | 0 passed | 1 failed | -[doctest] assertions: 7 | 5 passed | 2 failed | +[doctest] test cases: 1 | 0 passed | 1 failed | +[doctest] assertions: 7 | 5 passed | 2 failed | [doctest] Status: FAILURE! Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/all_binary.txt doctest-2.4.1+repack0/examples/all_features/test_output/all_binary.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/all_binary.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/all_binary.txt 2020-11-06 17:28:50.000000000 +0000 @@ -76,7 +76,7 @@ values: REQUIRE_UNARY_FALSE( 0 ) =============================================================================== -[doctest] test cases: 1 | 1 passed | 0 failed | -[doctest] assertions: 16 | 16 passed | 0 failed | +[doctest] test cases: 1 | 1 passed | 0 failed | +[doctest] assertions: 16 | 16 passed | 0 failed | [doctest] Status: SUCCESS! Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/alternative_macros.cpp.txt doctest-2.4.1+repack0/examples/all_features/test_output/alternative_macros.cpp.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/alternative_macros.cpp.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/alternative_macros.cpp.txt 2020-11-06 17:28:50.000000000 +0000 @@ -1,6 +1,6 @@ [doctest] run with "--help" for options =============================================================================== -[doctest] test cases: 1 | 1 passed | 0 failed | -[doctest] assertions: 6 | 6 passed | 0 failed | +[doctest] test cases: 1 | 1 passed | 0 failed | +[doctest] assertions: 6 | 6 passed | 0 failed | [doctest] Status: SUCCESS! Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/assertion_macros.cpp.txt doctest-2.4.1+repack0/examples/all_features/test_output/assertion_macros.cpp.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/assertion_macros.cpp.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/assertion_macros.cpp.txt 2020-11-06 17:28:50.000000000 +0000 @@ -198,7 +198,7 @@ assertion_macros.cpp(0): ERROR: CHECK_THROWS_WITH_AS( throw_if(true, false), "unknown exception", int ) threw a DIFFERENT exception! (contents: "unknown exception") =============================================================================== -[doctest] test cases: 21 | 3 passed | 18 failed | -[doctest] assertions: 74 | 35 passed | 39 failed | +[doctest] test cases: 21 | 3 passed | 18 failed | +[doctest] assertions: 74 | 35 passed | 39 failed | [doctest] Status: FAILURE! Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/asserts_used_outside_of_tests.cpp.txt doctest-2.4.1+repack0/examples/all_features/test_output/asserts_used_outside_of_tests.cpp.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/asserts_used_outside_of_tests.cpp.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/asserts_used_outside_of_tests.cpp.txt 2020-11-06 17:28:50.000000000 +0000 @@ -1,7 +1,7 @@ [doctest] run with "--help" for options =============================================================================== -[doctest] test cases: 0 | 0 passed | 0 failed | -[doctest] assertions: 0 | 0 passed | 0 failed | +[doctest] test cases: 0 | 0 passed | 0 failed | +[doctest] assertions: 0 | 0 passed | 0 failed | [doctest] Status: SUCCESS! Program code. asserts_used_outside_of_tests.cpp(19): ERROR: CHECK_EQ( true, false ) is NOT correct! diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/coverage_maxout.cpp.txt doctest-2.4.1+repack0/examples/all_features/test_output/coverage_maxout.cpp.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/coverage_maxout.cpp.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/coverage_maxout.cpp.txt 2020-11-06 17:28:50.000000000 +0000 @@ -55,7 +55,7 @@ coverage_maxout.cpp(0): ERROR: test case THREW exception: unknown exception =============================================================================== -[doctest] test cases: 4 | 0 passed | 4 failed | -[doctest] assertions: 31 | 22 passed | 9 failed | +[doctest] test cases: 4 | 0 passed | 4 failed | +[doctest] assertions: 31 | 22 passed | 9 failed | [doctest] Status: FAILURE! Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/doctest_proxy.h.txt doctest-2.4.1+repack0/examples/all_features/test_output/doctest_proxy.h.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/doctest_proxy.h.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/doctest_proxy.h.txt 2020-11-06 17:28:50.000000000 +0000 @@ -1,6 +1,6 @@ [doctest] run with "--help" for options =============================================================================== -[doctest] test cases: 0 | 0 passed | 0 failed | -[doctest] assertions: 0 | 0 passed | 0 failed | +[doctest] test cases: 0 | 0 passed | 0 failed | +[doctest] assertions: 0 | 0 passed | 0 failed | [doctest] Status: SUCCESS! Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/enums.cpp_junit.txt doctest-2.4.1+repack0/examples/all_features/test_output/enums.cpp_junit.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/enums.cpp_junit.txt 1970-01-01 00:00:00.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/enums.cpp_junit.txt 2020-11-06 17:28:50.000000000 +0000 @@ -0,0 +1,117 @@ + + + + + + +enums.cpp(0): +CHECK_EQ( Zero, 1 ) is NOT correct! + values: CHECK_EQ( 0, 1 ) + + + +enums.cpp(0): +CHECK_EQ( One, 2 ) is NOT correct! + values: CHECK_EQ( 1, 2 ) + + + +enums.cpp(0): +CHECK_EQ( Two, 3 ) is NOT correct! + values: CHECK_EQ( 2, 3 ) + + + +enums.cpp(0): +CHECK_EQ( TypedZero, 1 ) is NOT correct! + values: CHECK_EQ( 0, 1 ) + + + +enums.cpp(0): +CHECK_EQ( TypedOne, 2 ) is NOT correct! + values: CHECK_EQ( 1, 2 ) + + + +enums.cpp(0): +CHECK_EQ( TypedTwo, 3 ) is NOT correct! + values: CHECK_EQ( 2, 3 ) + + + +enums.cpp(0): +CHECK_EQ( EnumClassC::Zero, EnumClassC::One ) is NOT correct! + values: CHECK_EQ( 48, 49 ) + + + +enums.cpp(0): +CHECK_EQ( EnumClassC::One, EnumClassC::Two ) is NOT correct! + values: CHECK_EQ( 49, 50 ) + + + +enums.cpp(0): +CHECK_EQ( EnumClassC::Two, EnumClassC::Zero ) is NOT correct! + values: CHECK_EQ( 50, 48 ) + + + +enums.cpp(0): +CHECK_EQ( EnumClassSC::Zero, EnumClassSC::One ) is NOT correct! + values: CHECK_EQ( 48, 49 ) + + + +enums.cpp(0): +CHECK_EQ( EnumClassSC::One, EnumClassSC::Two ) is NOT correct! + values: CHECK_EQ( 49, 50 ) + + + +enums.cpp(0): +CHECK_EQ( EnumClassSC::Two, EnumClassSC::Zero ) is NOT correct! + values: CHECK_EQ( 50, 48 ) + + + +enums.cpp(0): +CHECK_EQ( EnumClassUC::Zero, EnumClassUC::One ) is NOT correct! + values: CHECK_EQ( 48, 49 ) + + + +enums.cpp(0): +CHECK_EQ( EnumClassUC::One, EnumClassUC::Two ) is NOT correct! + values: CHECK_EQ( 49, 50 ) + + + +enums.cpp(0): +CHECK_EQ( EnumClassUC::Two, EnumClassUC::Zero ) is NOT correct! + values: CHECK_EQ( 50, 48 ) + + + +enums.cpp(0): +CHECK_EQ( EnumClassU8::Zero, EnumClassU8::One ) is NOT correct! + values: CHECK_EQ( 0, 1 ) + + + +enums.cpp(0): +CHECK_EQ( EnumClassU8::One, EnumClassU8::Two ) is NOT correct! + values: CHECK_EQ( 1, 2 ) + + + +enums.cpp(0): +CHECK_EQ( EnumClassU8::Two, EnumClassU8::Zero ) is NOT correct! + values: CHECK_EQ( 2, 0 ) + + + + + +Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/enums.cpp.txt doctest-2.4.1+repack0/examples/all_features/test_output/enums.cpp.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/enums.cpp.txt 1970-01-01 00:00:00.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/enums.cpp.txt 2020-11-06 17:28:50.000000000 +0000 @@ -0,0 +1,65 @@ +[doctest] run with "--help" for options +=============================================================================== +enums.cpp(0): +TEST CASE: enum 2 + +enums.cpp(0): ERROR: CHECK_EQ( Zero, 1 ) is NOT correct! + values: CHECK_EQ( 0, 1 ) + +enums.cpp(0): ERROR: CHECK_EQ( One, 2 ) is NOT correct! + values: CHECK_EQ( 1, 2 ) + +enums.cpp(0): ERROR: CHECK_EQ( Two, 3 ) is NOT correct! + values: CHECK_EQ( 2, 3 ) + +enums.cpp(0): ERROR: CHECK_EQ( TypedZero, 1 ) is NOT correct! + values: CHECK_EQ( 0, 1 ) + +enums.cpp(0): ERROR: CHECK_EQ( TypedOne, 2 ) is NOT correct! + values: CHECK_EQ( 1, 2 ) + +enums.cpp(0): ERROR: CHECK_EQ( TypedTwo, 3 ) is NOT correct! + values: CHECK_EQ( 2, 3 ) + +enums.cpp(0): ERROR: CHECK_EQ( EnumClassC::Zero, EnumClassC::One ) is NOT correct! + values: CHECK_EQ( 48, 49 ) + +enums.cpp(0): ERROR: CHECK_EQ( EnumClassC::One, EnumClassC::Two ) is NOT correct! + values: CHECK_EQ( 49, 50 ) + +enums.cpp(0): ERROR: CHECK_EQ( EnumClassC::Two, EnumClassC::Zero ) is NOT correct! + values: CHECK_EQ( 50, 48 ) + +enums.cpp(0): ERROR: CHECK_EQ( EnumClassSC::Zero, EnumClassSC::One ) is NOT correct! + values: CHECK_EQ( 48, 49 ) + +enums.cpp(0): ERROR: CHECK_EQ( EnumClassSC::One, EnumClassSC::Two ) is NOT correct! + values: CHECK_EQ( 49, 50 ) + +enums.cpp(0): ERROR: CHECK_EQ( EnumClassSC::Two, EnumClassSC::Zero ) is NOT correct! + values: CHECK_EQ( 50, 48 ) + +enums.cpp(0): ERROR: CHECK_EQ( EnumClassUC::Zero, EnumClassUC::One ) is NOT correct! + values: CHECK_EQ( 48, 49 ) + +enums.cpp(0): ERROR: CHECK_EQ( EnumClassUC::One, EnumClassUC::Two ) is NOT correct! + values: CHECK_EQ( 49, 50 ) + +enums.cpp(0): ERROR: CHECK_EQ( EnumClassUC::Two, EnumClassUC::Zero ) is NOT correct! + values: CHECK_EQ( 50, 48 ) + +enums.cpp(0): ERROR: CHECK_EQ( EnumClassU8::Zero, EnumClassU8::One ) is NOT correct! + values: CHECK_EQ( 0, 1 ) + +enums.cpp(0): ERROR: CHECK_EQ( EnumClassU8::One, EnumClassU8::Two ) is NOT correct! + values: CHECK_EQ( 1, 2 ) + +enums.cpp(0): ERROR: CHECK_EQ( EnumClassU8::Two, EnumClassU8::Zero ) is NOT correct! + values: CHECK_EQ( 2, 0 ) + +Failed as expected so marking it as not failed +=============================================================================== +[doctest] test cases: 2 | 2 passed | 0 failed | +[doctest] assertions: 27 | 9 passed | 18 failed | +[doctest] Status: SUCCESS! +Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/enums.cpp_xml.txt doctest-2.4.1+repack0/examples/all_features/test_output/enums.cpp_xml.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/enums.cpp_xml.txt 1970-01-01 00:00:00.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/enums.cpp_xml.txt 2020-11-06 17:28:50.000000000 +0000 @@ -0,0 +1,159 @@ + + + + + + + + + + + Zero, 1 + + + 0, 1 + + + + + One, 2 + + + 1, 2 + + + + + Two, 3 + + + 2, 3 + + + + + TypedZero, 1 + + + 0, 1 + + + + + TypedOne, 2 + + + 1, 2 + + + + + TypedTwo, 3 + + + 2, 3 + + + + + EnumClassC::Zero, EnumClassC::One + + + 48, 49 + + + + + EnumClassC::One, EnumClassC::Two + + + 49, 50 + + + + + EnumClassC::Two, EnumClassC::Zero + + + 50, 48 + + + + + EnumClassSC::Zero, EnumClassSC::One + + + 48, 49 + + + + + EnumClassSC::One, EnumClassSC::Two + + + 49, 50 + + + + + EnumClassSC::Two, EnumClassSC::Zero + + + 50, 48 + + + + + EnumClassUC::Zero, EnumClassUC::One + + + 48, 49 + + + + + EnumClassUC::One, EnumClassUC::Two + + + 49, 50 + + + + + EnumClassUC::Two, EnumClassUC::Zero + + + 50, 48 + + + + + EnumClassU8::Zero, EnumClassU8::One + + + 0, 1 + + + + + EnumClassU8::One, EnumClassU8::Two + + + 1, 2 + + + + + EnumClassU8::Two, EnumClassU8::Zero + + + 2, 0 + + + + + + + + +Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/filter_1.txt doctest-2.4.1+repack0/examples/all_features/test_output/filter_1.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/filter_1.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/filter_1.txt 2020-11-06 17:28:50.000000000 +0000 @@ -1,6 +1,6 @@ [doctest] run with "--help" for options =============================================================================== -[doctest] test cases: 0 | 0 passed | 0 failed | -[doctest] assertions: 0 | 0 passed | 0 failed | +[doctest] test cases: 0 | 0 passed | 0 failed | +[doctest] assertions: 0 | 0 passed | 0 failed | [doctest] Status: SUCCESS! Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/filter_2.txt doctest-2.4.1+repack0/examples/all_features/test_output/filter_2.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/filter_2.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/filter_2.txt 2020-11-06 17:28:50.000000000 +0000 @@ -1,6 +1,6 @@ [doctest] run with "--help" for options =============================================================================== -[doctest] test cases: 0 | 0 passed | 0 failed | 78 skipped -[doctest] assertions: 0 | 0 passed | 0 failed | +[doctest] test cases: 0 | 0 passed | 0 failed | 80 skipped +[doctest] assertions: 0 | 0 passed | 0 failed | [doctest] Status: SUCCESS! Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/filter_2_xml.txt doctest-2.4.1+repack0/examples/all_features/test_output/filter_2_xml.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/filter_2_xml.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/filter_2_xml.txt 2020-11-06 17:28:50.000000000 +0000 @@ -42,6 +42,8 @@ + + @@ -116,6 +118,6 @@ - + Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/filter_3.txt doctest-2.4.1+repack0/examples/all_features/test_output/filter_3.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/filter_3.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/filter_3.txt 2020-11-06 17:28:50.000000000 +0000 @@ -27,7 +27,7 @@ subcases.cpp(0): MESSAGE: lala =============================================================================== -[doctest] test cases: 7 | 7 passed | 0 failed | -[doctest] assertions: 0 | 0 passed | 0 failed | +[doctest] test cases: 7 | 7 passed | 0 failed | +[doctest] assertions: 0 | 0 passed | 0 failed | [doctest] Status: SUCCESS! Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/first_last.txt doctest-2.4.1+repack0/examples/all_features/test_output/first_last.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/first_last.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/first_last.txt 2020-11-06 17:28:50.000000000 +0000 @@ -21,7 +21,7 @@ coverage_maxout.cpp(0): ERROR: test case THREW exception: unknown exception =============================================================================== -[doctest] test cases: 4 | 1 passed | 3 failed | -[doctest] assertions: 0 | 0 passed | 0 failed | +[doctest] test cases: 4 | 1 passed | 3 failed | +[doctest] assertions: 0 | 0 passed | 0 failed | [doctest] Status: FAILURE! Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/header.h.txt doctest-2.4.1+repack0/examples/all_features/test_output/header.h.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/header.h.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/header.h.txt 2020-11-06 17:28:50.000000000 +0000 @@ -19,7 +19,7 @@ header.h(0): FATAL ERROR: =============================================================================== -[doctest] test cases: 4 | 1 passed | 3 failed | -[doctest] assertions: 4 | 1 passed | 3 failed | +[doctest] test cases: 4 | 1 passed | 3 failed | +[doctest] assertions: 4 | 1 passed | 3 failed | [doctest] Status: FAILURE! Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/logging.cpp.txt doctest-2.4.1+repack0/examples/all_features/test_output/logging.cpp.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/logging.cpp.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/logging.cpp.txt 2020-11-06 17:28:50.000000000 +0000 @@ -77,7 +77,7 @@ logging.cpp(0): FATAL ERROR: fail the test case and also end it =============================================================================== -[doctest] test cases: 6 | 0 passed | 6 failed | -[doctest] assertions: 11 | 0 passed | 11 failed | +[doctest] test cases: 6 | 0 passed | 6 failed | +[doctest] assertions: 11 | 0 passed | 11 failed | [doctest] Status: FAILURE! Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/main.cpp.txt doctest-2.4.1+repack0/examples/all_features/test_output/main.cpp.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/main.cpp.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/main.cpp.txt 2020-11-06 17:28:50.000000000 +0000 @@ -1,6 +1,6 @@ [doctest] run with "--help" for options =============================================================================== -[doctest] test cases: 1 | 1 passed | 0 failed | -[doctest] assertions: 1 | 1 passed | 0 failed | +[doctest] test cases: 1 | 1 passed | 0 failed | +[doctest] assertions: 1 | 1 passed | 0 failed | [doctest] Status: SUCCESS! Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/order_1.txt doctest-2.4.1+repack0/examples/all_features/test_output/order_1.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/order_1.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/order_1.txt 2020-11-06 17:28:50.000000000 +0000 @@ -102,7 +102,7 @@ Test case exceeded time limit of 0.000001! =============================================================================== -[doctest] test cases: 15 | 5 passed | 10 failed | -[doctest] assertions: 12 | 1 passed | 11 failed | +[doctest] test cases: 15 | 5 passed | 10 failed | +[doctest] assertions: 12 | 1 passed | 11 failed | [doctest] Status: FAILURE! Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/order_2.txt doctest-2.4.1+repack0/examples/all_features/test_output/order_2.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/order_2.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/order_2.txt 2020-11-06 17:28:50.000000000 +0000 @@ -95,7 +95,7 @@ test_cases_and_suites.cpp(0): FATAL ERROR: =============================================================================== -[doctest] test cases: 14 | 5 passed | 9 failed | -[doctest] assertions: 11 | 1 passed | 10 failed | +[doctest] test cases: 14 | 5 passed | 9 failed | +[doctest] assertions: 11 | 1 passed | 10 failed | [doctest] Status: FAILURE! Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/order_3.txt doctest-2.4.1+repack0/examples/all_features/test_output/order_3.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/order_3.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/order_3.txt 2020-11-06 17:28:50.000000000 +0000 @@ -1,6 +1,6 @@ [doctest] run with "--help" for options =============================================================================== -[doctest] test cases: 0 | 0 passed | 0 failed | -[doctest] assertions: 0 | 0 passed | 0 failed | +[doctest] test cases: 0 | 0 passed | 0 failed | +[doctest] assertions: 0 | 0 passed | 0 failed | [doctest] Status: SUCCESS! Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/reporters_and_listeners.cpp.txt doctest-2.4.1+repack0/examples/all_features/test_output/reporters_and_listeners.cpp.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/reporters_and_listeners.cpp.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/reporters_and_listeners.cpp.txt 2020-11-06 17:28:50.000000000 +0000 @@ -1,6 +1,6 @@ [doctest] run with "--help" for options =============================================================================== -[doctest] test cases: 0 | 0 passed | 0 failed | -[doctest] assertions: 0 | 0 passed | 0 failed | +[doctest] test cases: 0 | 0 passed | 0 failed | +[doctest] assertions: 0 | 0 passed | 0 failed | [doctest] Status: SUCCESS! Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/stringification.cpp.txt doctest-2.4.1+repack0/examples/all_features/test_output/stringification.cpp.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/stringification.cpp.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/stringification.cpp.txt 2020-11-06 17:28:50.000000000 +0000 @@ -24,7 +24,7 @@ stringification.cpp(0): ERROR: test case THREW exception: 5 =============================================================================== -[doctest] test cases: 2 | 0 passed | 2 failed | -[doctest] assertions: 4 | 0 passed | 4 failed | +[doctest] test cases: 2 | 0 passed | 2 failed | +[doctest] assertions: 4 | 0 passed | 4 failed | [doctest] Status: FAILURE! Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/subcases.cpp.txt doctest-2.4.1+repack0/examples/all_features/test_output/subcases.cpp.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/subcases.cpp.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/subcases.cpp.txt 2020-11-06 17:28:50.000000000 +0000 @@ -194,7 +194,7 @@ subcases.cpp(0): MESSAGE: separate msg! =============================================================================== -[doctest] test cases: 7 | 3 passed | 4 failed | -[doctest] assertions: 25 | 19 passed | 6 failed | +[doctest] test cases: 7 | 3 passed | 4 failed | +[doctest] assertions: 25 | 19 passed | 6 failed | [doctest] Status: FAILURE! Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/templated_test_cases.cpp.txt doctest-2.4.1+repack0/examples/all_features/test_output/templated_test_cases.cpp.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/templated_test_cases.cpp.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/templated_test_cases.cpp.txt 2020-11-06 17:28:50.000000000 +0000 @@ -35,7 +35,7 @@ values: CHECK( 0 != 0 ) =============================================================================== -[doctest] test cases: 15 | 10 passed | 5 failed | -[doctest] assertions: 19 | 14 passed | 5 failed | +[doctest] test cases: 15 | 10 passed | 5 failed | +[doctest] assertions: 19 | 14 passed | 5 failed | [doctest] Status: FAILURE! Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/test_cases_and_suites.cpp.txt doctest-2.4.1+repack0/examples/all_features/test_output/test_cases_and_suites.cpp.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/test_cases_and_suites.cpp.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/test_cases_and_suites.cpp.txt 2020-11-06 17:28:50.000000000 +0000 @@ -95,7 +95,7 @@ Didn't fail exactly 1 times so marking it as failed! =============================================================================== -[doctest] test cases: 14 | 5 passed | 9 failed | -[doctest] assertions: 11 | 1 passed | 10 failed | +[doctest] test cases: 14 | 5 passed | 9 failed | +[doctest] assertions: 11 | 1 passed | 10 failed | [doctest] Status: FAILURE! Program code. diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/version.txt doctest-2.4.1+repack0/examples/all_features/test_output/version.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/version.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/version.txt 2020-11-06 17:28:50.000000000 +0000 @@ -1 +1 @@ -[doctest] doctest version is "2.4.0" +[doctest] doctest version is "2.4.1" diff -Nru doctest-2.4.0+repack0/examples/all_features/test_output/version_xml.txt doctest-2.4.1+repack0/examples/all_features/test_output/version_xml.txt --- doctest-2.4.0+repack0/examples/all_features/test_output/version_xml.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/all_features/test_output/version_xml.txt 2020-11-06 17:28:50.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru doctest-2.4.0+repack0/examples/executable_dll_and_plugin/test_output/executable_dll_and_plugin.txt doctest-2.4.1+repack0/examples/executable_dll_and_plugin/test_output/executable_dll_and_plugin.txt --- doctest-2.4.0+repack0/examples/executable_dll_and_plugin/test_output/executable_dll_and_plugin.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/executable_dll_and_plugin/test_output/executable_dll_and_plugin.txt 2020-11-06 17:28:50.000000000 +0000 @@ -26,6 +26,6 @@ logged: some info =============================================================================== -[doctest] test cases: 5 | 3 passed | 2 failed | 0 skipped -[doctest] assertions: 2 | 0 passed | 2 failed | +[doctest] test cases: 5 | 3 passed | 2 failed | 0 skipped +[doctest] assertions: 2 | 0 passed | 2 failed | [doctest] Status: FAILURE! diff -Nru doctest-2.4.0+repack0/examples/exe_with_static_libs/test_output/exe_with_static_libs.txt doctest-2.4.1+repack0/examples/exe_with_static_libs/test_output/exe_with_static_libs.txt --- doctest-2.4.0+repack0/examples/exe_with_static_libs/test_output/exe_with_static_libs.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/examples/exe_with_static_libs/test_output/exe_with_static_libs.txt 2020-11-06 17:28:50.000000000 +0000 @@ -4,6 +4,6 @@ hello from hello from =============================================================================== -[doctest] test cases: 4 | 4 passed | 0 failed | 0 skipped -[doctest] assertions: 0 | 0 passed | 0 failed | +[doctest] test cases: 4 | 4 passed | 0 failed | 0 skipped +[doctest] assertions: 0 | 0 passed | 0 failed | [doctest] Status: SUCCESS! diff -Nru doctest-2.4.0+repack0/examples/mpi/CMakeLists.txt doctest-2.4.1+repack0/examples/mpi/CMakeLists.txt --- doctest-2.4.0+repack0/examples/mpi/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ doctest-2.4.1+repack0/examples/mpi/CMakeLists.txt 2020-11-06 17:28:50.000000000 +0000 @@ -0,0 +1,7 @@ +find_package(MPI COMPONENTS CXX) +if(MPI_FOUND) + add_executable(test_mpi main.cpp mpi.cpp) + target_link_libraries(test_mpi doctest ${CMAKE_THREAD_LIBS_INIT} MPI::MPI_CXX) + + doctest_add_test(NO_OUTPUT NAME test_mpi COMMAND mpirun -np 3 $) +endif() diff -Nru doctest-2.4.0+repack0/examples/mpi/main.cpp doctest-2.4.1+repack0/examples/mpi/main.cpp --- doctest-2.4.0+repack0/examples/mpi/main.cpp 1970-01-01 00:00:00.000000000 +0000 +++ doctest-2.4.1+repack0/examples/mpi/main.cpp 2020-11-06 17:28:50.000000000 +0000 @@ -0,0 +1,19 @@ +#define DOCTEST_CONFIG_IMPLEMENT + +#include + +int main(int argc, char** argv) { + MPI_Init(&argc, &argv); + + doctest::Context ctx; + ctx.setOption("reporters", "MpiConsoleReporter"); + ctx.setOption("reporters", "MpiFileReporter"); + ctx.setOption("force-colors", true); + ctx.applyCommandLine(argc, argv); + + int test_result = ctx.run(); + + MPI_Finalize(); + + return test_result; +} diff -Nru doctest-2.4.0+repack0/examples/mpi/mpi.cpp doctest-2.4.1+repack0/examples/mpi/mpi.cpp --- doctest-2.4.0+repack0/examples/mpi/mpi.cpp 1970-01-01 00:00:00.000000000 +0000 +++ doctest-2.4.1+repack0/examples/mpi/mpi.cpp 2020-11-06 17:28:50.000000000 +0000 @@ -0,0 +1,36 @@ +#include + +int f_for_test(int rank); + +int f_for_test(int rank) { + if (rank == 0) { + return 10; + } + else if (rank == 1) { + return 11; + } + return 0; +} + + + +MPI_TEST_CASE("Parallel test on 2 processes",2) { // if MPI_SIZE < 2, report test can't be run + // 3 objects accessible in the test: + // test_comm: MPI_Comm of size 2 + // test_rank: integer of value the rank of the process in test_comm + // test_nb_procs: integer of value the size of the process (here: 2) + + int x = f_for_test(test_rank); + + MPI_CHECK( 0, x==10 ); // CHECK for rank 0, that x==10 + MPI_CHECK( 1, x==11 ); // CHECK for rank 1, that x==11 + //MPI_CHECK( 2, x==0 ); // will trigger a static assert because non-existing rank +} + +MPI_TEST_CASE("Parallel test on 3 processes (failing)",3) { + int x = f_for_test(test_rank); + + MPI_CHECK( 0, x==10 ); // CHECK for rank 0, that x==10 + MPI_CHECK( 1, x==11 ); // CHECK for rank 1, that x==11 + MPI_CHECK( 2, x==-1 ); // CHECK for rank 2, that x==-1 (which is not the case -> will trigger a failure report) +} diff -Nru doctest-2.4.0+repack0/.github/pull_request_template.md doctest-2.4.1+repack0/.github/pull_request_template.md --- doctest-2.4.0+repack0/.github/pull_request_template.md 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/.github/pull_request_template.md 2020-11-06 17:28:50.000000000 +0000 @@ -2,7 +2,7 @@ Make sure the PR is against the dev branch and not master which contains the latest stable release. Also make sure to have read CONTRIBUTING.md. Please do not submit pull requests changing the single-include `doctest.h` -file, it is generated from the 2 headers in the doctest/parts/ folder. +file, it is generated from the 2 files in the doctest/parts/ folder. --> diff -Nru doctest-2.4.0+repack0/.github/workflows/main.yml doctest-2.4.1+repack0/.github/workflows/main.yml --- doctest-2.4.0+repack0/.github/workflows/main.yml 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/.github/workflows/main.yml 2020-11-06 17:28:50.000000000 +0000 @@ -213,6 +213,8 @@ fi sudo apt-get update + # sudo apt-get install libopenmpi-dev + # sudo apt-get install openmpi-bin # libc6-dbg:i386 is required for running valgrind on x86. sudo apt-get install -y ninja-build valgrind libc6-dbg:i386 diff -Nru doctest-2.4.0+repack0/LICENSE.txt doctest-2.4.1+repack0/LICENSE.txt --- doctest-2.4.0+repack0/LICENSE.txt 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/LICENSE.txt 2020-11-06 17:28:50.000000000 +0000 @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016-2019 Viktor Kirilov +Copyright (c) 2016-2020 Viktor Kirilov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff -Nru doctest-2.4.0+repack0/meson.build doctest-2.4.1+repack0/meson.build --- doctest-2.4.0+repack0/meson.build 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/meson.build 2020-11-06 17:28:50.000000000 +0000 @@ -1,2 +1,2 @@ -project('doctest', ['cpp'], version: '2.4.0', meson_version:'>=0.50') +project('doctest', ['cpp'], version: '2.4.1', meson_version:'>=0.50') doctest_dep = declare_dependency(include_directories: include_directories('doctest')) diff -Nru doctest-2.4.0+repack0/README.md doctest-2.4.1+repack0/README.md --- doctest-2.4.0+repack0/README.md 2020-06-30 11:08:42.000000000 +0000 +++ doctest-2.4.1+repack0/README.md 2020-11-06 17:28:50.000000000 +0000 @@ -56,7 +56,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/nJIibfbivG7BG7r1) +[![Try it online](https://img.shields.io/badge/try%20it-online-orange.svg)]()