diff options
| author | Martin Hořeňovský | 2020-02-07 10:47:18 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2020-02-07 11:26:30 +0100 |
| commit | e6ea53ab494142cabc9c1f04d6517d57ae3b8f33 (patch) | |
| tree | 5b3662e760419b93894bd827ae7a73bb89a65c47 /src/catch2 | |
| parent | 338572a4f72d1c2791157b12a77d6e04ab3646ce (diff) | |
| download | catch3-e6ea53ab494142cabc9c1f04d6517d57ae3b8f33.tar.gz | |
Move Automake reporter to a cpp file
Diffstat (limited to 'src/catch2')
| -rw-r--r-- | src/catch2/reporters/catch_reporter_automake.cpp | 18 | ||||
| -rw-r--r-- | src/catch2/reporters/catch_reporter_automake.hpp | 24 |
2 files changed, 22 insertions, 20 deletions
diff --git a/src/catch2/reporters/catch_reporter_automake.cpp b/src/catch2/reporters/catch_reporter_automake.cpp index b8c3f39a..73cdf552 100644 --- a/src/catch2/reporters/catch_reporter_automake.cpp +++ b/src/catch2/reporters/catch_reporter_automake.cpp @@ -9,4 +9,22 @@ namespace Catch { AutomakeReporter::~AutomakeReporter() {} + void AutomakeReporter::testCaseEnded(TestCaseStats const& _testCaseStats) { + // Possible values to emit are PASS, XFAIL, SKIP, FAIL, XPASS and ERROR. + stream << ":test-result: "; + if (_testCaseStats.totals.assertions.allPassed()) { + stream << "PASS"; + } else if (_testCaseStats.totals.assertions.allOk()) { + stream << "XFAIL"; + } else { + stream << "FAIL"; + } + stream << ' ' << _testCaseStats.testInfo->name << '\n'; + StreamingReporterBase::testCaseEnded(_testCaseStats); + } + + void AutomakeReporter::skipTest(TestCaseInfo const& testInfo) { + stream << ":test-result: SKIP " << testInfo.name << '\n'; + } + } // end namespace Catch diff --git a/src/catch2/reporters/catch_reporter_automake.hpp b/src/catch2/reporters/catch_reporter_automake.hpp index d4ba82b7..2d1066ed 100644 --- a/src/catch2/reporters/catch_reporter_automake.hpp +++ b/src/catch2/reporters/catch_reporter_automake.hpp @@ -1,7 +1,4 @@ /* - * Created by Justin R. Wilson on 2/19/2017. - * Copyright 2017 Justin R. Wilson. All rights reserved. - * * Distributed under the Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ @@ -20,30 +17,17 @@ namespace Catch { ~AutomakeReporter() override; static std::string getDescription() { - return "Reports test results in the format of Automake .trs files"; + using namespace std::string_literals; + return "Reports test results in the format of Automake .trs files"s; } void assertionStarting( AssertionInfo const& ) override {} bool assertionEnded( AssertionStats const& /*_assertionStats*/ ) override { return true; } - void testCaseEnded( TestCaseStats const& _testCaseStats ) override { - // Possible values to emit are PASS, XFAIL, SKIP, FAIL, XPASS and ERROR. - stream << ":test-result: "; - if (_testCaseStats.totals.assertions.allPassed()) { - stream << "PASS"; - } else if (_testCaseStats.totals.assertions.allOk()) { - stream << "XFAIL"; - } else { - stream << "FAIL"; - } - stream << ' ' << _testCaseStats.testInfo->name << '\n'; - StreamingReporterBase::testCaseEnded( _testCaseStats ); - } + void testCaseEnded(TestCaseStats const& _testCaseStats) override; - void skipTest( TestCaseInfo const& testInfo ) override { - stream << ":test-result: SKIP " << testInfo.name << '\n'; - } + void skipTest(TestCaseInfo const& testInfo) override; }; |