mirror of
https://github.com/catchorg/Catch2.git
synced 2024-12-23 11:43:29 +01:00
v2.13.7
This commit is contained in:
parent
eea3e9a5b5
commit
c4e3767e26
@ -16,7 +16,7 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
project(Catch2 LANGUAGES CXX VERSION 2.13.6)
|
project(Catch2 LANGUAGES CXX VERSION 2.13.7)
|
||||||
|
|
||||||
# Provide path for scripts
|
# Provide path for scripts
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")
|
||||||
|
@ -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)
|
[![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!
|
## Catch2 is released!
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
# Release notes
|
# Release notes
|
||||||
**Contents**<br>
|
**Contents**<br>
|
||||||
|
[2.13.7](#2137)<br>
|
||||||
[2.13.6](#2136)<br>
|
[2.13.6](#2136)<br>
|
||||||
[2.13.5](#2135)<br>
|
[2.13.5](#2135)<br>
|
||||||
[2.13.4](#2134)<br>
|
[2.13.4](#2134)<br>
|
||||||
@ -47,6 +48,16 @@
|
|||||||
[Even Older versions](#even-older-versions)<br>
|
[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
|
## 2.13.6
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
#define CATCH_VERSION_MAJOR 2
|
#define CATCH_VERSION_MAJOR 2
|
||||||
#define CATCH_VERSION_MINOR 13
|
#define CATCH_VERSION_MINOR 13
|
||||||
#define CATCH_VERSION_PATCH 6
|
#define CATCH_VERSION_PATCH 7
|
||||||
|
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
# pragma clang system_header
|
# pragma clang system_header
|
||||||
|
@ -37,7 +37,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Version const& libraryVersion() {
|
Version const& libraryVersion() {
|
||||||
static Version version( 2, 13, 6, "", 0 );
|
static Version version( 2, 13, 7, "", 0 );
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Catch v2.13.6
|
* Catch v2.13.7
|
||||||
* Generated: 2021-04-16 18:23:38.044268
|
* Generated: 2021-07-28 20:29:27.753164
|
||||||
* ----------------------------------------------------------
|
* ----------------------------------------------------------
|
||||||
* This file has been merged from multiple headers. Please don't edit it directly
|
* This file has been merged from multiple headers. Please don't edit it directly
|
||||||
* Copyright (c) 2021 Two Blue Cubes Ltd. All rights reserved.
|
* Copyright (c) 2021 Two Blue Cubes Ltd. All rights reserved.
|
||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#define CATCH_VERSION_MAJOR 2
|
#define CATCH_VERSION_MAJOR 2
|
||||||
#define CATCH_VERSION_MINOR 13
|
#define CATCH_VERSION_MINOR 13
|
||||||
#define CATCH_VERSION_PATCH 6
|
#define CATCH_VERSION_PATCH 7
|
||||||
|
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
# pragma clang system_header
|
# pragma clang system_header
|
||||||
@ -326,7 +326,7 @@ namespace Catch {
|
|||||||
// Check if byte is available and usable
|
// Check if byte is available and usable
|
||||||
# if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
|
# if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
|
||||||
# include <cstddef>
|
# include <cstddef>
|
||||||
# if __cpp_lib_byte > 0
|
# if defined(__cpp_lib_byte) && (__cpp_lib_byte > 0)
|
||||||
# define CATCH_INTERNAL_CONFIG_CPP17_BYTE
|
# define CATCH_INTERNAL_CONFIG_CPP17_BYTE
|
||||||
# endif
|
# endif
|
||||||
# endif // __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
|
# endif // __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
|
||||||
@ -5458,6 +5458,8 @@ namespace Catch {
|
|||||||
} // namespace Catch
|
} // namespace Catch
|
||||||
|
|
||||||
// end catch_outlier_classification.hpp
|
// end catch_outlier_classification.hpp
|
||||||
|
|
||||||
|
#include <iterator>
|
||||||
#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
|
#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -6342,9 +6344,10 @@ namespace Catch {
|
|||||||
|
|
||||||
void writeTestCase(TestCaseNode const& testCaseNode);
|
void writeTestCase(TestCaseNode const& testCaseNode);
|
||||||
|
|
||||||
void writeSection(std::string const& className,
|
void writeSection( std::string const& className,
|
||||||
std::string const& rootName,
|
std::string const& rootName,
|
||||||
SectionNode const& sectionNode);
|
SectionNode const& sectionNode,
|
||||||
|
bool testOkToFail );
|
||||||
|
|
||||||
void writeAssertions(SectionNode const& sectionNode);
|
void writeAssertions(SectionNode const& sectionNode);
|
||||||
void writeAssertion(AssertionStats const& stats);
|
void writeAssertion(AssertionStats const& stats);
|
||||||
@ -6879,7 +6882,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
iters *= 2;
|
iters *= 2;
|
||||||
}
|
}
|
||||||
throw optimized_away_error{};
|
Catch::throw_exception(optimized_away_error{});
|
||||||
}
|
}
|
||||||
} // namespace Detail
|
} // namespace Detail
|
||||||
} // namespace Benchmark
|
} // namespace Benchmark
|
||||||
@ -6887,6 +6890,7 @@ namespace Catch {
|
|||||||
|
|
||||||
// end catch_run_for_at_least.hpp
|
// end catch_run_for_at_least.hpp
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <iterator>
|
||||||
|
|
||||||
namespace Catch {
|
namespace Catch {
|
||||||
namespace Benchmark {
|
namespace Benchmark {
|
||||||
@ -15376,7 +15380,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Version const& libraryVersion() {
|
Version const& libraryVersion() {
|
||||||
static Version version( 2, 13, 6, "", 0 );
|
static Version version( 2, 13, 7, "", 0 );
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16789,6 +16793,7 @@ CATCH_REGISTER_REPORTER("console", ConsoleReporter)
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <iomanip>
|
||||||
|
|
||||||
namespace Catch {
|
namespace Catch {
|
||||||
|
|
||||||
@ -16816,7 +16821,7 @@ namespace Catch {
|
|||||||
#else
|
#else
|
||||||
std::strftime(timeStamp, timeStampSize, fmt, timeInfo);
|
std::strftime(timeStamp, timeStampSize, fmt, timeInfo);
|
||||||
#endif
|
#endif
|
||||||
return std::string(timeStamp);
|
return std::string(timeStamp, timeStampSize-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string fileNameTag(const std::vector<std::string> &tags) {
|
std::string fileNameTag(const std::vector<std::string> &tags) {
|
||||||
@ -16827,6 +16832,17 @@ namespace Catch {
|
|||||||
return it->substr(1);
|
return it->substr(1);
|
||||||
return std::string();
|
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
|
} // anonymous namespace
|
||||||
|
|
||||||
JunitReporter::JunitReporter( ReporterConfig const& _config )
|
JunitReporter::JunitReporter( ReporterConfig const& _config )
|
||||||
@ -16896,7 +16912,7 @@ namespace Catch {
|
|||||||
if( m_config->showDurations() == ShowDurations::Never )
|
if( m_config->showDurations() == ShowDurations::Never )
|
||||||
xml.writeAttribute( "time", "" );
|
xml.writeAttribute( "time", "" );
|
||||||
else
|
else
|
||||||
xml.writeAttribute( "time", suiteTime );
|
xml.writeAttribute( "time", formatDuration( suiteTime ) );
|
||||||
xml.writeAttribute( "timestamp", getCurrentTimestamp() );
|
xml.writeAttribute( "timestamp", getCurrentTimestamp() );
|
||||||
|
|
||||||
// Write properties if there are any
|
// Write properties if there are any
|
||||||
@ -16941,12 +16957,13 @@ namespace Catch {
|
|||||||
if ( !m_config->name().empty() )
|
if ( !m_config->name().empty() )
|
||||||
className = m_config->name() + "." + className;
|
className = m_config->name() + "." + className;
|
||||||
|
|
||||||
writeSection( className, "", rootSection );
|
writeSection( className, "", rootSection, stats.testInfo.okToFail() );
|
||||||
}
|
}
|
||||||
|
|
||||||
void JunitReporter::writeSection( std::string const& className,
|
void JunitReporter::writeSection( std::string const& className,
|
||||||
std::string const& rootName,
|
std::string const& rootName,
|
||||||
SectionNode const& sectionNode ) {
|
SectionNode const& sectionNode,
|
||||||
|
bool testOkToFail) {
|
||||||
std::string name = trim( sectionNode.stats.sectionInfo.name );
|
std::string name = trim( sectionNode.stats.sectionInfo.name );
|
||||||
if( !rootName.empty() )
|
if( !rootName.empty() )
|
||||||
name = rootName + '/' + name;
|
name = rootName + '/' + name;
|
||||||
@ -16963,13 +16980,18 @@ namespace Catch {
|
|||||||
xml.writeAttribute( "classname", className );
|
xml.writeAttribute( "classname", className );
|
||||||
xml.writeAttribute( "name", name );
|
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
|
// This is not ideal, but it should be enough to mimic gtest's
|
||||||
// junit output.
|
// junit output.
|
||||||
// Ideally the JUnit reporter would also handle `skipTest`
|
// Ideally the JUnit reporter would also handle `skipTest`
|
||||||
// events and write those out appropriately.
|
// events and write those out appropriately.
|
||||||
xml.writeAttribute( "status", "run" );
|
xml.writeAttribute( "status", "run" );
|
||||||
|
|
||||||
|
if (sectionNode.stats.assertions.failedButOk) {
|
||||||
|
xml.scopedElement("skipped")
|
||||||
|
.writeAttribute("message", "TEST_CASE tagged with !mayfail");
|
||||||
|
}
|
||||||
|
|
||||||
writeAssertions( sectionNode );
|
writeAssertions( sectionNode );
|
||||||
|
|
||||||
if( !sectionNode.stdOut.empty() )
|
if( !sectionNode.stdOut.empty() )
|
||||||
@ -16979,9 +17001,9 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
for( auto const& childNode : sectionNode.childSections )
|
for( auto const& childNode : sectionNode.childSections )
|
||||||
if( className.empty() )
|
if( className.empty() )
|
||||||
writeSection( name, "", *childNode );
|
writeSection( name, "", *childNode, testOkToFail );
|
||||||
else
|
else
|
||||||
writeSection( className, name, *childNode );
|
writeSection( className, name, *childNode, testOkToFail );
|
||||||
}
|
}
|
||||||
|
|
||||||
void JunitReporter::writeAssertions( SectionNode const& sectionNode ) {
|
void JunitReporter::writeAssertions( SectionNode const& sectionNode ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user