This commit is contained in:
Martin Hořeňovský 2019-02-12 19:58:12 +01:00
parent 5d4061af12
commit dbbab8727c
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
7 changed files with 45 additions and 22 deletions

View File

@ -6,7 +6,7 @@ if(NOT DEFINED PROJECT_NAME)
set(NOT_SUBPROJECT ON) set(NOT_SUBPROJECT ON)
endif() endif()
project(Catch2 LANGUAGES CXX VERSION 2.6.0) project(Catch2 LANGUAGES CXX VERSION 2.6.1)
# 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")

View File

@ -5,11 +5,11 @@
[![Build Status](https://travis-ci.org/catchorg/Catch2.svg?branch=master)](https://travis-ci.org/catchorg/Catch2) [![Build Status](https://travis-ci.org/catchorg/Catch2.svg?branch=master)](https://travis-ci.org/catchorg/Catch2)
[![Build status](https://ci.appveyor.com/api/projects/status/github/catchorg/Catch2?svg=true)](https://ci.appveyor.com/project/catchorg/catch2) [![Build status](https://ci.appveyor.com/api/projects/status/github/catchorg/Catch2?svg=true)](https://ci.appveyor.com/project/catchorg/catch2)
[![codecov](https://codecov.io/gh/catchorg/Catch2/branch/master/graph/badge.svg)](https://codecov.io/gh/catchorg/Catch2) [![codecov](https://codecov.io/gh/catchorg/Catch2/branch/master/graph/badge.svg)](https://codecov.io/gh/catchorg/Catch2)
[![Try online](https://img.shields.io/badge/try-online-blue.svg)](https://wandbox.org/permlink/85qcYBOdUKzlnpl5) [![Try online](https://img.shields.io/badge/try-online-blue.svg)](https://wandbox.org/permlink/rJhfG8exsneDGleb)
[![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.6.0/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.6.1/catch.hpp">The latest version of the single header can be downloaded directly using this link</a>
## Catch2 is released! ## Catch2 is released!

View File

@ -2,6 +2,7 @@
# Release notes # Release notes
**Contents**<br> **Contents**<br>
[2.6.1](#261)<br>
[2.6.0](#260)<br> [2.6.0](#260)<br>
[2.5.0](#250)<br> [2.5.0](#250)<br>
[2.4.2](#242)<br> [2.4.2](#242)<br>
@ -19,6 +20,18 @@
[Older versions](#older-versions)<br> [Older versions](#older-versions)<br>
[Even Older versions](#even-older-versions)<br> [Even Older versions](#even-older-versions)<br>
## 2.6.1
### Improvements
* The JUnit reporter now also reports random seed (#1520, #1521)
### Fixes
* The TAP reporter now formats comments with test name properly (#1529)
* `CATCH_REQUIRE_THROWS`'s internals were unified with `REQUIRE_THROWS` (#1536)
* This fixes a potential `-Wunused-value` warning when used
* Fixed a potential segfault when using any of the `--list-*` options (#1533, #1534)
## 2.6.0 ## 2.6.0
**With this release the data generator feature is now fully supported.** **With this release the data generator feature is now fully supported.**

View File

@ -11,7 +11,7 @@
#define CATCH_VERSION_MAJOR 2 #define CATCH_VERSION_MAJOR 2
#define CATCH_VERSION_MINOR 6 #define CATCH_VERSION_MINOR 6
#define CATCH_VERSION_PATCH 0 #define CATCH_VERSION_PATCH 1
#ifdef __clang__ #ifdef __clang__
# pragma clang system_header # pragma clang system_header

View File

@ -37,7 +37,7 @@ namespace Catch {
} }
Version const& libraryVersion() { Version const& libraryVersion() {
static Version version( 2, 6, 0, "", 0 ); static Version version( 2, 6, 1, "", 0 );
return version; return version;
} }

View File

@ -1,6 +1,6 @@
/* /*
* Catch v2.6.0 * Catch v2.6.1
* Generated: 2019-01-31 22:25:55.560884 * Generated: 2019-02-12 19:52:52.262497
* ---------------------------------------------------------- * ----------------------------------------------------------
* 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) 2019 Two Blue Cubes Ltd. All rights reserved. * Copyright (c) 2019 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 6 #define CATCH_VERSION_MINOR 6
#define CATCH_VERSION_PATCH 0 #define CATCH_VERSION_PATCH 1
#ifdef __clang__ #ifdef __clang__
# pragma clang system_header # pragma clang system_header
@ -8881,7 +8881,7 @@ namespace Catch {
std::size_t listReporters(); std::size_t listReporters();
Option<std::size_t> list( Config const& config ); Option<std::size_t> list( std::shared_ptr<Config> const& config );
} // end namespace Catch } // end namespace Catch
@ -9019,15 +9019,16 @@ namespace Catch {
return factories.size(); return factories.size();
} }
Option<std::size_t> list( Config const& config ) { Option<std::size_t> list( std::shared_ptr<Config> const& config ) {
Option<std::size_t> listedCount; Option<std::size_t> listedCount;
if( config.listTests() ) getCurrentMutableContext().setConfig( config );
listedCount = listedCount.valueOr(0) + listTests( config ); if( config->listTests() )
if( config.listTestNamesOnly() ) listedCount = listedCount.valueOr(0) + listTests( *config );
listedCount = listedCount.valueOr(0) + listTestsNamesOnly( config ); if( config->listTestNamesOnly() )
if( config.listTags() ) listedCount = listedCount.valueOr(0) + listTestsNamesOnly( *config );
listedCount = listedCount.valueOr(0) + listTags( config ); if( config->listTags() )
if( config.listReporters() ) listedCount = listedCount.valueOr(0) + listTags( *config );
if( config->listReporters() )
listedCount = listedCount.valueOr(0) + listReporters(); listedCount = listedCount.valueOr(0) + listReporters();
return listedCount; return listedCount;
} }
@ -10761,6 +10762,8 @@ namespace Catch {
return 1; return 1;
auto result = m_cli.parse( clara::Args( argc, argv ) ); auto result = m_cli.parse( clara::Args( argc, argv ) );
config();
getCurrentMutableContext().setConfig( m_config );
if( !result ) { if( !result ) {
Catch::cerr() Catch::cerr()
<< Colour( Colour::Red ) << Colour( Colour::Red )
@ -10853,7 +10856,7 @@ namespace Catch {
applyFilenamesAsTags( *m_config ); applyFilenamesAsTags( *m_config );
// Handle list request // Handle list request
if( Option<std::size_t> listed = list( config() ) ) if( Option<std::size_t> listed = list( m_config ) )
return static_cast<int>( *listed ); return static_cast<int>( *listed );
auto totals = runTests( m_config ); auto totals = runTests( m_config );
@ -12426,7 +12429,7 @@ namespace Catch {
} }
Version const& libraryVersion() { Version const& libraryVersion() {
static Version version( 2, 6, 0, "", 0 ); static Version version( 2, 6, 1, "", 0 );
return version; return version;
} }
@ -13761,6 +13764,13 @@ namespace Catch {
void JunitReporter::testRunStarting( TestRunInfo const& runInfo ) { void JunitReporter::testRunStarting( TestRunInfo const& runInfo ) {
CumulativeReporterBase::testRunStarting( runInfo ); CumulativeReporterBase::testRunStarting( runInfo );
xml.startElement( "testsuites" ); xml.startElement( "testsuites" );
if( m_config->rngSeed() != 0 ) {
xml.startElement( "properties" );
xml.scopedElement( "property" )
.writeAttribute( "name", "random-seed" )
.writeAttribute( "value", m_config->rngSeed() );
xml.endElement();
}
} }
void JunitReporter::testGroupStarting( GroupInfo const& groupInfo ) { void JunitReporter::testGroupStarting( GroupInfo const& groupInfo ) {
@ -14345,7 +14355,7 @@ int main (int argc, char * const argv[]) {
#define CATCH_REQUIRE( ... ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE", Catch::ResultDisposition::Normal, __VA_ARGS__ ) #define CATCH_REQUIRE( ... ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE", Catch::ResultDisposition::Normal, __VA_ARGS__ )
#define CATCH_REQUIRE_FALSE( ... ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, __VA_ARGS__ ) #define CATCH_REQUIRE_FALSE( ... ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
#define CATCH_REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_REQUIRE_THROWS", Catch::ResultDisposition::Normal, "", __VA_ARGS__ ) #define CATCH_REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_REQUIRE_THROWS", Catch::ResultDisposition::Normal, __VA_ARGS__ )
#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CATCH_REQUIRE_THROWS_AS", exceptionType, Catch::ResultDisposition::Normal, expr ) #define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CATCH_REQUIRE_THROWS_AS", exceptionType, Catch::ResultDisposition::Normal, expr )
#define CATCH_REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CATCH_REQUIRE_THROWS_WITH", Catch::ResultDisposition::Normal, matcher, expr ) #define CATCH_REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CATCH_REQUIRE_THROWS_WITH", Catch::ResultDisposition::Normal, matcher, expr )
#if !defined(CATCH_CONFIG_DISABLE_MATCHERS) #if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
@ -14359,7 +14369,7 @@ int main (int argc, char * const argv[]) {
#define CATCH_CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( "CATCH_CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) #define CATCH_CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( "CATCH_CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
#define CATCH_CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK_NOFAIL", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ ) #define CATCH_CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK_NOFAIL", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ )
#define CATCH_CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, "", __VA_ARGS__ ) #define CATCH_CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CATCH_CHECK_THROWS_AS", exceptionType, Catch::ResultDisposition::ContinueOnFailure, expr ) #define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CATCH_CHECK_THROWS_AS", exceptionType, Catch::ResultDisposition::ContinueOnFailure, expr )
#define CATCH_CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CATCH_CHECK_THROWS_WITH", Catch::ResultDisposition::ContinueOnFailure, matcher, expr ) #define CATCH_CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CATCH_CHECK_THROWS_WITH", Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
#if !defined(CATCH_CONFIG_DISABLE_MATCHERS) #if !defined(CATCH_CONFIG_DISABLE_MATCHERS)

View File

@ -42,9 +42,9 @@ namespace Catch {
bool assertionEnded( AssertionStats const& _assertionStats ) override { bool assertionEnded( AssertionStats const& _assertionStats ) override {
++counter; ++counter;
stream << "# " << currentTestCaseInfo->name << std::endl;
AssertionPrinter printer( stream, _assertionStats, counter ); AssertionPrinter printer( stream, _assertionStats, counter );
printer.print(); printer.print();
stream << " # " << currentTestCaseInfo->name ;
stream << std::endl; stream << std::endl;
return true; return true;