diff options
| author | Martin Hořeňovský | 2022-04-04 21:07:04 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2022-04-07 12:50:08 +0200 |
| commit | 423e1d2ebbd75bb92cb486f83f2c5800b4b9689e (patch) | |
| tree | 3cfff7f75517b1771ab43c7439ba195a77dcec31 /tests | |
| parent | 3c06bcb374aaebf91ad1d63aba655dee66cf7b91 (diff) | |
| download | catch3-423e1d2ebbd75bb92cb486f83f2c5800b4b9689e.tar.gz | |
Integrate the new reporter specs into Catch2
This means that the CLI interface now uses the new key-value oriented
reporter spec, the common reporter base creates the colour implementation
based on the reporter-specific configuration, and it also stores the
custom configuration options for each reporter instance.
Closes #339 as it allows per-reporter forcing of ansi colour codes.
Diffstat (limited to 'tests')
18 files changed, 264 insertions, 360 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a4d01dc9..46294c3e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -435,8 +435,8 @@ if (NOT MEMORYCHECK_COMMAND) add_test(NAME "MultiReporter::CapturingReportersDontPropagateStdOut" COMMAND $<TARGET_FILE:SelfTest> "Sends stuff to stdout and stderr" - --reporter xml::${_NullFile} - --reporter junit::${_NullFile} + --reporter xml::out=${_NullFile} + --reporter junit::out=${_NullFile} ) set_tests_properties("MultiReporter::CapturingReportersDontPropagateStdOut" PROPERTIES @@ -447,8 +447,8 @@ endif() add_test(NAME "MultiReporter::NonCapturingReportersPropagateStdout" COMMAND $<TARGET_FILE:SelfTest> "Sends stuff to stdout and stderr" - --reporter xml::${_NullFile} - --reporter console::${_NullFile} + --reporter xml::out=${_NullFile} + --reporter console::out=${_NullFile} ) set_tests_properties("MultiReporter::NonCapturingReportersPropagateStdout" PROPERTIES @@ -468,13 +468,34 @@ set_tests_properties("Outputs::DashAsOutLocationSendsOutputToStdout" add_test(NAME "Reporters::DashAsLocationInReporterSpecSendsOutputToStdout" COMMAND $<TARGET_FILE:SelfTest> "Factorials are computed" - --reporter console::- + --reporter console::out=- ) set_tests_properties("Reporters::DashAsLocationInReporterSpecSendsOutputToStdout" PROPERTIES PASS_REGULAR_EXPRESSION "All tests passed \\(5 assertions in 1 test case\\)" ) +add_test(NAME "Reporters::ReporterSpecificColourOverridesDefaultColour" + COMMAND + $<TARGET_FILE:SelfTest> "Factorials are computed" + --reporter console::colour-mode=ansi + --colour-mode none +) +set_tests_properties("Reporters::ReporterSpecificColourOverridesDefaultColour" + PROPERTIES + PASS_REGULAR_EXPRESSION "\\[1\;32mAll tests passed" +) + +add_test(NAME "Reporters::UnrecognizedOptionInSpecCausesError" + COMMAND + $<TARGET_FILE:SelfTest> "Factorials are computed" + --reporter console::bad-option=ansi +) +set_tests_properties("Reporters::UnrecognizedOptionInSpecCausesError" + PROPERTIES + WILL_FAIL ON +) + add_test(NAME "Colours::ColourModeCanBeExplicitlySetToAnsi" COMMAND $<TARGET_FILE:SelfTest> "Factorials are computed" diff --git a/tests/ExtraTests/CMakeLists.txt b/tests/ExtraTests/CMakeLists.txt index 8e6b3094..1a400454 100644 --- a/tests/ExtraTests/CMakeLists.txt +++ b/tests/ExtraTests/CMakeLists.txt @@ -272,8 +272,8 @@ if (NOT MEMORYCHECK_COMMAND) add_test( NAME MultiReporter::NoncapturingListenerDoesntCauseStdoutPassThrough COMMAND ListenerStdoutCaptureInMultireporter - --reporter xml::${_NullFile} - --reporter junit::${_NullFile} + --reporter xml::out=${_NullFile} + --reporter junit::out=${_NullFile} ) set_tests_properties( @@ -290,8 +290,8 @@ target_link_libraries(ListenerCanAskForCapturedStdout PRIVATE Catch2::Catch2With add_test( NAME MultiReporter::CapturingListenerCausesStdoutCapture COMMAND ListenerCanAskForCapturedStdout - --reporter compact::${_NullFile} - --reporter console::${_NullFile} + --reporter compact::out=${_NullFile} + --reporter console::out=${_NullFile} ) set_tests_properties( MultiReporter::CapturingListenerCausesStdoutCapture @@ -317,7 +317,7 @@ add_test( NAME MultiReporter::PreferencesForPassingAssertionsIsRespected COMMAND ReporterPreferencesForPassingAssertionsIsRespected --reporter test-reporter - --reporter console::${_NullFile} + --reporter console::out=${_NullFile} ) set_tests_properties( MultiReporter::PreferencesForPassingAssertionsIsRespected @@ -339,6 +339,20 @@ set_tests_properties( FAIL_REGULAR_EXPRESSION "X28 - ERROR" ) +add_executable(CustomArgumentsForReporters ${TESTS_DIR}/X29-CustomArgumentsForReporters.cpp) +target_link_libraries(CustomArgumentsForReporters PRIVATE Catch2::Catch2WithMain) +add_test( + NAME CustomArgumentsForReporters + COMMAND CustomArgumentsForReporters + --reporter "test-reporter::Xa b=c 1::Xz:e = 1234" +) +set_tests_properties( + CustomArgumentsForReporters + PROPERTIES + PASS_REGULAR_EXPRESSION "Xa b=c 1::Xz:e = 1234" +) + + add_executable(DuplicatedTestCases-SameNameAndTags ${TESTS_DIR}/X31-DuplicatedTestCases.cpp) target_link_libraries(DuplicatedTestCases-SameNameAndTags PRIVATE Catch2::Catch2WithMain) add_test( diff --git a/tests/ExtraTests/X29-CustomArgumentsForReporters.cpp b/tests/ExtraTests/X29-CustomArgumentsForReporters.cpp new file mode 100644 index 00000000..9721775d --- /dev/null +++ b/tests/ExtraTests/X29-CustomArgumentsForReporters.cpp @@ -0,0 +1,59 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Test that custom options are properly passed down to the reporter. + * + * We print out the arguments sorted by key, to have a stable expected + * output. + */ + +#include <catch2/catch_test_macros.hpp> +#include <catch2/reporters/catch_reporter_streaming_base.hpp> +#include <catch2/reporters/catch_reporter_registrars.hpp> + +#include <algorithm> +#include <iostream> +#include <string> +#include <utility> +#include <vector> + +class TestReporter : public Catch::StreamingReporterBase { +public: + TestReporter( Catch::ReporterConfig const& _config ): + StreamingReporterBase( _config ) { + std::cout << "X29 - TestReporter constructed\n"; + } + + static std::string getDescription() { + return "X29 test reporter"; + } + + void testRunStarting( Catch::TestRunInfo const& ) override { + std::vector<std::pair<std::string, std::string>> options; + for ( auto const& kv : m_customOptions ) { + options.push_back( kv ); + } + std::sort( options.begin(), options.end() ); + bool first = true; + for ( auto const& kv : options ) { + if ( !first ) { std::cout << "::"; } + std::cout << kv.first << "=" << kv.second; + first = false; + } + std::cout << '\n'; + } + + ~TestReporter() override; +}; + +TestReporter::~TestReporter() = default; + +CATCH_REGISTER_REPORTER( "test-reporter", TestReporter ) + +TEST_CASE( "Just a test case to run things" ) {} diff --git a/tests/SelfTest/Baselines/compact.sw.approved.txt b/tests/SelfTest/Baselines/compact.sw.approved.txt index e2ac5551..cabb1733 100644 --- a/tests/SelfTest/Baselines/compact.sw.approved.txt +++ b/tests/SelfTest/Baselines/compact.sw.approved.txt @@ -1316,10 +1316,8 @@ CmdLine.tests.cpp:<line number>: passed: config.abortAfter == -1 for: -1 == -1 CmdLine.tests.cpp:<line number>: passed: config.noThrow == false for: false == false CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications.empty() for: true CmdLine.tests.cpp:<line number>: passed: !(cfg.hasTestFilters()) for: !false -CmdLine.tests.cpp:<line number>: passed: cfg.getReportersAndOutputFiles().size() == 1 for: 1 == 1 -CmdLine.tests.cpp:<line number>: passed: cfg.getReportersAndOutputFiles()[0] == Catch::ConfigData::ReporterAndFile{ expectedReporter, {} } for: { console, <default-output> } -== -{ console, <default-output> } +CmdLine.tests.cpp:<line number>: passed: cfg.getReporterSpecs().size() == 1 for: 1 == 1 +CmdLine.tests.cpp:<line number>: passed: cfg.getReporterSpecs()[0] == Catch::ReporterSpec{ expectedReporter, {}, {}, {} } for: {?} == {?} CmdLine.tests.cpp:<line number>: passed: result for: {?} CmdLine.tests.cpp:<line number>: passed: cfg.hasTestFilters() for: true CmdLine.tests.cpp:<line number>: passed: cfg.testSpec().matches(*fakeTestCase("notIncluded")) == false for: false == false @@ -1333,37 +1331,21 @@ CmdLine.tests.cpp:<line number>: passed: cfg.hasTestFilters() for: true CmdLine.tests.cpp:<line number>: passed: cfg.testSpec().matches(*fakeTestCase("test1")) == false for: false == false CmdLine.tests.cpp:<line number>: passed: cfg.testSpec().matches(*fakeTestCase("alwaysIncluded")) for: true CmdLine.tests.cpp:<line number>: passed: result for: {?} with 1 message: 'result.errorMessage() := ""' -CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_ReporterAndFile{ {"console", {}} } for: { { console, <default-output> } } -== -{ { console, <default-output> } } with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "console", {}, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' CmdLine.tests.cpp:<line number>: passed: result for: {?} with 1 message: 'result.errorMessage() := ""' -CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_ReporterAndFile{ {"xml", {}} } for: { { xml, <default-output> } } -== -{ { xml, <default-output> } } with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "xml", {}, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' CmdLine.tests.cpp:<line number>: passed: result for: {?} with 1 message: 'result.errorMessage() := ""' -CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_ReporterAndFile{ {"junit", {}} } for: { { junit, <default-output> } } -== -{ { junit, <default-output> } } with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "junit", {}, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' CmdLine.tests.cpp:<line number>: passed: !result for: true CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), ContainsSubstring("Unrecognized reporter") for: "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" contains: "Unrecognized reporter" CmdLine.tests.cpp:<line number>: passed: result for: {?} with 1 message: 'result.errorMessage() := ""' -CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_ReporterAndFile{ {"console", "out.txt"s} } for: { { console, out.txt } } -== -{ { console, out.txt } } with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "console", "out.txt"s, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' CmdLine.tests.cpp:<line number>: passed: result for: {?} with 1 message: 'result.errorMessage() := ""' -CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_ReporterAndFile{ {"console", "C:\\Temp\\out.txt"s} } for: { { console, C:\Temp\out.txt } } -== -{ { console, C:\Temp\out.txt } } with 1 message: 'result.errorMessage() := ""' -CmdLine.tests.cpp:<line number>: passed: !result for: true -CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), ContainsSubstring("empty filename") for: "Reporter 'console' has empty filename specified as its output. Supply a filename or remove the colons to use the default output." contains: "empty filename" -CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "-r", "xml::output.xml", "-r", "junit::output-junit.xml" }) for: {?} -CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_ReporterAndFile{ {"xml", "output.xml"s}, {"junit", "output-junit.xml"s} } for: { { xml, output.xml }, { junit, output-junit.xml } } -== -{ { xml, output.xml }, { junit, output-junit.xml } } -CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "-r", "xml::output.xml", "-r", "console" }) for: {?} -CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_ReporterAndFile{ {"xml", "output.xml"s}, {"console", {}} } for: { { xml, output.xml }, { console, <default-output> } } -== -{ { xml, output.xml }, { console, <default-output> } } +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "console", "C:\\Temp\\out.txt"s, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "junit::out=output-junit.xml" }) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "xml", "output.xml"s, {}, {} }, { "junit", "output-junit.xml"s, {}, {} } } for: { {?}, {?} } == { {?}, {?} } +CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "console" }) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "xml", "output.xml"s, {}, {} }, { "console", {}, {}, {} } } for: { {?}, {?} } == { {?}, {?} } CmdLine.tests.cpp:<line number>: passed: !result for: true CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), ContainsSubstring("Only one reporter may have unspecified output file.") for: "Only one reporter may have unspecified output file." contains: "Only one reporter may have unspecified output file." CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "-b"}) for: {?} diff --git a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt index b46512ed..2b8e2731 100644 --- a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt @@ -1314,10 +1314,8 @@ CmdLine.tests.cpp:<line number>: passed: config.abortAfter == -1 for: -1 == -1 CmdLine.tests.cpp:<line number>: passed: config.noThrow == false for: false == false CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications.empty() for: true CmdLine.tests.cpp:<line number>: passed: !(cfg.hasTestFilters()) for: !false -CmdLine.tests.cpp:<line number>: passed: cfg.getReportersAndOutputFiles().size() == 1 for: 1 == 1 -CmdLine.tests.cpp:<line number>: passed: cfg.getReportersAndOutputFiles()[0] == Catch::ConfigData::ReporterAndFile{ expectedReporter, {} } for: { console, <default-output> } -== -{ console, <default-output> } +CmdLine.tests.cpp:<line number>: passed: cfg.getReporterSpecs().size() == 1 for: 1 == 1 +CmdLine.tests.cpp:<line number>: passed: cfg.getReporterSpecs()[0] == Catch::ReporterSpec{ expectedReporter, {}, {}, {} } for: {?} == {?} CmdLine.tests.cpp:<line number>: passed: result for: {?} CmdLine.tests.cpp:<line number>: passed: cfg.hasTestFilters() for: true CmdLine.tests.cpp:<line number>: passed: cfg.testSpec().matches(*fakeTestCase("notIncluded")) == false for: false == false @@ -1331,37 +1329,21 @@ CmdLine.tests.cpp:<line number>: passed: cfg.hasTestFilters() for: true CmdLine.tests.cpp:<line number>: passed: cfg.testSpec().matches(*fakeTestCase("test1")) == false for: false == false CmdLine.tests.cpp:<line number>: passed: cfg.testSpec().matches(*fakeTestCase("alwaysIncluded")) for: true CmdLine.tests.cpp:<line number>: passed: result for: {?} with 1 message: 'result.errorMessage() := ""' -CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_ReporterAndFile{ {"console", {}} } for: { { console, <default-output> } } -== -{ { console, <default-output> } } with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "console", {}, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' CmdLine.tests.cpp:<line number>: passed: result for: {?} with 1 message: 'result.errorMessage() := ""' -CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_ReporterAndFile{ {"xml", {}} } for: { { xml, <default-output> } } -== -{ { xml, <default-output> } } with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "xml", {}, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' CmdLine.tests.cpp:<line number>: passed: result for: {?} with 1 message: 'result.errorMessage() := ""' -CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_ReporterAndFile{ {"junit", {}} } for: { { junit, <default-output> } } -== -{ { junit, <default-output> } } with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "junit", {}, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' CmdLine.tests.cpp:<line number>: passed: !result for: true CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), ContainsSubstring("Unrecognized reporter") for: "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" contains: "Unrecognized reporter" CmdLine.tests.cpp:<line number>: passed: result for: {?} with 1 message: 'result.errorMessage() := ""' -CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_ReporterAndFile{ {"console", "out.txt"s} } for: { { console, out.txt } } -== -{ { console, out.txt } } with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "console", "out.txt"s, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' CmdLine.tests.cpp:<line number>: passed: result for: {?} with 1 message: 'result.errorMessage() := ""' -CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_ReporterAndFile{ {"console", "C:\\Temp\\out.txt"s} } for: { { console, C:\Temp\out.txt } } -== -{ { console, C:\Temp\out.txt } } with 1 message: 'result.errorMessage() := ""' -CmdLine.tests.cpp:<line number>: passed: !result for: true -CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), ContainsSubstring("empty filename") for: "Reporter 'console' has empty filename specified as its output. Supply a filename or remove the colons to use the default output." contains: "empty filename" -CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "-r", "xml::output.xml", "-r", "junit::output-junit.xml" }) for: {?} -CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_ReporterAndFile{ {"xml", "output.xml"s}, {"junit", "output-junit.xml"s} } for: { { xml, output.xml }, { junit, output-junit.xml } } -== -{ { xml, output.xml }, { junit, output-junit.xml } } -CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "-r", "xml::output.xml", "-r", "console" }) for: {?} -CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_ReporterAndFile{ {"xml", "output.xml"s}, {"console", {}} } for: { { xml, output.xml }, { console, <default-output> } } -== -{ { xml, output.xml }, { console, <default-output> } } +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "console", "C:\\Temp\\out.txt"s, {}, {} } } for: { {?} } == { {?} } with 1 message: 'result.errorMessage() := ""' +CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "junit::out=output-junit.xml" }) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "xml", "output.xml"s, {}, {} }, { "junit", "output-junit.xml"s, {}, {} } } for: { {?}, {?} } == { {?}, {?} } +CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "console" }) for: {?} +CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == vec_Specs{ { "xml", "output.xml"s, {}, {} }, { "console", {}, {}, {} } } for: { {?}, {?} } == { {?}, {?} } CmdLine.tests.cpp:<line number>: passed: !result for: true CmdLine.tests.cpp:<line number>: passed: result.errorMessage(), ContainsSubstring("Only one reporter may have unspecified output file.") for: "Only one reporter may have unspecified output file." contains: "Only one reporter may have unspecified output file." CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "-b"}) for: {?} diff --git a/tests/SelfTest/Baselines/console.std.approved.txt b/tests/SelfTest/Baselines/console.std.approved.txt index a6847cdf..568a71e2 100644 --- a/tests/SelfTest/Baselines/console.std.approved.txt +++ b/tests/SelfTest/Baselines/console.std.approved.txt @@ -1396,5 +1396,5 @@ due to unexpected exception with message: =============================================================================== test cases: 390 | 314 passed | 69 failed | 7 failed as expected -assertions: 2225 | 2070 passed | 128 failed | 27 failed as expected +assertions: 2223 | 2068 passed | 128 failed | 27 failed as expected diff --git a/tests/SelfTest/Baselines/console.sw.approved.txt b/tests/SelfTest/Baselines/console.sw.approved.txt index 3091da60..4ae9ebcc 100644 --- a/tests/SelfTest/Baselines/console.sw.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.approved.txt @@ -9433,16 +9433,14 @@ with expansion: !false CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cfg.getReportersAndOutputFiles().size() == 1 ) + CHECK( cfg.getReporterSpecs().size() == 1 ) with expansion: 1 == 1 CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cfg.getReportersAndOutputFiles()[0] == Catch::ConfigData::ReporterAndFile{ expectedReporter, {} } ) + CHECK( cfg.getReporterSpecs()[0] == Catch::ReporterSpec{ expectedReporter, {}, {}, {} } ) with expansion: - { console, <default-output> } - == - { console, <default-output> } + {?} == {?} ------------------------------------------------------------------------------- Process can be configured on command line @@ -9544,11 +9542,9 @@ with message: result.errorMessage() := "" CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.reporterSpecifications == vec_ReporterAndFile{ {"console", {}} } ) + REQUIRE( config.reporterSpecifications == vec_Specs{ { "console", {}, {}, {} } } ) with expansion: - { { console, <default-output> } } - == - { { console, <default-output> } } + { {?} } == { {?} } with message: result.errorMessage() := "" @@ -9568,11 +9564,9 @@ with message: result.errorMessage() := "" CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.reporterSpecifications == vec_ReporterAndFile{ {"xml", {}} } ) + REQUIRE( config.reporterSpecifications == vec_Specs{ { "xml", {}, {}, {} } } ) with expansion: - { { xml, <default-output> } } - == - { { xml, <default-output> } } + { {?} } == { {?} } with message: result.errorMessage() := "" @@ -9592,11 +9586,9 @@ with message: result.errorMessage() := "" CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.reporterSpecifications == vec_ReporterAndFile{ {"junit", {}} } ) + REQUIRE( config.reporterSpecifications == vec_Specs{ { "junit", {}, {}, {} } } ) with expansion: - { { junit, <default-output> } } - == - { { junit, <default-output> } } + { {?} } == { {?} } with message: result.errorMessage() := "" @@ -9635,11 +9627,9 @@ with message: result.errorMessage() := "" CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.reporterSpecifications == vec_ReporterAndFile{ {"console", "out.txt"s} } ) + REQUIRE( config.reporterSpecifications == vec_Specs{ { "console", "out.txt"s, {}, {} } } ) with expansion: - { { console, out.txt } } - == - { { console, out.txt } } + { {?} } == { {?} } with message: result.errorMessage() := "" @@ -9659,37 +9649,15 @@ with message: result.errorMessage() := "" CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.reporterSpecifications == vec_ReporterAndFile{ {"console", "C:\\Temp\\out.txt"s} } ) + REQUIRE( config.reporterSpecifications == vec_Specs{ { "console", "C:\\Temp\\out.txt"s, {}, {} } } ) with expansion: - { { console, C:\Temp\out.txt } } - == - { { console, C:\Temp\out.txt } } + { {?} } == { {?} } with message: result.errorMessage() := "" ------------------------------------------------------------------------------- Process can be configured on command line reporter - Output file cannot be empty -------------------------------------------------------------------------------- -CmdLine.tests.cpp:<line number> -............................................................................... - -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( !result ) -with expansion: - true - -CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( result.errorMessage(), ContainsSubstring("empty filename") ) -with expansion: - "Reporter 'console' has empty filename specified as its output. Supply a - filename or remove the colons to use the default output." contains: "empty - filename" - -------------------------------------------------------------------------------- -Process can be configured on command line - reporter Multiple reporters All with output files ------------------------------------------------------------------------------- @@ -9697,16 +9665,14 @@ CmdLine.tests.cpp:<line number> ............................................................................... CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({ "test", "-r", "xml::output.xml", "-r", "junit::output-junit.xml" }) ) + CHECK( cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "junit::out=output-junit.xml" }) ) with expansion: {?} CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.reporterSpecifications == vec_ReporterAndFile{ {"xml", "output.xml"s}, {"junit", "output-junit.xml"s} } ) + REQUIRE( config.reporterSpecifications == vec_Specs{ { "xml", "output.xml"s, {}, {} }, { "junit", "output-junit.xml"s, {}, {} } } ) with expansion: - { { xml, output.xml }, { junit, output-junit.xml } } - == - { { xml, output.xml }, { junit, output-junit.xml } } + { {?}, {?} } == { {?}, {?} } ------------------------------------------------------------------------------- Process can be configured on command line @@ -9718,16 +9684,14 @@ CmdLine.tests.cpp:<line number> ............................................................................... CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cli.parse({ "test", "-r", "xml::output.xml", "-r", "console" }) ) + CHECK( cli.parse({ "test", "-r", "xml::out=output.xml", "-r", "console" }) ) with expansion: {?} CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.reporterSpecifications == vec_ReporterAndFile{ {"xml", "output.xml"s}, {"console", {}} } ) + REQUIRE( config.reporterSpecifications == vec_Specs{ { "xml", "output.xml"s, {}, {} }, { "console", {}, {}, {} } } ) with expansion: - { { xml, output.xml }, { console, <default-output> } } - == - { { xml, output.xml }, { console, <default-output> } } + { {?}, {?} } == { {?}, {?} } ------------------------------------------------------------------------------- Process can be configured on command line @@ -17953,5 +17917,5 @@ Misc.tests.cpp:<line number>: PASSED: =============================================================================== test cases: 390 | 300 passed | 83 failed | 7 failed as expected -assertions: 2240 | 2070 passed | 143 failed | 27 failed as expected +assertions: 2238 | 2068 passed | 143 failed | 27 failed as expected diff --git a/tests/SelfTest/Baselines/console.sw.multi.approved.txt b/tests/SelfTest/Baselines/console.sw.multi.approved.txt index 3847cfc9..356457f3 100644 --- a/tests/SelfTest/Baselines/console.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.multi.approved.txt @@ -9431,16 +9431,14 @@ with expansion: !false CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cfg.getReportersAndOutputFiles().size() == 1 ) + CHECK( cfg.getReporterSpecs().size() == 1 ) with expansion: 1 == 1 CmdLine.tests.cpp:<line number>: PASSED: - CHECK( cfg.getReportersAndOutputFiles()[0] == Catch::ConfigData::ReporterAndFile{ expectedReporter, {} } ) + CHECK( cfg.getReporterSpecs()[0] == Catch::ReporterSpec{ expectedReporter, {}, {}, {} } ) with expansion: - { console, <default-output> } - == - { console, <default-output> } + {?} == {?} ------------------------------------------------------------------------------- Process can be configured on command line @@ -9542,11 +9540,9 @@ with message: result.errorMessage() := "" CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.reporterSpecifications == vec_ReporterAndFile{ {"console", {}} } ) + REQUIRE( config.reporterSpecifications == vec_Specs{ { "console", {}, {}, {} } } ) with expansion: - { { console, <default-output> } } - == - { { console, <default-output> } } + { {?} } == { {?} } with message: result.errorMessage() := "" @@ -9566,11 +9562,9 @@ with message: result.errorMessage() := "" CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.reporterSpecifications == vec_ReporterAndFile{ {"xml", {}} } ) + REQUIRE( config.reporterSpecifications == vec_Specs{ { "xml", {}, {}, {} } } ) with expansion: - { { xml, <default-output> } } - == - { { xml, <default-output> } } + { {?} } == { {?} } with message: result.errorMessage() := "" @@ -9590,11 +9584,9 @@ with message: result.errorMessage() := "" CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.reporterSpecifications == vec_ReporterAndFile{ {"junit", {}} } ) + REQUIRE( config.reporterSpecifications == vec_Specs{ { "junit", {}, {}, {} } } ) with expansion: - { { junit, <default-output> } } - == - { { junit, <default-output> } } + { {?} } == { {?} } with message: result.errorMessage() := "" @@ -9633,11 +9625,9 @@ with message: result.errorMessage() := "" CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.reporterSpecifications == vec_ReporterAndFile{ {"console", "out.txt"s} } ) + REQUIRE( config.reporterSpecifications == vec_Specs{ { "console", "out.txt"s, {}, {} } } ) with expansion: - { { console, out.txt } } - == - { { console, out.txt } } + { {?} } == { {?} } with message: result.errorMessage() := "" @@ -9657,37 +9647,15 @@ with message: result.errorMessage() := "" CmdLine.tests.cpp:<line number>: PASSED: - REQUIRE( config.reporterSpecifications == vec_ReporterAndFile{ {"console", "C:\\Temp\\out.txt"s} } ) + REQUIRE( config.reporterSpecifications == vec_Specs{ { "console", "C:\\Temp\\out.txt"s, {}, {} } } ) with expansion: - { { console, C:\Temp\out.txt } } - == - { { console, C:\Temp\out.txt } } + { {?} } == { {?} } with message: result.errorMessage() := "" ------------------------------------------------------------------------------- Process can be configured on command line reporter - Output file cannot be empty -------------------------------------------------------------------------------- -CmdLine.tests.cpp:<line number> -............................................................................... - -CmdLine.tests.cpp:<line number>: PASSED: - CHECK( !result ) -with expansion: < |