mirror of
https://github.com/catchorg/Catch2.git
synced 2024-12-23 11:43:29 +01:00
71df66365e
All C++11 toggles are now removed. What is left is either platform specific (POSIX_SIGNALS, WINDOWS_SEH), or possibly still needed (USE_COUNTER). If current CLion is compatible with `__COUNTER__`, then we should also force `__COUNTER__` usage. Changed * CATCH_AUTO_PTR -> std::unique_ptr * CATCH_OVERRIDE -> override * CATCH_NULL -> nullptr * CATCH_NOEXCEPT -> noexcept * CATCH_NOEXCEPT_IS -> noexcept Removed * CATCH_CONFIG_CPP11_UNIQUE_PTR * CATCH_CONFIG_CPP11_SHUFFLE * CATCH_CONFIG_CPP11_TYPE_TRAITS * CATCH_CONFIG_CPP11_OVERRIDE * CATCH_CONFIG_CPP11_LONG_LONG * CATCH_CONFIG_CPP11_TUPLE * CATCH_CONFIG_CPP11_IS_ENUM * CATCH_CONFIG_CPP11_GENERATED_METHODS * CATCH_CONFIG_CPP11_NOEXCEPT * CATCH_CONFIG_CPP11_NULLPTR * CATCH_CONFIG_VARIADIC_MACROS
63 lines
2.2 KiB
C++
63 lines
2.2 KiB
C++
/*
|
|
* 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)
|
|
*/
|
|
#ifndef TWOBLUECUBES_CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED
|
|
#define TWOBLUECUBES_CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED
|
|
|
|
// Don't #include any Catch headers here - we can assume they are already
|
|
// included before this header.
|
|
// This is not good practice in general but is necessary in this case so this
|
|
// file can be distributed as a single header that works with the main
|
|
// Catch single header.
|
|
|
|
namespace Catch {
|
|
|
|
struct AutomakeReporter : StreamingReporterBase {
|
|
AutomakeReporter( ReporterConfig const& _config )
|
|
: StreamingReporterBase( _config )
|
|
{}
|
|
|
|
virtual ~AutomakeReporter();
|
|
|
|
static std::string getDescription() {
|
|
return "Reports test results in the format of Automake .trs files";
|
|
}
|
|
|
|
virtual void assertionStarting( AssertionInfo const& ) override {}
|
|
|
|
virtual bool assertionEnded( AssertionStats const& /*_assertionStats*/ ) override { return true; }
|
|
|
|
virtual 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 );
|
|
}
|
|
|
|
virtual void skipTest( TestCaseInfo const& testInfo ) override {
|
|
stream << ":test-result: SKIP " << testInfo.name << '\n';
|
|
}
|
|
|
|
};
|
|
|
|
#ifdef CATCH_IMPL
|
|
AutomakeReporter::~AutomakeReporter() {}
|
|
#endif
|
|
|
|
INTERNAL_CATCH_REGISTER_REPORTER( "automake", AutomakeReporter)
|
|
|
|
} // end namespace Catch
|
|
|
|
#endif // TWOBLUECUBES_CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED
|