Skip to content

Commit

Permalink
v2.13.7
Browse files Browse the repository at this point in the history
  • Loading branch information
horenmar committed Jul 28, 2021
1 parent eea3e9a commit c4e3767
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 22 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -16,7 +16,7 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
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")
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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!

Expand Down
11 changes: 11 additions & 0 deletions docs/release-notes.md
Expand Up @@ -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>
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/catch.hpp
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/internal/catch_version.cpp
Expand Up @@ -37,7 +37,7 @@ namespace Catch {
}

Version const& libraryVersion() {
static Version version( 2, 13, 6, "", 0 );
static Version version( 2, 13, 7, "", 0 );
return version;
}

Expand Down
58 changes: 40 additions & 18 deletions single_include/catch2/catch.hpp
@@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -326,7 +326,7 @@ namespace Catch {
// 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)
Expand Down Expand Up @@ -5458,6 +5458,8 @@ namespace Catch {
} // namespace Catch

// end catch_outlier_classification.hpp

#include <iterator>
#endif // CATCH_CONFIG_ENABLE_BENCHMARKING

#include <string>
Expand Down Expand Up @@ -6342,9 +6344,10 @@ namespace Catch {

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);
Expand Down Expand Up @@ -6879,14 +6882,15 @@ namespace Catch {
}
iters *= 2;
}
throw optimized_away_error{};
Catch::throw_exception(optimized_away_error{});
}
} // namespace Detail
} // namespace Benchmark
} // namespace Catch

// end catch_run_for_at_least.hpp
#include <algorithm>
#include <iterator>

namespace Catch {
namespace Benchmark {
Expand Down Expand Up @@ -15376,7 +15380,7 @@ namespace Catch {
}

Version const& libraryVersion() {
static Version version( 2, 13, 6, "", 0 );
static Version version( 2, 13, 7, "", 0 );
return version;
}

Expand Down Expand Up @@ -16789,6 +16793,7 @@ CATCH_REGISTER_REPORTER("console", ConsoleReporter)
#include <sstream>
#include <ctime>
#include <algorithm>
#include <iomanip>

namespace Catch {

Expand Down Expand Up @@ -16816,7 +16821,7 @@ namespace Catch {
#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) {
Expand All @@ -16827,6 +16832,17 @@ namespace Catch {
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 )
Expand Down Expand Up @@ -16896,7 +16912,7 @@ namespace Catch {
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
Expand Down Expand Up @@ -16941,12 +16957,13 @@ namespace Catch {
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;
Expand All @@ -16963,13 +16980,18 @@ namespace Catch {
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() )
Expand All @@ -16979,9 +17001,9 @@ namespace Catch {
}
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 ) {
Expand Down

0 comments on commit c4e3767

Please sign in to comment.