Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package Catch2 for openSUSE:Factory checked in at 2021-08-11 11:47:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/Catch2 (Old) and /work/SRC/openSUSE:Factory/.Catch2.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "Catch2" Wed Aug 11 11:47:04 2021 rev:6 rq:910458 version:2.13.7 Changes: -------- --- /work/SRC/openSUSE:Factory/Catch2/Catch2.changes 2021-05-07 16:45:17.312374439 +0200 +++ /work/SRC/openSUSE:Factory/.Catch2.new.1899/Catch2.changes 2021-08-11 11:47:16.577742232 +0200 @@ -1,0 +2,13 @@ +Thu Aug 5 11:24:30 UTC 2021 - Luigi Baldoni <aloi...@gmx.com> + +- Update to version 2.13.7 + Fixes: + * Added missing `<iterator>` include in benchmarking. + * Fixed noexcept build with benchmarking enabled. + * Fixed build for compilers with C++17 support but without + C++17 library support. + * JUnit only uses 3 decimal places when reporting durations. + * `!mayfail` tagged tests are now marked as `skipped` in JUnit + reporter output. + +------------------------------------------------------------------- Old: ---- Catch2-2.13.6.tar.gz New: ---- Catch2-2.13.7.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ Catch2.spec ++++++ --- /var/tmp/diff_new_pack.exgRjz/_old 2021-08-11 11:47:17.141741554 +0200 +++ /var/tmp/diff_new_pack.exgRjz/_new 2021-08-11 11:47:17.141741554 +0200 @@ -17,7 +17,7 @@ Name: Catch2 -Version: 2.13.6 +Version: 2.13.7 Release: 0 Summary: A modern, C++-native, header-only, test framework for unit-tests, TDD and BDD License: BSL-1.0 ++++++ Catch2-2.13.6.tar.gz -> Catch2-2.13.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Catch2-2.13.6/.travis.yml new/Catch2-2.13.7/.travis.yml --- old/Catch2-2.13.6/.travis.yml 2021-04-16 20:14:58.000000000 +0200 +++ new/Catch2-2.13.7/.travis.yml 2021-07-28 20:30:51.000000000 +0200 @@ -264,6 +264,15 @@ addons: apt: sources: *all_sources + packages: ['clang-5.0'] + env: COMPILER='clang++-5.0' CPP17=1 + + - os: linux + dist: xenial + compiler: clang + addons: + apt: + sources: *all_sources packages: ['clang-6.0', 'libstdc++-8-dev'] env: COMPILER='clang++-6.0' CPP17=1 @@ -276,19 +285,6 @@ packages: ['clang-6.0', 'libstdc++-8-dev'] env: COMPILER='clang++-6.0' CPP17=1 EXAMPLES=1 COVERAGE=1 EXTRAS=1 - # 8/ Conan - - language: python - python: - - "3.7" - dist: xenial - install: - - pip install conan-package-tools - env: - - CONAN_GCC_VERSIONS=8 - - CONAN_DOCKER_IMAGE=conanio/gcc8 - script: - - python .conan/build.py - install: - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Catch2-2.13.6/CMakeLists.txt new/Catch2-2.13.7/CMakeLists.txt --- old/Catch2-2.13.6/CMakeLists.txt 2021-04-16 20:14:58.000000000 +0200 +++ new/Catch2-2.13.7/CMakeLists.txt 2021-07-28 20:30:51.000000000 +0200 @@ -16,7 +16,7 @@ endif() -project(Catch2 LANGUAGES CXX VERSION 2.13.6) +project(Catch2 LANGUAGES CXX VERSION 2.13.7) # Provide path for scripts list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Catch2-2.13.6/README.md new/Catch2-2.13.7/README.md --- old/Catch2-2.13.6/README.md 2021-04-16 20:14:58.000000000 +0200 +++ new/Catch2-2.13.7/README.md 2021-07-28 20:30:51.000000000 +0200 @@ -9,7 +9,7 @@ [![Join the chat in Discord: https://discord.gg/4CWS9zD](https://img.shields.io/badge/Discord-Chat!-brightgreen.svg)](https://discord.gg/4CWS9zD) -<a href="https://github.com/catchorg/Catch2/releases/download/v2.13.6/catch.hpp">The latest version of the single header can be downloaded directly using this link</a> +<a href="https://github.com/catchorg/Catch2/releases/download/v2.13.7/catch.hpp">The latest version of the single header can be downloaded directly using this link</a> ## Catch2 is released! diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Catch2-2.13.6/docs/release-notes.md new/Catch2-2.13.7/docs/release-notes.md --- old/Catch2-2.13.6/docs/release-notes.md 2021-04-16 20:14:58.000000000 +0200 +++ new/Catch2-2.13.7/docs/release-notes.md 2021-07-28 20:30:51.000000000 +0200 @@ -2,6 +2,7 @@ # Release notes **Contents**<br> +[2.13.7](#2137)<br> [2.13.6](#2136)<br> [2.13.5](#2135)<br> [2.13.4](#2134)<br> @@ -47,6 +48,16 @@ [Even Older versions](#even-older-versions)<br> +## 2.13.7 + +### Fixes +* Added missing `<iterator>` include in benchmarking. (#2231) +* Fixed noexcept build with benchmarking enabled (#2235) +* Fixed build for compilers with C++17 support but without C++17 library support (#2195) +* JUnit only uses 3 decimal places when reporting durations (#2221) +* `!mayfail` tagged tests are now marked as `skipped` in JUnit reporter output (#2116) + + ## 2.13.6 ### Fixes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Catch2-2.13.6/include/catch.hpp new/Catch2-2.13.7/include/catch.hpp --- old/Catch2-2.13.6/include/catch.hpp 2021-04-16 20:14:58.000000000 +0200 +++ new/Catch2-2.13.7/include/catch.hpp 2021-07-28 20:30:51.000000000 +0200 @@ -11,7 +11,7 @@ #define CATCH_VERSION_MAJOR 2 #define CATCH_VERSION_MINOR 13 -#define CATCH_VERSION_PATCH 6 +#define CATCH_VERSION_PATCH 7 #ifdef __clang__ # pragma clang system_header diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Catch2-2.13.6/include/internal/benchmark/catch_execution_plan.hpp new/Catch2-2.13.7/include/internal/benchmark/catch_execution_plan.hpp --- old/Catch2-2.13.6/include/internal/benchmark/catch_execution_plan.hpp 2021-04-16 20:14:58.000000000 +0200 +++ new/Catch2-2.13.7/include/internal/benchmark/catch_execution_plan.hpp 2021-07-28 20:30:51.000000000 +0200 @@ -19,6 +19,7 @@ #include "detail/catch_run_for_at_least.hpp" #include <algorithm> +#include <iterator> namespace Catch { namespace Benchmark { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Catch2-2.13.6/include/internal/benchmark/detail/catch_run_for_at_least.hpp new/Catch2-2.13.7/include/internal/benchmark/detail/catch_run_for_at_least.hpp --- old/Catch2-2.13.6/include/internal/benchmark/detail/catch_run_for_at_least.hpp 2021-04-16 20:14:58.000000000 +0200 +++ new/Catch2-2.13.7/include/internal/benchmark/detail/catch_run_for_at_least.hpp 2021-07-28 20:30:51.000000000 +0200 @@ -56,7 +56,7 @@ } iters *= 2; } - throw optimized_away_error{}; + Catch::throw_exception(optimized_away_error{}); } } // namespace Detail } // namespace Benchmark diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Catch2-2.13.6/include/internal/catch_compiler_capabilities.h new/Catch2-2.13.7/include/internal/catch_compiler_capabilities.h --- old/Catch2-2.13.6/include/internal/catch_compiler_capabilities.h 2021-04-16 20:14:58.000000000 +0200 +++ new/Catch2-2.13.7/include/internal/catch_compiler_capabilities.h 2021-07-28 20:30:51.000000000 +0200 @@ -234,7 +234,7 @@ // Check if byte is available and usable # if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER) # include <cstddef> - # if __cpp_lib_byte > 0 + # if defined(__cpp_lib_byte) && (__cpp_lib_byte > 0) # define CATCH_INTERNAL_CONFIG_CPP17_BYTE # endif # endif // __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Catch2-2.13.6/include/internal/catch_interfaces_reporter.h new/Catch2-2.13.7/include/internal/catch_interfaces_reporter.h --- old/Catch2-2.13.6/include/internal/catch_interfaces_reporter.h 2021-04-16 20:14:58.000000000 +0200 +++ new/Catch2-2.13.7/include/internal/catch_interfaces_reporter.h 2021-07-28 20:30:51.000000000 +0200 @@ -21,6 +21,8 @@ #if defined(CATCH_CONFIG_ENABLE_BENCHMARKING) #include "benchmark/catch_estimate.hpp" #include "benchmark/catch_outlier_classification.hpp" + +#include <iterator> #endif // CATCH_CONFIG_ENABLE_BENCHMARKING diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Catch2-2.13.6/include/internal/catch_version.cpp new/Catch2-2.13.7/include/internal/catch_version.cpp --- old/Catch2-2.13.6/include/internal/catch_version.cpp 2021-04-16 20:14:58.000000000 +0200 +++ new/Catch2-2.13.7/include/internal/catch_version.cpp 2021-07-28 20:30:51.000000000 +0200 @@ -37,7 +37,7 @@ } Version const& libraryVersion() { - static Version version( 2, 13, 6, "", 0 ); + static Version version( 2, 13, 7, "", 0 ); return version; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Catch2-2.13.6/include/reporters/catch_reporter_junit.cpp new/Catch2-2.13.7/include/reporters/catch_reporter_junit.cpp --- old/Catch2-2.13.6/include/reporters/catch_reporter_junit.cpp 2021-04-16 20:14:58.000000000 +0200 +++ new/Catch2-2.13.7/include/reporters/catch_reporter_junit.cpp 2021-07-28 20:30:51.000000000 +0200 @@ -18,6 +18,7 @@ #include <sstream> #include <ctime> #include <algorithm> +#include <iomanip> namespace Catch { @@ -45,7 +46,7 @@ #else std::strftime(timeStamp, timeStampSize, fmt, timeInfo); #endif - return std::string(timeStamp); + return std::string(timeStamp, timeStampSize-1); } std::string fileNameTag(const std::vector<std::string> &tags) { @@ -56,6 +57,17 @@ return it->substr(1); return std::string(); } + + // Formats the duration in seconds to 3 decimal places. + // This is done because some genius defined Maven Surefire schema + // in a way that only accepts 3 decimal places, and tools like + // Jenkins use that schema for validation JUnit reporter output. + std::string formatDuration( double seconds ) { + ReusableStringStream rss; + rss << std::fixed << std::setprecision( 3 ) << seconds; + return rss.str(); + } + } // anonymous namespace JunitReporter::JunitReporter( ReporterConfig const& _config ) @@ -125,7 +137,7 @@ if( m_config->showDurations() == ShowDurations::Never ) xml.writeAttribute( "time", "" ); else - xml.writeAttribute( "time", suiteTime ); + xml.writeAttribute( "time", formatDuration( suiteTime ) ); xml.writeAttribute( "timestamp", getCurrentTimestamp() ); // Write properties if there are any @@ -170,12 +182,13 @@ if ( !m_config->name().empty() ) className = m_config->name() + "." + className; - writeSection( className, "", rootSection ); + writeSection( className, "", rootSection, stats.testInfo.okToFail() ); } - void JunitReporter::writeSection( std::string const& className, - std::string const& rootName, - SectionNode const& sectionNode ) { + void JunitReporter::writeSection( std::string const& className, + std::string const& rootName, + SectionNode const& sectionNode, + bool testOkToFail) { std::string name = trim( sectionNode.stats.sectionInfo.name ); if( !rootName.empty() ) name = rootName + '/' + name; @@ -192,15 +205,21 @@ xml.writeAttribute( "classname", className ); xml.writeAttribute( "name", name ); } - xml.writeAttribute( "time", ::Catch::Detail::stringify( sectionNode.stats.durationInSeconds ) ); + xml.writeAttribute( "time", formatDuration( sectionNode.stats.durationInSeconds ) ); // This is not ideal, but it should be enough to mimic gtest's // junit output. // Ideally the JUnit reporter would also handle `skipTest` // events and write those out appropriately. xml.writeAttribute( "status", "run" ); + if (sectionNode.stats.assertions.failedButOk) { + xml.scopedElement("skipped") + .writeAttribute("message", "TEST_CASE tagged with !mayfail"); + } + writeAssertions( sectionNode ); + if( !sectionNode.stdOut.empty() ) xml.scopedElement( "system-out" ).writeText( trim( sectionNode.stdOut ), XmlFormatting::Newline ); if( !sectionNode.stdErr.empty() ) @@ -208,9 +227,9 @@ } for( auto const& childNode : sectionNode.childSections ) if( className.empty() ) - writeSection( name, "", *childNode ); + writeSection( name, "", *childNode, testOkToFail ); else - writeSection( className, name, *childNode ); + writeSection( className, name, *childNode, testOkToFail ); } void JunitReporter::writeAssertions( SectionNode const& sectionNode ) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Catch2-2.13.6/include/reporters/catch_reporter_junit.h new/Catch2-2.13.7/include/reporters/catch_reporter_junit.h --- old/Catch2-2.13.6/include/reporters/catch_reporter_junit.h 2021-04-16 20:14:58.000000000 +0200 +++ new/Catch2-2.13.7/include/reporters/catch_reporter_junit.h 2021-07-28 20:30:51.000000000 +0200 @@ -41,9 +41,10 @@ void writeTestCase(TestCaseNode const& testCaseNode); - void writeSection(std::string const& className, - std::string const& rootName, - SectionNode const& sectionNode); + void writeSection( std::string const& className, + std::string const& rootName, + SectionNode const& sectionNode, + bool testOkToFail ); void writeAssertions(SectionNode const& sectionNode); void writeAssertion(AssertionStats const& stats); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Catch2-2.13.6/projects/SelfTest/Baselines/compact.sw.approved.txt new/Catch2-2.13.7/projects/SelfTest/Baselines/compact.sw.approved.txt --- old/Catch2-2.13.6/projects/SelfTest/Baselines/compact.sw.approved.txt 2021-04-16 20:14:58.000000000 +0200 +++ new/Catch2-2.13.7/projects/SelfTest/Baselines/compact.sw.approved.txt 2021-07-28 20:30:51.000000000 +0200 @@ -846,6 +846,10 @@ Matchers.tests.cpp:<line number>: failed: testStringForMatching(), (Contains("string") || Contains("different")) && Contains("random") for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) Matchers.tests.cpp:<line number>: passed: testStringForMatching(), !Contains("different") for: "this string contains 'abc' as a substring" not contains: "different" Matchers.tests.cpp:<line number>: failed: testStringForMatching(), !Contains("substring") for: "this string contains 'abc' as a substring" not contains: "substring" +Condition.tests.cpp:<line number>: failed: explicitly +Condition.tests.cpp:<line number>: failed: explicitly +Condition.tests.cpp:<line number>: failed: explicitly +Condition.tests.cpp:<line number>: failed: explicitly Exception.tests.cpp:<line number>: passed: thisThrows(), "expected exception" for: "expected exception" equals: "expected exception" Exception.tests.cpp:<line number>: failed: thisThrows(), "should fail" for: "expected exception" equals: "should fail" Generators.tests.cpp:<line number>: passed: values > -6 for: 3 > -6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Catch2-2.13.6/projects/SelfTest/Baselines/console.std.approved.txt new/Catch2-2.13.7/projects/SelfTest/Baselines/console.std.approved.txt --- old/Catch2-2.13.6/projects/SelfTest/Baselines/console.std.approved.txt 2021-04-16 20:14:58.000000000 +0200 +++ new/Catch2-2.13.7/projects/SelfTest/Baselines/console.std.approved.txt 2021-07-28 20:30:51.000000000 +0200 @@ -695,6 +695,46 @@ "this string contains 'abc' as a substring" not contains: "substring" ------------------------------------------------------------------------------- +Mayfail test case with nested sections + A + 1 +------------------------------------------------------------------------------- +Condition.tests.cpp:<line number> +............................................................................... + +Condition.tests.cpp:<line number>: FAILED: + +------------------------------------------------------------------------------- +Mayfail test case with nested sections + A + 2 +------------------------------------------------------------------------------- +Condition.tests.cpp:<line number> +............................................................................... + +Condition.tests.cpp:<line number>: FAILED: + +------------------------------------------------------------------------------- +Mayfail test case with nested sections + B + 1 +------------------------------------------------------------------------------- +Condition.tests.cpp:<line number> +............................................................................... + +Condition.tests.cpp:<line number>: FAILED: + +------------------------------------------------------------------------------- +Mayfail test case with nested sections + B + 2 +------------------------------------------------------------------------------- +Condition.tests.cpp:<line number> +............................................................................... + +Condition.tests.cpp:<line number>: FAILED: + +------------------------------------------------------------------------------- Mismatching exception messages failing the test ------------------------------------------------------------------------------- Exception.tests.cpp:<line number> @@ -1380,6 +1420,6 @@ Why would you throw a std::string? =============================================================================== -test cases: 322 | 248 passed | 70 failed | 4 failed as expected -assertions: 1759 | 1607 passed | 131 failed | 21 failed as expected +test cases: 323 | 248 passed | 70 failed | 5 failed as expected +assertions: 1763 | 1607 passed | 131 failed | 25 failed as expected diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Catch2-2.13.6/projects/SelfTest/Baselines/console.sw.approved.txt new/Catch2-2.13.7/projects/SelfTest/Baselines/console.sw.approved.txt --- old/Catch2-2.13.6/projects/SelfTest/Baselines/console.sw.approved.txt 2021-04-16 20:14:58.000000000 +0200 +++ new/Catch2-2.13.7/projects/SelfTest/Baselines/console.sw.approved.txt 2021-07-28 20:30:51.000000000 +0200 @@ -6493,6 +6493,46 @@ "this string contains 'abc' as a substring" not contains: "substring" ------------------------------------------------------------------------------- +Mayfail test case with nested sections + A + 1 +------------------------------------------------------------------------------- +Condition.tests.cpp:<line number> +............................................................................... + +Condition.tests.cpp:<line number>: FAILED: + +------------------------------------------------------------------------------- +Mayfail test case with nested sections + A + 2 +------------------------------------------------------------------------------- +Condition.tests.cpp:<line number> +............................................................................... + +Condition.tests.cpp:<line number>: FAILED: + +------------------------------------------------------------------------------- +Mayfail test case with nested sections + B + 1 +------------------------------------------------------------------------------- +Condition.tests.cpp:<line number> +............................................................................... + +Condition.tests.cpp:<line number>: FAILED: + +------------------------------------------------------------------------------- +Mayfail test case with nested sections + B + 2 +------------------------------------------------------------------------------- +Condition.tests.cpp:<line number> +............................................................................... + +Condition.tests.cpp:<line number>: FAILED: + +------------------------------------------------------------------------------- Mismatching exception messages failing the test ------------------------------------------------------------------------------- Exception.tests.cpp:<line number> @@ -14138,6 +14178,6 @@ Misc.tests.cpp:<line number>: PASSED: =============================================================================== -test cases: 322 | 232 passed | 86 failed | 4 failed as expected -assertions: 1776 | 1607 passed | 148 failed | 21 failed as expected +test cases: 323 | 232 passed | 86 failed | 5 failed as expected +assertions: 1780 | 1607 passed | 148 failed | 25 failed as expected diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Catch2-2.13.6/projects/SelfTest/Baselines/junit.sw.approved.txt new/Catch2-2.13.7/projects/SelfTest/Baselines/junit.sw.approved.txt --- old/Catch2-2.13.6/projects/SelfTest/Baselines/junit.sw.approved.txt 2021-04-16 20:14:58.000000000 +0200 +++ new/Catch2-2.13.7/projects/SelfTest/Baselines/junit.sw.approved.txt 2021-07-28 20:30:51.000000000 +0200 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <testsuitesloose text artifact > - <testsuite name="<exe-name>" errors="17" failures="132" tests="1777" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> + <testsuite name="<exe-name>" errors="17" failures="132" tests="1781" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> <properties> <property name="filters" value="~[!nonportable]~[!benchmark]~[approvals]"/> <property name="random-seed" value="1"/> @@ -48,6 +48,7 @@ <testcase classname="<exe-name>.global" name="#1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="#1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="#748 - captures with unexpected exceptions/outside assertions" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> <error type="TEST_CASE"> FAILED: expected exception @@ -56,6 +57,7 @@ </error> </testcase> <testcase classname="<exe-name>.global" name="#748 - captures with unexpected exceptions/inside REQUIRE_NOTHROW" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> <error message="thisThrows()" type="REQUIRE_NOTHROW"> FAILED: REQUIRE_NOTHROW( thisThrows() ) @@ -68,6 +70,7 @@ <testcase classname="<exe-name>.global" name="#809" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="#833" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="#835 -- errno should not be touched by Catch" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> <failure message="f() == 0" type="CHECK"> FAILED: CHECK( f() == 0 ) @@ -443,6 +446,7 @@ <testcase classname="<exe-name>.global" name="Enums in namespaces can quickly have stringification enabled using REGISTER_ENUM" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Epsilon only applies to Approx's value" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Equality checks that should fail" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> <failure message="data.int_seven == 6" type="CHECK"> FAILED: CHECK( data.int_seven == 6 ) @@ -736,6 +740,7 @@ </failure> </testcase> <testcase classname="<exe-name>.global" name="Inequality checks that should fail" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> <failure message="data.int_seven != 7" type="CHECK"> FAILED: CHECK( data.int_seven != 7 ) @@ -799,6 +804,34 @@ Matchers.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="Mayfail test case with nested sections/1/A" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + <failure type="FAIL"> +FAILED: +Condition.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.global" name="Mayfail test case with nested sections/2/A" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + <failure type="FAIL"> +FAILED: +Condition.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.global" name="Mayfail test case with nested sections/1/B" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + <failure type="FAIL"> +FAILED: +Condition.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.global" name="Mayfail test case with nested sections/2/B" time="{duration}" status="run"> + <skipped message="TEST_CASE tagged with !mayfail"/> + <failure type="FAIL"> +FAILED: +Condition.tests.cpp:<line number> + </failure> + </testcase> <testcase classname="<exe-name>.global" name="Mismatching exception messages failing the test" time="{duration}" status="run"> <failure message="thisThrows(), "should fail"" type="REQUIRE_THROWS_WITH"> FAILED: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Catch2-2.13.6/projects/SelfTest/Baselines/sonarqube.sw.approved.txt new/Catch2-2.13.7/projects/SelfTest/Baselines/sonarqube.sw.approved.txt --- old/Catch2-2.13.6/projects/SelfTest/Baselines/sonarqube.sw.approved.txt 2021-04-16 20:14:58.000000000 +0200 +++ new/Catch2-2.13.7/projects/SelfTest/Baselines/sonarqube.sw.approved.txt 2021-07-28 20:30:51.000000000 +0200 @@ -575,6 +575,30 @@ </skipped> </testCase> <testCase name="Inequality checks that should succeed" duration="{duration}"/> + <testCase name="Mayfail test case with nested sections/1/A" duration="{duration}"> + <skipped message="FAIL()"> +FAILED: +Condition.tests.cpp:<line number> + </skipped> + </testCase> + <testCase name="Mayfail test case with nested sections/2/A" duration="{duration}"> + <skipped message="FAIL()"> +FAILED: +Condition.tests.cpp:<line number> + </skipped> + </testCase> + <testCase name="Mayfail test case with nested sections/1/B" duration="{duration}"> + <skipped message="FAIL()"> +FAILED: +Condition.tests.cpp:<line number> + </skipped> + </testCase> + <testCase name="Mayfail test case with nested sections/2/B" duration="{duration}"> + <skipped message="FAIL()"> +FAILED: +Condition.tests.cpp:<line number> + </skipped> + </testCase> <testCase name="Ordering comparison checks that should fail" duration="{duration}"> <failure message="CHECK(data.int_seven > 7)"> FAILED: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Catch2-2.13.6/projects/SelfTest/Baselines/xml.sw.approved.txt new/Catch2-2.13.7/projects/SelfTest/Baselines/xml.sw.approved.txt --- old/Catch2-2.13.6/projects/SelfTest/Baselines/xml.sw.approved.txt 2021-04-16 20:14:58.000000000 +0200 +++ new/Catch2-2.13.7/projects/SelfTest/Baselines/xml.sw.approved.txt 2021-07-28 20:30:51.000000000 +0200 @@ -7956,6 +7956,43 @@ </Expression> <OverallResult success="false"/> </TestCase> + <TestCase name="Mayfail test case with nested sections" tags="[!mayfail]" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" > + <Section name="A" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" > + <Section name="1" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" > + <Failure filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" /> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <Section name="A" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" > + <Section name="2" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" > + <Failure filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" /> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <Section name="A" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" > + <OverallResults successes="0" failures="0" expectedFailures="0"/> + </Section> + <Section name="B" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" > + <Section name="1" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" > + <Failure filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" /> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <Section name="B" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" > + <Section name="2" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" > + <Failure filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" /> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <Section name="B" filename="projects/<exe-name>/UsageTests/Condition.tests.cpp" > + <OverallResults successes="0" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> <TestCase name="Mismatching exception messages failing the test" tags="[!hide][!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" > <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" > <Original> @@ -16722,9 +16759,9 @@ </Section> <OverallResult success="true"/> </TestCase> - <OverallResults successes="1607" failures="149" expectedFailures="21"/> - <OverallResultsCases successes="232" failures="86" expectedFailures="4"/> + <OverallResults successes="1607" failures="149" expectedFailures="25"/> + <OverallResultsCases successes="232" failures="86" expectedFailures="5"/> </Group> - <OverallResults successes="1607" failures="148" expectedFailures="21"/> - <OverallResultsCases successes="232" failures="86" expectedFailures="4"/> + <OverallResults successes="1607" failures="148" expectedFailures="25"/> + <OverallResultsCases successes="232" failures="86" expectedFailures="5"/> </Catch> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Catch2-2.13.6/projects/SelfTest/UsageTests/Condition.tests.cpp new/Catch2-2.13.7/projects/SelfTest/UsageTests/Condition.tests.cpp --- old/Catch2-2.13.6/projects/SelfTest/UsageTests/Condition.tests.cpp 2021-04-16 20:14:58.000000000 +0200 +++ new/Catch2-2.13.7/projects/SelfTest/UsageTests/Condition.tests.cpp 2021-07-28 20:30:51.000000000 +0200 @@ -11,7 +11,7 @@ // Wdouble-promotion is not supported until 3.8 # if (__clang_major__ > 3) || (__clang_major__ == 3 && __clang_minor__ > 7) # pragma clang diagnostic ignored "-Wdouble-promotion" -# endif +# endif #endif #include "catch.hpp" @@ -89,6 +89,19 @@ CHECK( x == Approx( 1.301 ) ); } +// Needed to test junit reporter's handling of mayfail test cases and sections +TEST_CASE("Mayfail test case with nested sections", "[!mayfail]") { + SECTION("A") { + SECTION("1") { FAIL(); } + SECTION("2") { FAIL(); } + } + SECTION("B") { + SECTION("1") { FAIL(); } + SECTION("2") { FAIL(); } + } +} + + TEST_CASE( "Inequality checks that should succeed" ) { TestData data; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Catch2-2.13.6/projects/SelfTest/UsageTests/Generators.tests.cpp new/Catch2-2.13.7/projects/SelfTest/UsageTests/Generators.tests.cpp --- old/Catch2-2.13.6/projects/SelfTest/UsageTests/Generators.tests.cpp 2021-04-16 20:14:58.000000000 +0200 +++ new/Catch2-2.13.7/projects/SelfTest/UsageTests/Generators.tests.cpp 2021-07-28 20:30:51.000000000 +0200 @@ -58,12 +58,12 @@ // Structured bindings make the table utility much nicer to use TEST_CASE( "strlen2", "[approvals][generators]" ) { - auto [test_input, expected] = GENERATE( table<std::string, size_t>({ - {"one", 3}, - {"two", 3}, - {"three", 5}, - {"four", 4} - })); + using tuple_type = std::tuple<std::string, int>; // see above workaround + auto [test_input, expected] = + GENERATE( table<std::string, size_t>( { tuple_type{ "one", 3 }, + tuple_type{ "two", 3 }, + tuple_type{ "three", 5 }, + tuple_type{ "four", 4 } } ) ); REQUIRE( test_input.size() == expected ); } @@ -99,11 +99,9 @@ static auto eatCucumbers( int start, int eat ) -> int { return start-eat; } SCENARIO("Eating cucumbers", "[generators][approvals]") { - - auto [start, eat, left] = GENERATE( table<int,int,int> ({ - { 12, 5, 7 }, - { 20, 5, 15 } - })); + using tuple_type = std::tuple<int, int, int>; + auto [start, eat, left] = GENERATE( table<int, int, int>( + { tuple_type{ 12, 5, 7 }, tuple_type{ 20, 5, 15 } } ) ); GIVEN( "there are " << start << " cucumbers" ) WHEN( "I eat " << eat << " cucumbers" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Catch2-2.13.6/scripts/approvalTests.py new/Catch2-2.13.7/scripts/approvalTests.py --- old/Catch2-2.13.6/scripts/approvalTests.py 2021-04-16 20:14:58.000000000 +0200 +++ new/Catch2-2.13.7/scripts/approvalTests.py 2021-07-28 20:30:51.000000000 +0200 @@ -28,7 +28,10 @@ ''', re.VERBOSE) lineNumberParser = re.compile(r' line="[0-9]*"') hexParser = re.compile(r'\b(0[xX][0-9a-fA-F]+)\b') -durationsParser = re.compile(r' time="[0-9]*\.[0-9]*"') +# Note: junit must serialize time with 3 (or or less) decimal places +# before generalizing this parser, make sure that this is checked +# in other places too. +junitDurationsParser = re.compile(r' time="[0-9]*\.[0-9]{3}"') sonarqubeDurationParser = re.compile(r' duration="[0-9]+"') timestampsParser = re.compile(r'\d{4}-\d{2}-\d{2}T\d{2}\:\d{2}\:\d{2}Z') versionParser = re.compile(r'Catch v[0-9]+\.[0-9]+\.[0-9]+(-develop\.[0-9]+)?') @@ -138,7 +141,7 @@ line = hexParser.sub("0x<hex digits>", line) # strip durations and timestamps - line = durationsParser.sub(' time="{duration}"', line) + line = junitDurationsParser.sub(' time="{duration}"', line) line = sonarqubeDurationParser.sub(' duration="{duration}"', line) line = timestampsParser.sub('{iso8601-timestamp}', line) line = specialCaseParser.sub('file:\g<1>', line) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Catch2-2.13.6/single_include/catch2/catch.hpp new/Catch2-2.13.7/single_include/catch2/catch.hpp --- old/Catch2-2.13.6/single_include/catch2/catch.hpp 2021-04-16 20:14:58.000000000 +0200 +++ new/Catch2-2.13.7/single_include/catch2/catch.hpp 2021-07-28 20:30:51.000000000 +0200 @@ -1,6 +1,6 @@ /* - * Catch v2.13.6 - * Generated: 2021-04-16 18:23:38.044268 + * Catch v2.13.7 + * Generated: 2021-07-28 20:29:27.753164 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2021 Two Blue Cubes Ltd. All rights reserved. @@ -15,7 +15,7 @@ #define CATCH_VERSION_MAJOR 2 #define CATCH_VERSION_MINOR 13 -#define CATCH_VERSION_PATCH 6 +#define CATCH_VERSION_PATCH 7 #ifdef __clang__ # pragma clang system_header @@ -326,7 +326,7 @@ // Check if byte is available and usable # if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER) # include <cstddef> - # if __cpp_lib_byte > 0 + # if defined(__cpp_lib_byte) && (__cpp_lib_byte > 0) # define CATCH_INTERNAL_CONFIG_CPP17_BYTE # endif # endif // __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER) @@ -5458,6 +5458,8 @@ } // namespace Catch // end catch_outlier_classification.hpp + +#include <iterator> #endif // CATCH_CONFIG_ENABLE_BENCHMARKING #include <string> @@ -6342,9 +6344,10 @@ void writeTestCase(TestCaseNode const& testCaseNode); - void writeSection(std::string const& className, - std::string const& rootName, - SectionNode const& sectionNode); + void writeSection( std::string const& className, + std::string const& rootName, + SectionNode const& sectionNode, + bool testOkToFail ); void writeAssertions(SectionNode const& sectionNode); void writeAssertion(AssertionStats const& stats); @@ -6879,7 +6882,7 @@ } iters *= 2; } - throw optimized_away_error{}; + Catch::throw_exception(optimized_away_error{}); } } // namespace Detail } // namespace Benchmark @@ -6887,6 +6890,7 @@ // end catch_run_for_at_least.hpp #include <algorithm> +#include <iterator> namespace Catch { namespace Benchmark { @@ -15376,7 +15380,7 @@ } Version const& libraryVersion() { - static Version version( 2, 13, 6, "", 0 ); + static Version version( 2, 13, 7, "", 0 ); return version; } @@ -16789,6 +16793,7 @@ #include <sstream> #include <ctime> #include <algorithm> +#include <iomanip> namespace Catch { @@ -16816,7 +16821,7 @@ #else std::strftime(timeStamp, timeStampSize, fmt, timeInfo); #endif - return std::string(timeStamp); + return std::string(timeStamp, timeStampSize-1); } std::string fileNameTag(const std::vector<std::string> &tags) { @@ -16827,6 +16832,17 @@ return it->substr(1); return std::string(); } + + // Formats the duration in seconds to 3 decimal places. + // This is done because some genius defined Maven Surefire schema + // in a way that only accepts 3 decimal places, and tools like + // Jenkins use that schema for validation JUnit reporter output. + std::string formatDuration( double seconds ) { + ReusableStringStream rss; + rss << std::fixed << std::setprecision( 3 ) << seconds; + return rss.str(); + } + } // anonymous namespace JunitReporter::JunitReporter( ReporterConfig const& _config ) @@ -16896,7 +16912,7 @@ if( m_config->showDurations() == ShowDurations::Never ) xml.writeAttribute( "time", "" ); else - xml.writeAttribute( "time", suiteTime ); + xml.writeAttribute( "time", formatDuration( suiteTime ) ); xml.writeAttribute( "timestamp", getCurrentTimestamp() ); // Write properties if there are any @@ -16941,12 +16957,13 @@ if ( !m_config->name().empty() ) className = m_config->name() + "." + className; - writeSection( className, "", rootSection ); + writeSection( className, "", rootSection, stats.testInfo.okToFail() ); } - void JunitReporter::writeSection( std::string const& className, - std::string const& rootName, - SectionNode const& sectionNode ) { + void JunitReporter::writeSection( std::string const& className, + std::string const& rootName, + SectionNode const& sectionNode, + bool testOkToFail) { std::string name = trim( sectionNode.stats.sectionInfo.name ); if( !rootName.empty() ) name = rootName + '/' + name; @@ -16963,13 +16980,18 @@ xml.writeAttribute( "classname", className ); xml.writeAttribute( "name", name ); } - xml.writeAttribute( "time", ::Catch::Detail::stringify( sectionNode.stats.durationInSeconds ) ); + xml.writeAttribute( "time", formatDuration( sectionNode.stats.durationInSeconds ) ); // This is not ideal, but it should be enough to mimic gtest's // junit output. // Ideally the JUnit reporter would also handle `skipTest` // events and write those out appropriately. xml.writeAttribute( "status", "run" ); + if (sectionNode.stats.assertions.failedButOk) { + xml.scopedElement("skipped") + .writeAttribute("message", "TEST_CASE tagged with !mayfail"); + } + writeAssertions( sectionNode ); if( !sectionNode.stdOut.empty() ) @@ -16979,9 +17001,9 @@ } for( auto const& childNode : sectionNode.childSections ) if( className.empty() ) - writeSection( name, "", *childNode ); + writeSection( name, "", *childNode, testOkToFail ); else - writeSection( className, name, *childNode ); + writeSection( className, name, *childNode, testOkToFail ); } void JunitReporter::writeAssertions( SectionNode const& sectionNode ) {