mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 07:16:10 +01:00
Move Automake reporter to a cpp file
This commit is contained in:
parent
338572a4f7
commit
e6ea53ab49
@ -9,4 +9,22 @@ namespace Catch {
|
|||||||
|
|
||||||
AutomakeReporter::~AutomakeReporter() {}
|
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
|
} // end namespace Catch
|
||||||
|
@ -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
|
* 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)
|
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
*/
|
*/
|
||||||
@ -20,30 +17,17 @@ namespace Catch {
|
|||||||
~AutomakeReporter() override;
|
~AutomakeReporter() override;
|
||||||
|
|
||||||
static std::string getDescription() {
|
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 {}
|
void assertionStarting( AssertionInfo const& ) override {}
|
||||||
|
|
||||||
bool assertionEnded( AssertionStats const& /*_assertionStats*/ ) override { return true; }
|
bool assertionEnded( AssertionStats const& /*_assertionStats*/ ) override { return true; }
|
||||||
|
|
||||||
void testCaseEnded( TestCaseStats const& _testCaseStats ) override {
|
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 skipTest( TestCaseInfo const& testInfo ) override {
|
void skipTest(TestCaseInfo const& testInfo) override;
|
||||||
stream << ":test-result: SKIP " << testInfo.name << '\n';
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user