mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21:36:11 +01:00
Merge pull request #2163 from catchorg/devel-list-outputs-to-out-flag
The output of --list-* flags obeys -o flag
This commit is contained in:
commit
b435e391c4
@ -48,7 +48,7 @@ namespace Catch {
|
||||
// doesn't compile without a std::move call. However, this causes
|
||||
// a warning on newer platforms. Thus, we have to work around
|
||||
// it a bit and downcast the pointer manually.
|
||||
auto ret = Detail::unique_ptr<IStreamingReporter>(new ListeningReporter);
|
||||
auto ret = Detail::unique_ptr<IStreamingReporter>(new ListeningReporter(config));
|
||||
auto& multi = static_cast<ListeningReporter&>(*ret);
|
||||
auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners();
|
||||
for (auto const& listener : listeners) {
|
||||
|
@ -11,34 +11,15 @@
|
||||
#include <catch2/internal/catch_console_width.hpp>
|
||||
#include <catch2/catch_message.hpp>
|
||||
#include <catch2/internal/catch_list.hpp>
|
||||
#include <catch2/internal/catch_textflow.hpp>
|
||||
#include <catch2/internal/catch_string_manip.hpp>
|
||||
#include <catch2/catch_test_case_info.hpp>
|
||||
#include <catch2/internal/catch_textflow.hpp>
|
||||
#include <catch2/reporters/catch_reporter_helpers.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <iomanip>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
namespace {
|
||||
void listTestNamesOnly( std::vector<TestCaseHandle> const& tests ) {
|
||||
for ( auto const& test : tests ) {
|
||||
auto const& testCaseInfo = test.getTestCaseInfo();
|
||||
|
||||
if ( startsWith( testCaseInfo.name, '#' ) ) {
|
||||
Catch::cout() << '"' << testCaseInfo.name << '"';
|
||||
} else {
|
||||
Catch::cout() << testCaseInfo.name;
|
||||
}
|
||||
|
||||
Catch::cout() << '\n';
|
||||
}
|
||||
Catch::cout() << std::flush;
|
||||
}
|
||||
} // end unnamed namespace
|
||||
|
||||
|
||||
ReporterConfig::ReporterConfig( IConfig const* _fullConfig )
|
||||
: m_stream( &_fullConfig->stream() ), m_fullConfig( _fullConfig ) {}
|
||||
|
||||
@ -127,89 +108,4 @@ namespace Catch {
|
||||
|
||||
void IStreamingReporter::fatalErrorEncountered( StringRef ) {}
|
||||
|
||||
void IStreamingReporter::listReporters(std::vector<ReporterDescription> const& descriptions, IConfig const& config) {
|
||||
Catch::cout() << "Available reporters:\n";
|
||||
const auto maxNameLen = std::max_element(descriptions.begin(), descriptions.end(),
|
||||
[](ReporterDescription const& lhs, ReporterDescription const& rhs) { return lhs.name.size() < rhs.name.size(); })
|
||||
->name.size();
|
||||
|
||||
for (auto const& desc : descriptions) {
|
||||
if (config.verbosity() == Verbosity::Quiet) {
|
||||
Catch::cout()
|
||||
<< TextFlow::Column(desc.name)
|
||||
.indent(2)
|
||||
.width(5 + maxNameLen) << '\n';
|
||||
} else {
|
||||
Catch::cout()
|
||||
<< TextFlow::Column(desc.name + ":")
|
||||
.indent(2)
|
||||
.width(5 + maxNameLen)
|
||||
+ TextFlow::Column(desc.description)
|
||||
.initialIndent(0)
|
||||
.indent(2)
|
||||
.width(CATCH_CONFIG_CONSOLE_WIDTH - maxNameLen - 8)
|
||||
<< '\n';
|
||||
}
|
||||
}
|
||||
Catch::cout() << std::endl;
|
||||
}
|
||||
|
||||
void IStreamingReporter::listTests(std::vector<TestCaseHandle> const& tests, IConfig const& config) {
|
||||
// We special case this to provide the equivalent of old
|
||||
// `--list-test-names-only`, which could then be used by the
|
||||
// `--input-file` option.
|
||||
if (config.verbosity() == Verbosity::Quiet) {
|
||||
listTestNamesOnly(tests);
|
||||
return;
|
||||
}
|
||||
|
||||
if (config.hasTestFilters()) {
|
||||
Catch::cout() << "Matching test cases:\n";
|
||||
} else {
|
||||
Catch::cout() << "All available test cases:\n";
|
||||
}
|
||||
|
||||
for (auto const& test : tests) {
|
||||
auto const& testCaseInfo = test.getTestCaseInfo();
|
||||
Colour::Code colour = testCaseInfo.isHidden()
|
||||
? Colour::SecondaryText
|
||||
: Colour::None;
|
||||
Colour colourGuard(colour);
|
||||
|
||||
Catch::cout() << TextFlow::Column(testCaseInfo.name).initialIndent(2).indent(4) << '\n';
|
||||
if (config.verbosity() >= Verbosity::High) {
|
||||
Catch::cout() << TextFlow::Column(Catch::Detail::stringify(testCaseInfo.lineInfo)).indent(4) << std::endl;
|
||||
}
|
||||
if (!testCaseInfo.tags.empty() && config.verbosity() > Verbosity::Quiet) {
|
||||
Catch::cout() << TextFlow::Column(testCaseInfo.tagsAsString()).indent(6) << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
if (!config.hasTestFilters()) {
|
||||
Catch::cout() << pluralise(tests.size(), "test case") << '\n' << std::endl;
|
||||
} else {
|
||||
Catch::cout() << pluralise(tests.size(), "matching test case") << '\n' << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void IStreamingReporter::listTags(std::vector<TagInfo> const& tags, IConfig const& config) {
|
||||
if (config.hasTestFilters()) {
|
||||
Catch::cout() << "Tags for matching test cases:\n";
|
||||
} else {
|
||||
Catch::cout() << "All available tags:\n";
|
||||
}
|
||||
|
||||
for (auto const& tagCount : tags) {
|
||||
ReusableStringStream rss;
|
||||
rss << " " << std::setw(2) << tagCount.count << " ";
|
||||
auto str = rss.str();
|
||||
auto wrapper = TextFlow::Column(tagCount.all())
|
||||
.initialIndent(0)
|
||||
.indent(str.size())
|
||||
.width(CATCH_CONFIG_CONSOLE_WIDTH - 10);
|
||||
Catch::cout() << str << wrapper << '\n';
|
||||
}
|
||||
Catch::cout() << pluralise(tags.size(), "tag") << '\n' << std::endl;
|
||||
}
|
||||
|
||||
} // end namespace Catch
|
||||
|
@ -176,7 +176,12 @@ namespace Catch {
|
||||
protected:
|
||||
//! Derived classes can set up their preferences here
|
||||
ReporterPreferences m_preferences;
|
||||
//! The test run's config as filled in from CLI and defaults
|
||||
IConfig const* m_config;
|
||||
|
||||
public:
|
||||
IStreamingReporter( IConfig const* config ): m_config( config ) {}
|
||||
|
||||
virtual ~IStreamingReporter() = default;
|
||||
|
||||
// Implementing class must also provide the following static methods:
|
||||
@ -217,11 +222,11 @@ namespace Catch {
|
||||
virtual void fatalErrorEncountered( StringRef name );
|
||||
|
||||
//! Writes out information about provided reporters using reporter-specific format
|
||||
virtual void listReporters(std::vector<ReporterDescription> const& descriptions, IConfig const& config);
|
||||
virtual void listReporters(std::vector<ReporterDescription> const& descriptions) = 0;
|
||||
//! Writes out information about provided tests using reporter-specific format
|
||||
virtual void listTests(std::vector<TestCaseHandle> const& tests, IConfig const& config);
|
||||
virtual void listTests(std::vector<TestCaseHandle> const& tests) = 0;
|
||||
//! Writes out information about the provided tags using reporter-specific format
|
||||
virtual void listTags(std::vector<TagInfo> const& tags, IConfig const& config);
|
||||
virtual void listTags(std::vector<TagInfo> const& tags) = 0;
|
||||
|
||||
};
|
||||
using IStreamingReporterPtr = Detail::unique_ptr<IStreamingReporter>;
|
||||
|
@ -24,7 +24,7 @@ namespace Catch {
|
||||
void listTests(IStreamingReporter& reporter, IConfig const& config) {
|
||||
auto const& testSpec = config.testSpec();
|
||||
auto matchedTestCases = filterTests(getAllTestCasesSorted(config), testSpec, config);
|
||||
reporter.listTests(matchedTestCases, config);
|
||||
reporter.listTests(matchedTestCases);
|
||||
}
|
||||
|
||||
void listTags(IStreamingReporter& reporter, IConfig const& config) {
|
||||
@ -46,10 +46,10 @@ namespace Catch {
|
||||
infos.push_back(std::move(tagc.second));
|
||||
}
|
||||
|
||||
reporter.listTags(infos, config);
|
||||
reporter.listTags(infos);
|
||||
}
|
||||
|
||||
void listReporters(IStreamingReporter& reporter, IConfig const& config) {
|
||||
void listReporters(IStreamingReporter& reporter) {
|
||||
std::vector<ReporterDescription> descriptions;
|
||||
|
||||
IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories();
|
||||
@ -58,7 +58,7 @@ namespace Catch {
|
||||
descriptions.push_back({ fac.first, fac.second->getDescription() });
|
||||
}
|
||||
|
||||
reporter.listReporters(descriptions, config);
|
||||
reporter.listReporters(descriptions);
|
||||
}
|
||||
|
||||
} // end anonymous namespace
|
||||
@ -96,7 +96,7 @@ namespace Catch {
|
||||
}
|
||||
if (config.listReporters()) {
|
||||
listed = true;
|
||||
listReporters(reporter, config);
|
||||
listReporters(reporter);
|
||||
}
|
||||
return listed;
|
||||
}
|
||||
|
@ -21,13 +21,40 @@
|
||||
#include <catch2/interfaces/catch_interfaces_config.hpp>
|
||||
#include <catch2/internal/catch_console_width.hpp>
|
||||
#include <catch2/internal/catch_errno_guard.hpp>
|
||||
#include <catch2/internal/catch_textflow.hpp>
|
||||
#include <catch2/internal/catch_stream.hpp>
|
||||
#include <catch2/internal/catch_string_manip.hpp>
|
||||
#include <catch2/internal/catch_console_colour.hpp>
|
||||
#include <catch2/catch_tostring.hpp>
|
||||
#include <catch2/catch_test_case_info.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cfloat>
|
||||
#include <cstdio>
|
||||
#include <ostream>
|
||||
#include <iomanip>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
namespace {
|
||||
void listTestNamesOnly(std::ostream& out,
|
||||
std::vector<TestCaseHandle> const& tests) {
|
||||
for (auto const& test : tests) {
|
||||
auto const& testCaseInfo = test.getTestCaseInfo();
|
||||
|
||||
if (startsWith(testCaseInfo.name, '#')) {
|
||||
out << '"' << testCaseInfo.name << '"';
|
||||
} else {
|
||||
out << testCaseInfo.name;
|
||||
}
|
||||
|
||||
out << '\n';
|
||||
}
|
||||
out << std::flush;
|
||||
}
|
||||
} // end unnamed namespace
|
||||
|
||||
|
||||
// Because formatting using c++ streams is stateful, drop down to C is
|
||||
// required Alternatively we could use stringstream, but its performance
|
||||
// is... not good.
|
||||
@ -89,6 +116,101 @@ namespace Catch {
|
||||
return out;
|
||||
}
|
||||
|
||||
void
|
||||
defaultListReporters( std::ostream& out,
|
||||
std::vector<ReporterDescription> const& descriptions,
|
||||
Verbosity verbosity ) {
|
||||
out << "Available reporters:\n";
|
||||
const auto maxNameLen =
|
||||
std::max_element( descriptions.begin(),
|
||||
descriptions.end(),
|
||||
[]( ReporterDescription const& lhs,
|
||||
ReporterDescription const& rhs ) {
|
||||
return lhs.name.size() < rhs.name.size();
|
||||
} )
|
||||
->name.size();
|
||||
|
||||
for ( auto const& desc : descriptions ) {
|
||||
if ( verbosity == Verbosity::Quiet ) {
|
||||
out << TextFlow::Column( desc.name )
|
||||
.indent( 2 )
|
||||
.width( 5 + maxNameLen )
|
||||
<< '\n';
|
||||
} else {
|
||||
out << TextFlow::Column( desc.name + ":" )
|
||||
.indent( 2 )
|
||||
.width( 5 + maxNameLen ) +
|
||||
TextFlow::Column( desc.description )
|
||||
.initialIndent( 0 )
|
||||
.indent( 2 )
|
||||
.width( CATCH_CONFIG_CONSOLE_WIDTH - maxNameLen - 8 )
|
||||
<< '\n';
|
||||
}
|
||||
}
|
||||
out << '\n' << std::flush;
|
||||
}
|
||||
|
||||
void defaultListTags( std::ostream& out,
|
||||
std::vector<TagInfo> const& tags,
|
||||
bool isFiltered ) {
|
||||
if ( isFiltered ) {
|
||||
out << "Tags for matching test cases:\n";
|
||||
} else {
|
||||
out << "All available tags:\n";
|
||||
}
|
||||
|
||||
for ( auto const& tagCount : tags ) {
|
||||
ReusableStringStream rss;
|
||||
rss << " " << std::setw( 2 ) << tagCount.count << " ";
|
||||
auto str = rss.str();
|
||||
auto wrapper = TextFlow::Column( tagCount.all() )
|
||||
.initialIndent( 0 )
|
||||
.indent( str.size() )
|
||||
.width( CATCH_CONFIG_CONSOLE_WIDTH - 10 );
|
||||
out << str << wrapper << '\n';
|
||||
}
|
||||
out << pluralise( tags.size(), "tag" ) << '\n' << std::endl;
|
||||
}
|
||||
|
||||
void defaultListTests(std::ostream& out, std::vector<TestCaseHandle> const& tests, bool isFiltered, Verbosity verbosity) {
|
||||
// We special case this to provide the equivalent of old
|
||||
// `--list-test-names-only`, which could then be used by the
|
||||
// `--input-file` option.
|
||||
if (verbosity == Verbosity::Quiet) {
|
||||
listTestNamesOnly(out, tests);
|
||||
return;
|
||||
}
|
||||
|
||||
if (isFiltered) {
|
||||
out << "Matching test cases:\n";
|
||||
} else {
|
||||
out << "All available test cases:\n";
|
||||
}
|
||||
|
||||
for (auto const& test : tests) {
|
||||
auto const& testCaseInfo = test.getTestCaseInfo();
|
||||
Colour::Code colour = testCaseInfo.isHidden()
|
||||
? Colour::SecondaryText
|
||||
: Colour::None;
|
||||
Colour colourGuard(colour);
|
||||
|
||||
out << TextFlow::Column(testCaseInfo.name).initialIndent(2).indent(4) << '\n';
|
||||
if (verbosity >= Verbosity::High) {
|
||||
out << TextFlow::Column(Catch::Detail::stringify(testCaseInfo.lineInfo)).indent(4) << std::endl;
|
||||
}
|
||||
if (!testCaseInfo.tags.empty() &&
|
||||
verbosity > Verbosity::Quiet) {
|
||||
out << TextFlow::Column(testCaseInfo.tagsAsString()).indent(6) << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
if (isFiltered) {
|
||||
out << pluralise(tests.size(), "matching test case") << '\n' << std::endl;
|
||||
} else {
|
||||
out << pluralise(tests.size(), "test case") << '\n' << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Catch
|
||||
|
||||
|
||||
@ -100,13 +222,10 @@ namespace Catch {
|
||||
bool EventListenerBase::assertionEnded( AssertionStats const& ) {
|
||||
return false;
|
||||
}
|
||||
void
|
||||
EventListenerBase::listReporters( std::vector<ReporterDescription> const&,
|
||||
IConfig const& ) {}
|
||||
void EventListenerBase::listTests( std::vector<TestCaseHandle> const&,
|
||||
IConfig const& ) {}
|
||||
void EventListenerBase::listTags( std::vector<TagInfo> const&,
|
||||
IConfig const& ) {}
|
||||
void EventListenerBase::listReporters(
|
||||
std::vector<ReporterDescription> const& ) {}
|
||||
void EventListenerBase::listTests( std::vector<TestCaseHandle> const& ) {}
|
||||
void EventListenerBase::listTags( std::vector<TagInfo> const& ) {}
|
||||
void EventListenerBase::noMatchingTestCases( std::string const& ) {}
|
||||
void EventListenerBase::testRunStarting( TestRunInfo const& ) {}
|
||||
void EventListenerBase::testGroupStarting( GroupInfo const& ) {}
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
#include <catch2/reporters/catch_reporter_cumulative_base.hpp>
|
||||
#include <catch2/reporters/catch_reporter_helpers.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
@ -110,4 +111,19 @@ namespace Catch {
|
||||
testRunEndedCumulative();
|
||||
}
|
||||
|
||||
void CumulativeReporterBase::listReporters(std::vector<ReporterDescription> const& descriptions) {
|
||||
defaultListReporters(stream, descriptions, m_config->verbosity());
|
||||
}
|
||||
|
||||
void CumulativeReporterBase::listTests(std::vector<TestCaseHandle> const& tests) {
|
||||
defaultListTests(stream,
|
||||
tests,
|
||||
m_config->hasTestFilters(),
|
||||
m_config->verbosity());
|
||||
}
|
||||
|
||||
void CumulativeReporterBase::listTags(std::vector<TagInfo> const& tags) {
|
||||
defaultListTags( stream, tags, m_config->hasTestFilters() );
|
||||
}
|
||||
|
||||
} // end namespace Catch
|
||||
|
@ -46,7 +46,8 @@ namespace Catch {
|
||||
using TestRunNode = Node<TestRunStats, TestGroupNode>;
|
||||
|
||||
CumulativeReporterBase( ReporterConfig const& _config ):
|
||||
m_config( _config.fullConfig() ), stream( _config.stream() ) {}
|
||||
IStreamingReporter( _config.fullConfig() ),
|
||||
stream( _config.stream() ) {}
|
||||
~CumulativeReporterBase() override;
|
||||
|
||||
void testRunStarting( TestRunInfo const& ) override {}
|
||||
@ -68,7 +69,11 @@ namespace Catch {
|
||||
|
||||
void skipTest(TestCaseInfo const&) override {}
|
||||
|
||||
IConfig const* m_config;
|
||||
void listReporters( std::vector<ReporterDescription> const& descriptions ) override;
|
||||
void listTests( std::vector<TestCaseHandle> const& tests ) override;
|
||||
void listTags( std::vector<TagInfo> const& tags ) override;
|
||||
|
||||
|
||||
std::ostream& stream;
|
||||
// Note: We rely on pointer identity being stable, which is why
|
||||
// which is why we store around pointers rather than values.
|
||||
|
@ -20,22 +20,17 @@ namespace Catch {
|
||||
* member functions it actually cares about.
|
||||
*/
|
||||
class EventListenerBase : public IStreamingReporter {
|
||||
IConfig const* m_config;
|
||||
|
||||
public:
|
||||
EventListenerBase( ReporterConfig const& config ):
|
||||
m_config( config.fullConfig() ) {}
|
||||
IStreamingReporter( config.fullConfig() ) {}
|
||||
|
||||
void assertionStarting( AssertionInfo const& assertionInfo ) override;
|
||||
bool assertionEnded( AssertionStats const& assertionStats ) override;
|
||||
|
||||
void
|
||||
listReporters( std::vector<ReporterDescription> const& descriptions,
|
||||
IConfig const& config ) override;
|
||||
void listTests( std::vector<TestCaseHandle> const& tests,
|
||||
IConfig const& config ) override;
|
||||
void listTags( std::vector<TagInfo> const& tagInfos,
|
||||
IConfig const& config ) override;
|
||||
void listReporters(
|
||||
std::vector<ReporterDescription> const& descriptions ) override;
|
||||
void listTests( std::vector<TestCaseHandle> const& tests ) override;
|
||||
void listTags( std::vector<TagInfo> const& tagInfos ) override;
|
||||
|
||||
void noMatchingTestCases( std::string const& spec ) override;
|
||||
void testRunStarting( TestRunInfo const& testRunInfo ) override;
|
||||
|
@ -12,9 +12,13 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <catch2/internal/catch_list.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_config.hpp>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
struct IConfig;
|
||||
class TestCaseHandle;
|
||||
|
||||
// Returns double formatted as %.3f (format expected on output)
|
||||
std::string getFormattedDuration( double duration );
|
||||
@ -31,6 +35,42 @@ namespace Catch {
|
||||
friend std::ostream& operator<<( std::ostream& out, lineOfChars value );
|
||||
};
|
||||
|
||||
/**
|
||||
* Lists reporter descriptions to the provided stream in user-friendly
|
||||
* format
|
||||
*
|
||||
* Used as the default listing implementation by the first party reporter
|
||||
* bases. The output should be backwards compatible with the output of
|
||||
* Catch2 v2 binaries.
|
||||
*/
|
||||
void
|
||||
defaultListReporters( std::ostream& out,
|
||||
std::vector<ReporterDescription> const& descriptions,
|
||||
Verbosity verbosity );
|
||||
|
||||
/**
|
||||
* Lists tag information to the provided stream in user-friendly format
|
||||
*
|
||||
* Used as the default listing implementation by the first party reporter
|
||||
* bases. The output should be backwards compatible with the output of
|
||||
* Catch2 v2 binaries.
|
||||
*/
|
||||
void defaultListTags( std::ostream& out, std::vector<TagInfo> const& tags, bool isFiltered );
|
||||
|
||||
/**
|
||||
* Lists test case information to the provided stream in user-friendly
|
||||
* format
|
||||
*
|
||||
* Used as the default listing implementation by the first party reporter
|
||||
* bases. The output is backwards compatible with the output of Catch2
|
||||
* v2 binaries, and also supports the format specific to the old
|
||||
* `--list-test-names-only` option, for people who used it in integrations.
|
||||
*/
|
||||
void defaultListTests( std::ostream& out,
|
||||
std::vector<TestCaseHandle> const& tests,
|
||||
bool isFiltered,
|
||||
Verbosity verbosity );
|
||||
|
||||
} // end namespace Catch
|
||||
|
||||
#endif // CATCH_REPORTER_HELPERS_HPP_INCLUDED
|
||||
|
@ -11,11 +11,6 @@
|
||||
|
||||
namespace Catch {
|
||||
|
||||
ListeningReporter::ListeningReporter() {
|
||||
// We will assume that listeners will always want all assertions
|
||||
m_preferences.shouldReportAllAssertions = true;
|
||||
}
|
||||
|
||||
void ListeningReporter::addListener( IStreamingReporterPtr&& listener ) {
|
||||
m_listeners.push_back( std::move( listener ) );
|
||||
}
|
||||
@ -146,25 +141,25 @@ namespace Catch {
|
||||
m_reporter->skipTest( testInfo );
|
||||
}
|
||||
|
||||
void ListeningReporter::listReporters(std::vector<ReporterDescription> const& descriptions, IConfig const& config) {
|
||||
void ListeningReporter::listReporters(std::vector<ReporterDescription> const& descriptions) {
|
||||
for (auto const& listener : m_listeners) {
|
||||
listener->listReporters(descriptions, config);
|
||||
listener->listReporters(descriptions);
|
||||
}
|
||||
m_reporter->listReporters(descriptions, config);
|
||||
m_reporter->listReporters(descriptions);
|
||||
}
|
||||
|
||||
void ListeningReporter::listTests(std::vector<TestCaseHandle> const& tests, IConfig const& config) {
|
||||
void ListeningReporter::listTests(std::vector<TestCaseHandle> const& tests) {
|
||||
for (auto const& listener : m_listeners) {
|
||||
listener->listTests(tests, config);
|
||||
listener->listTests(tests);
|
||||
}
|
||||
m_reporter->listTests(tests, config);
|
||||
m_reporter->listTests(tests);
|
||||
}
|
||||
|
||||
void ListeningReporter::listTags(std::vector<TagInfo> const& tags, IConfig const& config) {
|
||||
void ListeningReporter::listTags(std::vector<TagInfo> const& tags) {
|
||||
for (auto const& listener : m_listeners) {
|
||||
listener->listTags(tags, config);
|
||||
listener->listTags(tags);
|
||||
}
|
||||
m_reporter->listTags(tags, config);
|
||||
m_reporter->listTags(tags);
|
||||
}
|
||||
|
||||
} // end namespace Catch
|
||||
|
@ -18,7 +18,12 @@ namespace Catch {
|
||||
IStreamingReporterPtr m_reporter = nullptr;
|
||||
|
||||
public:
|
||||
ListeningReporter();
|
||||
ListeningReporter( IConfig const* config ):
|
||||
IStreamingReporter( config ) {
|
||||
// We will assume that listeners will always want all assertions
|
||||
m_preferences.shouldReportAllAssertions = true;
|
||||
}
|
||||
|
||||
|
||||
void addListener( IStreamingReporterPtr&& listener );
|
||||
void addReporter( IStreamingReporterPtr&& reporter );
|
||||
@ -49,9 +54,9 @@ namespace Catch {
|
||||
|
||||
void skipTest( TestCaseInfo const& testInfo ) override;
|
||||
|
||||
void listReporters(std::vector<ReporterDescription> const& descriptions, IConfig const& config) override;
|
||||
void listTests(std::vector<TestCaseHandle> const& tests, IConfig const& config) override;
|
||||
void listTags(std::vector<TagInfo> const& tags, IConfig const& config) override;
|
||||
void listReporters(std::vector<ReporterDescription> const& descriptions) override;
|
||||
void listTests(std::vector<TestCaseHandle> const& tests) override;
|
||||
void listTags(std::vector<TagInfo> const& tags) override;
|
||||
|
||||
|
||||
};
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
#include <catch2/reporters/catch_reporter_streaming_base.hpp>
|
||||
#include <catch2/reporters/catch_reporter_helpers.hpp>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
@ -31,4 +32,19 @@ namespace Catch {
|
||||
currentTestRunInfo.reset();
|
||||
}
|
||||
|
||||
void StreamingReporterBase::listReporters(std::vector<ReporterDescription> const& descriptions) {
|
||||
defaultListReporters( stream, descriptions, m_config->verbosity() );
|
||||
}
|
||||
|
||||
void StreamingReporterBase::listTests(std::vector<TestCaseHandle> const& tests) {
|
||||
defaultListTests(stream,
|
||||
tests,
|
||||
m_config->hasTestFilters(),
|
||||
m_config->verbosity());
|
||||
}
|
||||
|
||||
void StreamingReporterBase::listTags(std::vector<TagInfo> const& tags) {
|
||||
defaultListTags( stream, tags, m_config->hasTestFilters() );
|
||||
}
|
||||
|
||||
} // end namespace Catch
|
||||
|
@ -36,8 +36,8 @@ namespace Catch {
|
||||
struct StreamingReporterBase : IStreamingReporter {
|
||||
|
||||
StreamingReporterBase( ReporterConfig const& _config ):
|
||||
m_config( _config.fullConfig() ), stream( _config.stream() ) {
|
||||
}
|
||||
IStreamingReporter( _config.fullConfig() ),
|
||||
stream( _config.stream() ) {}
|
||||
|
||||
|
||||
~StreamingReporterBase() override;
|
||||
@ -71,7 +71,10 @@ namespace Catch {
|
||||
// It can optionally be overridden in the derived class.
|
||||
}
|
||||
|
||||
IConfig const* m_config;
|
||||
void listReporters( std::vector<ReporterDescription> const& descriptions ) override;
|
||||
void listTests( std::vector<TestCaseHandle> const& tests ) override;
|
||||
void listTags( std::vector<TagInfo> const& tags ) override;
|
||||
|
||||
std::ostream& stream;
|
||||
|
||||
LazyStat<TestRunInfo> currentTestRunInfo;
|
||||
|
@ -272,7 +272,7 @@ namespace Catch {
|
||||
m_xml.endElement();
|
||||
}
|
||||
|
||||
void XmlReporter::listReporters(std::vector<ReporterDescription> const& descriptions, IConfig const&) {
|
||||
void XmlReporter::listReporters(std::vector<ReporterDescription> const& descriptions) {
|
||||
auto outerTag = m_xml.scopedElement("AvailableReporters");
|
||||
for (auto const& reporter : descriptions) {
|
||||
auto inner = m_xml.scopedElement("Reporter");
|
||||
@ -285,7 +285,7 @@ namespace Catch {
|
||||
}
|
||||
}
|
||||
|
||||
void XmlReporter::listTests(std::vector<TestCaseHandle> const& tests, IConfig const&) {
|
||||
void XmlReporter::listTests(std::vector<TestCaseHandle> const& tests) {
|
||||
auto outerTag = m_xml.scopedElement("MatchingTests");
|
||||
for (auto const& test : tests) {
|
||||
auto innerTag = m_xml.scopedElement("TestCase");
|
||||
@ -310,7 +310,7 @@ namespace Catch {
|
||||
}
|
||||
}
|
||||
|
||||
void XmlReporter::listTags(std::vector<TagInfo> const& tags, IConfig const&) {
|
||||
void XmlReporter::listTags(std::vector<TagInfo> const& tags) {
|
||||
auto outerTag = m_xml.scopedElement("TagsFromMatchingTests");
|
||||
for (auto const& tag : tags) {
|
||||
auto innerTag = m_xml.scopedElement("Tag");
|
||||
|
@ -56,9 +56,9 @@ namespace Catch {
|
||||
void benchmarkEnded(BenchmarkStats<> const&) override;
|
||||
void benchmarkFailed(std::string const&) override;
|
||||
|
||||
void listReporters(std::vector<ReporterDescription> const& descriptions, IConfig const& config) override;
|
||||
void listTests(std::vector<TestCaseHandle> const& tests, IConfig const& config) override;
|
||||
void listTags(std::vector<TagInfo> const& tags, IConfig const& config) override;
|
||||
void listReporters(std::vector<ReporterDescription> const& descriptions) override;
|
||||
void listTests(std::vector<TestCaseHandle> const& tests) override;
|
||||
void listTags(std::vector<TagInfo> const& tags) override;
|
||||
|
||||
private:
|
||||
Timer m_testCaseTimer;
|
||||
|
@ -23,6 +23,7 @@ set(TEST_SOURCES
|
||||
${SELF_TEST_DIR}/IntrospectiveTests/InternalBenchmark.tests.cpp
|
||||
${SELF_TEST_DIR}/IntrospectiveTests/PartTracker.tests.cpp
|
||||
${SELF_TEST_DIR}/IntrospectiveTests/RandomNumberGeneration.tests.cpp
|
||||
${SELF_TEST_DIR}/IntrospectiveTests/Reporters.tests.cpp
|
||||
${SELF_TEST_DIR}/IntrospectiveTests/Tag.tests.cpp
|
||||
${SELF_TEST_DIR}/IntrospectiveTests/String.tests.cpp
|
||||
${SELF_TEST_DIR}/IntrospectiveTests/StringManip.tests.cpp
|
||||
|
@ -185,6 +185,7 @@ Nor would this
|
||||
:test-result: FAIL Reconstruction should be based on stringification: #914
|
||||
:test-result: FAIL Regex string matcher
|
||||
:test-result: PASS Regression test #1
|
||||
:test-result: PASS Reporter's write listings to provided stream
|
||||
:test-result: PASS SUCCEED counts as a test pass
|
||||
:test-result: PASS SUCCEED does not require an argument
|
||||
:test-result: PASS Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or methods
|
||||
@ -231,6 +232,7 @@ Message from section two
|
||||
:test-result: PASS Test enum bit values
|
||||
:test-result: PASS Test with special, characters "in name
|
||||
:test-result: FAIL The NO_FAIL macro reports a failure but does not fail the test
|
||||
:test-result: PASS The default listing implementation write to provided stream
|
||||
:test-result: FAIL This test 'should' fail but doesn't
|
||||
:test-result: FAIL Thrown string literals are translated
|
||||
:test-result: PASS Tracker
|
||||
|
@ -1273,6 +1273,169 @@ Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches("this
|
||||
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches("contains 'abc' as a substring") for: "this string contains 'abc' as a substring" matches "contains 'abc' as a substring" case sensitively
|
||||
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches("this string contains 'abc' as a") for: "this string contains 'abc' as a substring" matches "this string contains 'abc' as a" case sensitively
|
||||
Matchers.tests.cpp:<line number>: passed: actual, !UnorderedEquals(expected) for: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' }
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains("fakeTag"s) for: "All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "fakeTag" with 1 message: 'Tested reporter: automake'
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains("fake reporter"s) for: "Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter" with 1 message: 'Tested reporter: automake'
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: automake'
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains("fakeTag"s) for: "All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "fakeTag" with 1 message: 'Tested reporter: compact'
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains("fake reporter"s) for: "Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter" with 1 message: 'Tested reporter: compact'
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: compact'
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains("fakeTag"s) for: "All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "fakeTag" with 1 message: 'Tested reporter: console'
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains("fake reporter"s) for: "Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter" with 1 message: 'Tested reporter: console'
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: console'
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?>
|
||||
All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "fakeTag" with 1 message: 'Tested reporter: junit'
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?>
|
||||
Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter" with 1 message: 'Tested reporter: junit'
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?>
|
||||
All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: junit'
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?>
|
||||
All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "fakeTag" with 1 message: 'Tested reporter: sonarqube'
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?>
|
||||
Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter" with 1 message: 'Tested reporter: sonarqube'
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?>
|
||||
All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: sonarqube'
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains("fakeTag"s) for: "All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "fakeTag" with 1 message: 'Tested reporter: tap'
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains("fake reporter"s) for: "Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter" with 1 message: 'Tested reporter: tap'
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: tap'
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains("fakeTag"s) for: "All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "fakeTag" with 1 message: 'Tested reporter: teamcity'
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains("fake reporter"s) for: "Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter" with 1 message: 'Tested reporter: teamcity'
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: teamcity'
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?>
|
||||
<TagsFromMatchingTests>
|
||||
<Tag>
|
||||
<Count>1</Count>
|
||||
<Aliases>
|
||||
<Alias>fakeTag</Alias>
|
||||
</Aliases>
|
||||
</Tag>
|
||||
</TagsFromMatchingTests>" contains: "fakeTag" with 1 message: 'Tested reporter: xml'
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AvailableReporters>
|
||||
<Reporter>
|
||||
<Name>fake reporter</Name>
|
||||
<Description>fake description</Description>
|
||||
</Reporter>
|
||||
</AvailableReporters>" contains: "fake reporter" with 1 message: 'Tested reporter: xml'
|
||||
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?>
|
||||
<MatchingTests>
|
||||
<TestCase>
|
||||
<Name>fake test name</Name>
|
||||
<ClassName/>
|
||||
<Tags>[fakeTestTag]</Tags>
|
||||
<SourceInfo>
|
||||
<File>fake-file.cpp</File>
|
||||
<Line>123456789</Line>
|
||||
</SourceInfo>
|
||||
</TestCase>
|
||||
</MatchingTests>" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: xml'
|
||||
Message.tests.cpp:<line number>: passed: with 1 message: 'this is a success'
|
||||
Message.tests.cpp:<line number>: passed:
|
||||
BDD.tests.cpp:<line number>: passed: before == 0 for: 0 == 0
|
||||
@ -1563,6 +1726,21 @@ VariadicMacros.tests.cpp:<line number>: passed: with 1 message: 'no assertions'
|
||||
Tricky.tests.cpp:<line number>: passed: 0x<hex digits> == bit30and31 for: 3221225472 (0x<hex digits>) == 3221225472
|
||||
CmdLine.tests.cpp:<line number>: passed:
|
||||
Message.tests.cpp:<line number>: failed - but was ok: 1 == 2
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains("[fakeTag]"s) for: "All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "[fakeTag]"
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains("fake reporter"s) for: "Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter"
|
||||
Reporters.tests.cpp:<line number>: passed: listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" )
|
||||
Misc.tests.cpp:<line number>: passed: with 1 message: 'oops!'
|
||||
Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'For some reason someone is throwing a string literal!'
|
||||
PartTracker.tests.cpp:<line number>: passed: testCase.isOpen() for: true
|
||||
|
@ -1380,6 +1380,6 @@ due to unexpected exception with message:
|
||||
Why would you throw a std::string?
|
||||
|
||||
===============================================================================
|
||||
test cases: 354 | 280 passed | 70 failed | 4 failed as expected
|
||||
assertions: 2037 | 1885 passed | 131 failed | 21 failed as expected
|
||||
test cases: 356 | 282 passed | 70 failed | 4 failed as expected
|
||||
assertions: 2088 | 1936 passed | 131 failed | 21 failed as expected
|
||||
|
||||
|
@ -9399,6 +9399,721 @@ Matchers.tests.cpp:<line number>: PASSED:
|
||||
with expansion:
|
||||
{ 'a', 'b' } not UnorderedEquals: { 'c', 'b' }
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
automake reporter lists tags
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains("fakeTag"s) )
|
||||
with expansion:
|
||||
"All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "fakeTag"
|
||||
with message:
|
||||
Tested reporter: automake
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
automake reporter lists reporters
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains("fake reporter"s) )
|
||||
with expansion:
|
||||
"Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter"
|
||||
with message:
|
||||
Tested reporter: automake
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
automake reporter lists tests
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) )
|
||||
with expansion:
|
||||
"All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" )
|
||||
with message:
|
||||
Tested reporter: automake
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
compact reporter lists tags
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains("fakeTag"s) )
|
||||
with expansion:
|
||||
"All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "fakeTag"
|
||||
with message:
|
||||
Tested reporter: compact
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
compact reporter lists reporters
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains("fake reporter"s) )
|
||||
with expansion:
|
||||
"Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter"
|
||||
with message:
|
||||
Tested reporter: compact
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
compact reporter lists tests
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) )
|
||||
with expansion:
|
||||
"All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" )
|
||||
with message:
|
||||
Tested reporter: compact
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
console reporter lists tags
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains("fakeTag"s) )
|
||||
with expansion:
|
||||
"All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "fakeTag"
|
||||
with message:
|
||||
Tested reporter: console
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
console reporter lists reporters
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains("fake reporter"s) )
|
||||
with expansion:
|
||||
"Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter"
|
||||
with message:
|
||||
Tested reporter: console
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
console reporter lists tests
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) )
|
||||
with expansion:
|
||||
"All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" )
|
||||
with message:
|
||||
Tested reporter: console
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
junit reporter lists tags
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains("fakeTag"s) )
|
||||
with expansion:
|
||||
"<?xml version="1.0" encoding="UTF-8"?>
|
||||
All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "fakeTag"
|
||||
with message:
|
||||
Tested reporter: junit
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
junit reporter lists reporters
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains("fake reporter"s) )
|
||||
with expansion:
|
||||
"<?xml version="1.0" encoding="UTF-8"?>
|
||||
Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter"
|
||||
with message:
|
||||
Tested reporter: junit
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
junit reporter lists tests
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) )
|
||||
with expansion:
|
||||
"<?xml version="1.0" encoding="UTF-8"?>
|
||||
All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" )
|
||||
with message:
|
||||
Tested reporter: junit
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
sonarqube reporter lists tags
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains("fakeTag"s) )
|
||||
with expansion:
|
||||
"<?xml version="1.0" encoding="UTF-8"?>
|
||||
All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "fakeTag"
|
||||
with message:
|
||||
Tested reporter: sonarqube
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
sonarqube reporter lists reporters
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains("fake reporter"s) )
|
||||
with expansion:
|
||||
"<?xml version="1.0" encoding="UTF-8"?>
|
||||
Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter"
|
||||
with message:
|
||||
Tested reporter: sonarqube
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
sonarqube reporter lists tests
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) )
|
||||
with expansion:
|
||||
"<?xml version="1.0" encoding="UTF-8"?>
|
||||
All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" )
|
||||
with message:
|
||||
Tested reporter: sonarqube
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
tap reporter lists tags
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains("fakeTag"s) )
|
||||
with expansion:
|
||||
"All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "fakeTag"
|
||||
with message:
|
||||
Tested reporter: tap
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
tap reporter lists reporters
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains("fake reporter"s) )
|
||||
with expansion:
|
||||
"Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter"
|
||||
with message:
|
||||
Tested reporter: tap
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
tap reporter lists tests
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) )
|
||||
with expansion:
|
||||
"All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" )
|
||||
with message:
|
||||
Tested reporter: tap
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
teamcity reporter lists tags
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains("fakeTag"s) )
|
||||
with expansion:
|
||||
"All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "fakeTag"
|
||||
with message:
|
||||
Tested reporter: teamcity
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
teamcity reporter lists reporters
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains("fake reporter"s) )
|
||||
with expansion:
|
||||
"Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter"
|
||||
with message:
|
||||
Tested reporter: teamcity
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
teamcity reporter lists tests
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) )
|
||||
with expansion:
|
||||
"All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" )
|
||||
with message:
|
||||
Tested reporter: teamcity
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
xml reporter lists tags
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains("fakeTag"s) )
|
||||
with expansion:
|
||||
"<?xml version="1.0" encoding="UTF-8"?>
|
||||
<TagsFromMatchingTests>
|
||||
<Tag>
|
||||
<Count>1</Count>
|
||||
<Aliases>
|
||||
<Alias>fakeTag</Alias>
|
||||
</Aliases>
|
||||
</Tag>
|
||||
</TagsFromMatchingTests>" contains: "fakeTag"
|
||||
with message:
|
||||
Tested reporter: xml
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
xml reporter lists reporters
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains("fake reporter"s) )
|
||||
with expansion:
|
||||
"<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AvailableReporters>
|
||||
<Reporter>
|
||||
<Name>fake reporter</Name>
|
||||
<Description>fake description</Description>
|
||||
</Reporter>
|
||||
</AvailableReporters>" contains: "fake reporter"
|
||||
with message:
|
||||
Tested reporter: xml
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( factories.empty() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reporter's write listings to provided stream
|
||||
xml reporter lists tests
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) )
|
||||
with expansion:
|
||||
"<?xml version="1.0" encoding="UTF-8"?>
|
||||
<MatchingTests>
|
||||
<TestCase>
|
||||
<Name>fake test name</Name>
|
||||
<ClassName/>
|
||||
<Tags>[fakeTestTag]</Tags>
|
||||
<SourceInfo>
|
||||
<File>fake-file.cpp</File>
|
||||
<Line>123456789</Line>
|
||||
</SourceInfo>
|
||||
</TestCase>
|
||||
</MatchingTests>" ( contains: "fake test name" and contains: "fakeTestTag" )
|
||||
with message:
|
||||
Tested reporter: xml
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
SUCCEED counts as a test pass
|
||||
-------------------------------------------------------------------------------
|
||||
@ -11641,6 +12356,54 @@ Message.tests.cpp:<line number>: FAILED - but was ok:
|
||||
|
||||
No assertions in test case 'The NO_FAIL macro reports a failure but does not fail the test'
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The default listing implementation write to provided stream
|
||||
Listing tags
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains("[fakeTag]"s) )
|
||||
with expansion:
|
||||
"All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "[fakeTag]"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The default listing implementation write to provided stream
|
||||
Listing reporters
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains("fake reporter"s) )
|
||||
with expansion:
|
||||
"Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The default listing implementation write to provided stream
|
||||
Listing tests
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) )
|
||||
with expansion:
|
||||
"All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" )
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
This test 'should' fail but doesn't
|
||||
-------------------------------------------------------------------------------
|
||||
@ -16005,6 +16768,6 @@ Misc.tests.cpp:<line number>
|
||||
Misc.tests.cpp:<line number>: PASSED:
|
||||
|
||||
===============================================================================
|
||||
test cases: 354 | 264 passed | 86 failed | 4 failed as expected
|
||||
assertions: 2054 | 1885 passed | 148 failed | 21 failed as expected
|
||||
test cases: 356 | 266 passed | 86 failed | 4 failed as expected
|
||||
assertions: 2105 | 1936 passed | 148 failed | 21 failed as expected
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuitesloose text artifact
|
||||
>
|
||||
<testsuite name="<exe-name>" errors="17" failures="132" tests="2055" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
|
||||
<testsuite name="<exe-name>" errors="17" failures="132" tests="2106" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
|
||||
<properties>
|
||||
<property name="filters" value="~[!nonportable]~[!benchmark]~[approvals] *"/>
|
||||
<property name="random-seed" value="1"/>
|
||||
@ -1101,6 +1101,31 @@ Matchers.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase classname="<exe-name>.global" name="Regression test #1" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/automake reporter lists tags" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/automake reporter lists reporters" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/automake reporter lists tests" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/compact reporter lists tags" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/compact reporter lists reporters" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/compact reporter lists tests" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/console reporter lists tags" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/console reporter lists reporters" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/console reporter lists tests" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/junit reporter lists tags" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/junit reporter lists reporters" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/junit reporter lists tests" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/sonarqube reporter lists tags" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/sonarqube reporter lists reporters" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/sonarqube reporter lists tests" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/tap reporter lists tags" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/tap reporter lists reporters" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/tap reporter lists tests" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/teamcity reporter lists tags" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/teamcity reporter lists reporters" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/teamcity reporter lists tests" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/xml reporter lists tags" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/xml reporter lists reporters" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/xml reporter lists tests" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="SUCCEED counts as a test pass" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="SUCCEED does not require an argument" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.Fixture" name="Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or methods/Given: No operations precede me" time="{duration}" status="run"/>
|
||||
@ -1252,6 +1277,9 @@ Misc.tests.cpp:<line number>
|
||||
<testcase classname="<exe-name>.global" name="Test enum bit values" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Test with special, characters "in name" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="The NO_FAIL macro reports a failure but does not fail the test" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="The default listing implementation write to provided stream/Listing tags" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="The default listing implementation write to provided stream/Listing reporters" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="The default listing implementation write to provided stream/Listing tests" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="This test 'should' fail but doesn't" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="Thrown string literals are translated" time="{duration}" status="run">
|
||||
<error type="TEST_CASE">
|
||||
|
@ -150,6 +150,36 @@
|
||||
<testCase name="Our PCG implementation provides expected results for known seeds/Default seeded" duration="{duration}"/>
|
||||
<testCase name="Our PCG implementation provides expected results for known seeds/Specific seed" duration="{duration}"/>
|
||||
</file>
|
||||
<file path="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp">
|
||||
<testCase name="Reporter's write listings to provided stream" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/automake reporter lists tags" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/automake reporter lists reporters" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/automake reporter lists tests" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/compact reporter lists tags" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/compact reporter lists reporters" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/compact reporter lists tests" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/console reporter lists tags" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/console reporter lists reporters" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/console reporter lists tests" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/junit reporter lists tags" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/junit reporter lists reporters" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/junit reporter lists tests" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/sonarqube reporter lists tags" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/sonarqube reporter lists reporters" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/sonarqube reporter lists tests" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/tap reporter lists tags" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/tap reporter lists reporters" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/tap reporter lists tests" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/teamcity reporter lists tags" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/teamcity reporter lists reporters" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/teamcity reporter lists tests" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/xml reporter lists tags" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/xml reporter lists reporters" duration="{duration}"/>
|
||||
<testCase name="Reporter's write listings to provided stream/xml reporter lists tests" duration="{duration}"/>
|
||||
<testCase name="The default listing implementation write to provided stream/Listing tags" duration="{duration}"/>
|
||||
<testCase name="The default listing implementation write to provided stream/Listing reporters" duration="{duration}"/>
|
||||
<testCase name="The default listing implementation write to provided stream/Listing tests" duration="{duration}"/>
|
||||
</file>
|
||||
<file path="tests/<exe-name>/IntrospectiveTests/String.tests.cpp">
|
||||
<testCase name="StringRef/Empty string" duration="{duration}"/>
|
||||
<testCase name="StringRef/From string literal" duration="{duration}"/>
|
||||
|
@ -2468,6 +2468,102 @@ not ok {test-number} - testStringForMatching(), Matches("contains 'abc' as a sub
|
||||
not ok {test-number} - testStringForMatching(), Matches("this string contains 'abc' as a") for: "this string contains 'abc' as a substring" matches "this string contains 'abc' as a" case sensitively
|
||||
# Regression test #1
|
||||
ok {test-number} - actual, !UnorderedEquals(expected) for: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' }
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: automake'
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: automake'
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: automake'
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: compact'
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: compact'
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: compact'
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: console'
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: console'
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: console'
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?> All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: junit'
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?> Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: junit'
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?> All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: junit'
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?> All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: sonarqube'
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?> Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: sonarqube'
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?> All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: sonarqube'
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: tap'
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: tap'
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: tap'
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains("fakeTag"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "fakeTag" with 1 message: 'Tested reporter: teamcity'
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter" with 1 message: 'Tested reporter: teamcity'
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: teamcity'
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains("fakeTag"s) for: "<?xml version="1.0" encoding="UTF-8"?> <TagsFromMatchingTests> <Tag> <Count>1</Count> <Aliases> <Alias>fakeTag</Alias> </Aliases> </Tag> </TagsFromMatchingTests>" contains: "fakeTag" with 1 message: 'Tested reporter: xml'
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains("fake reporter"s) for: "<?xml version="1.0" encoding="UTF-8"?> <AvailableReporters> <Reporter> <Name>fake reporter</Name> <Description>fake description</Description> </Reporter> </AvailableReporters>" contains: "fake reporter" with 1 message: 'Tested reporter: xml'
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - !(factories.empty()) for: !false
|
||||
# Reporter's write listings to provided stream
|
||||
ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "<?xml version="1.0" encoding="UTF-8"?> <MatchingTests> <TestCase> <Name>fake test name</Name> <ClassName/> <Tags>[fakeTestTag]</Tags> <SourceInfo> <File>fake-file.cpp</File> <Line>123456789</Line> </SourceInfo> </TestCase> </MatchingTests>" ( contains: "fake test name" and contains: "fakeTestTag" ) with 1 message: 'Tested reporter: xml'
|
||||
# SUCCEED counts as a test pass
|
||||
ok {test-number} - with 1 message: 'this is a success'
|
||||
# SUCCEED does not require an argument
|
||||
@ -3001,6 +3097,12 @@ ok {test-number} - 0x<hex digits> == bit30and31 for: 3221225472 (0x<hex digits>)
|
||||
ok {test-number} -
|
||||
# The NO_FAIL macro reports a failure but does not fail the test
|
||||
ok {test-number} - 1 == 2 # TODO
|
||||
# The default listing implementation write to provided stream
|
||||
ok {test-number} - listingString, Contains("[fakeTag]"s) for: "All available tags: 1 [fakeTag] 1 tag " contains: "[fakeTag]"
|
||||
# The default listing implementation write to provided stream
|
||||
ok {test-number} - listingString, Contains("fake reporter"s) for: "Available reporters: fake reporter: fake description " contains: "fake reporter"
|
||||
# The default listing implementation write to provided stream
|
||||
ok {test-number} - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) for: "All available test cases: fake test name [fakeTestTag] 1 test case " ( contains: "fake test name" and contains: "fakeTestTag" )
|
||||
# This test 'should' fail but doesn't
|
||||
ok {test-number} - with 1 message: 'oops!'
|
||||
# Thrown string literals are translated
|
||||
@ -4100,5 +4202,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0
|
||||
ok {test-number} -
|
||||
# xmlentitycheck
|
||||
ok {test-number} -
|
||||
1..2054
|
||||
1..2105
|
||||
|
||||
|
@ -475,6 +475,8 @@ Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringFor
|
||||
##teamcity[testFinished name='Regex string matcher' duration="{duration}"]
|
||||
##teamcity[testStarted name='Regression test #1']
|
||||
##teamcity[testFinished name='Regression test #1' duration="{duration}"]
|
||||
##teamcity[testStarted name='Reporter|'s write listings to provided stream']
|
||||
##teamcity[testFinished name='Reporter|'s write listings to provided stream' duration="{duration}"]
|
||||
##teamcity[testStarted name='SUCCEED counts as a test pass']
|
||||
##teamcity[testFinished name='SUCCEED counts as a test pass' duration="{duration}"]
|
||||
##teamcity[testStarted name='SUCCEED does not require an argument']
|
||||
@ -563,6 +565,8 @@ Misc.tests.cpp:<line number>|nexpression failed|n CHECK( s1 == s2 )|nwith expan
|
||||
##teamcity[testFinished name='Test with special, characters "in name' duration="{duration}"]
|
||||
##teamcity[testStarted name='The NO_FAIL macro reports a failure but does not fail the test']
|
||||
##teamcity[testFinished name='The NO_FAIL macro reports a failure but does not fail the test' duration="{duration}"]
|
||||
##teamcity[testStarted name='The default listing implementation write to provided stream']
|
||||
##teamcity[testFinished name='The default listing implementation write to provided stream' duration="{duration}"]
|
||||
##teamcity[testStarted name='This test |'should|' fail but doesn|'t']
|
||||
##teamcity[testFinished name='This test |'should|' fail but doesn|'t' duration="{duration}"]
|
||||
##teamcity[testStarted name='Thrown string literals are translated']
|
||||
|
@ -11483,6 +11483,652 @@ Nor would this
|
||||
</Expression>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="Reporter's write listings to provided stream" tags="[reporters]" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="automake reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: automake
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains("fakeTag"s)
|
||||
</Original>
|
||||
<Expanded>
|
||||
"All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "fakeTag"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="automake reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: automake
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains("fake reporter"s)
|
||||
</Original>
|
||||
<Expanded>
|
||||
"Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="automake reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: automake
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s )
|
||||
</Original>
|
||||
<Expanded>
|
||||
"All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" )
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="compact reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: compact
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains("fakeTag"s)
|
||||
</Original>
|
||||
<Expanded>
|
||||
"All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "fakeTag"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="compact reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: compact
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains("fake reporter"s)
|
||||
</Original>
|
||||
<Expanded>
|
||||
"Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="compact reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: compact
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s )
|
||||
</Original>
|
||||
<Expanded>
|
||||
"All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" )
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="console reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: console
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains("fakeTag"s)
|
||||
</Original>
|
||||
<Expanded>
|
||||
"All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "fakeTag"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="console reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: console
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains("fake reporter"s)
|
||||
</Original>
|
||||
<Expanded>
|
||||
"Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="console reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: console
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s )
|
||||
</Original>
|
||||
<Expanded>
|
||||
"All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" )
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="junit reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: junit
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains("fakeTag"s)
|
||||
</Original>
|
||||
<Expanded>
|
||||
"<?xml version="1.0" encoding="UTF-8"?>
|
||||
All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "fakeTag"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="junit reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: junit
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains("fake reporter"s)
|
||||
</Original>
|
||||
<Expanded>
|
||||
"<?xml version="1.0" encoding="UTF-8"?>
|
||||
Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="junit reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: junit
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s )
|
||||
</Original>
|
||||
<Expanded>
|
||||
"<?xml version="1.0" encoding="UTF-8"?>
|
||||
All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" )
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="sonarqube reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: sonarqube
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains("fakeTag"s)
|
||||
</Original>
|
||||
<Expanded>
|
||||
"<?xml version="1.0" encoding="UTF-8"?>
|
||||
All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "fakeTag"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="sonarqube reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: sonarqube
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains("fake reporter"s)
|
||||
</Original>
|
||||
<Expanded>
|
||||
"<?xml version="1.0" encoding="UTF-8"?>
|
||||
Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="sonarqube reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: sonarqube
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s )
|
||||
</Original>
|
||||
<Expanded>
|
||||
"<?xml version="1.0" encoding="UTF-8"?>
|
||||
All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" )
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="tap reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: tap
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains("fakeTag"s)
|
||||
</Original>
|
||||
<Expanded>
|
||||
"All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "fakeTag"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="tap reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: tap
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains("fake reporter"s)
|
||||
</Original>
|
||||
<Expanded>
|
||||
"Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="tap reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: tap
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s )
|
||||
</Original>
|
||||
<Expanded>
|
||||
"All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" )
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="teamcity reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: teamcity
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains("fakeTag"s)
|
||||
</Original>
|
||||
<Expanded>
|
||||
"All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "fakeTag"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="teamcity reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: teamcity
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains("fake reporter"s)
|
||||
</Original>
|
||||
<Expanded>
|
||||
"Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="teamcity reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: teamcity
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s )
|
||||
</Original>
|
||||
<Expanded>
|
||||
"All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" )
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="xml reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: xml
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains("fakeTag"s)
|
||||
</Original>
|
||||
<Expanded>
|
||||
"<?xml version="1.0" encoding="UTF-8"?>
|
||||
<TagsFromMatchingTests>
|
||||
<Tag>
|
||||
<Count>1</Count>
|
||||
<Aliases>
|
||||
<Alias>fakeTag</Alias>
|
||||
</Aliases>
|
||||
</Tag>
|
||||
</TagsFromMatchingTests>" contains: "fakeTag"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="xml reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: xml
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains("fake reporter"s)
|
||||
</Original>
|
||||
<Expanded>
|
||||
"<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AvailableReporters>
|
||||
<Reporter>
|
||||
<Name>fake reporter</Name>
|
||||
<Description>fake description</Description>
|
||||
</Reporter>
|
||||
</AvailableReporters>" contains: "fake reporter"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
!(factories.empty())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="xml reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Info>
|
||||
Tested reporter: xml
|
||||
</Info>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s )
|
||||
</Original>
|
||||
<Expanded>
|
||||
"<?xml version="1.0" encoding="UTF-8"?>
|
||||
<MatchingTests>
|
||||
<TestCase>
|
||||
<Name>fake test name</Name>
|
||||
<ClassName/>
|
||||
<Tags>[fakeTestTag]</Tags>
|
||||
<SourceInfo>
|
||||
<File>fake-file.cpp</File>
|
||||
<Line>123456789</Line>
|
||||
</SourceInfo>
|
||||
</TestCase>
|
||||
</MatchingTests>" ( contains: "fake test name" and contains: "fakeTestTag" )
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="SUCCEED counts as a test pass" tags="[messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" >
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
@ -13838,6 +14484,54 @@ Message from section two
|
||||
</Expression>
|
||||
<OverallResult success="false"/>
|
||||
</TestCase>
|
||||
<TestCase name="The default listing implementation write to provided stream" tags="[reporter-helpers][reporters]" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Section name="Listing tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains("[fakeTag]"s)
|
||||
</Original>
|
||||
<Expanded>
|
||||
"All available tags:
|
||||
1 [fakeTag]
|
||||
1 tag
|
||||
|
||||
" contains: "[fakeTag]"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Section name="Listing reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains("fake reporter"s)
|
||||
</Original>
|
||||
<Expanded>
|
||||
"Available reporters:
|
||||
fake reporter: fake description
|
||||
|
||||
" contains: "fake reporter"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Section name="Listing tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
|
||||
<Original>
|
||||
listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s )
|
||||
</Original>
|
||||
<Expanded>
|
||||
"All available test cases:
|
||||
fake test name
|
||||
[fakeTestTag]
|
||||
1 test case
|
||||
|
||||
" ( contains: "fake test name" and contains: "fakeTestTag" )
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="This test 'should' fail but doesn't" tags="[!shouldfail][.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
|
||||
<OverallResult success="false"/>
|
||||
</TestCase>
|
||||
@ -19021,9 +19715,9 @@ loose text artifact
|
||||
</Section>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<OverallResults successes="1885" failures="149" expectedFailures="21"/>
|
||||
<OverallResultsCases successes="264" failures="86" expectedFailures="4"/>
|
||||
<OverallResults successes="1936" failures="149" expectedFailures="21"/>
|
||||
<OverallResultsCases successes="266" failures="86" expectedFailures="4"/>
|
||||
</Group>
|
||||
<OverallResults successes="1885" failures="148" expectedFailures="21"/>
|
||||
<OverallResultsCases successes="264" failures="86" expectedFailures="4"/>
|
||||
<OverallResults successes="1936" failures="148" expectedFailures="21"/>
|
||||
<OverallResultsCases successes="266" failures="86" expectedFailures="4"/>
|
||||
</Catch>
|
||||
|
109
tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp
Normal file
109
tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp
Normal file
@ -0,0 +1,109 @@
|
||||
|
||||
// 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
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include <catch2/catch_test_case_info.hpp>
|
||||
#include <catch2/catch_config.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_reporter.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_reporter_factory.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_reporter_registry.hpp>
|
||||
#include <catch2/internal/catch_list.hpp>
|
||||
#include <catch2/matchers/catch_matchers_string.hpp>
|
||||
#include <catch2/reporters/catch_reporter_helpers.hpp>
|
||||
|
||||
#include <sstream>
|
||||
|
||||
TEST_CASE( "The default listing implementation write to provided stream",
|
||||
"[reporters][reporter-helpers]" ) {
|
||||
using Catch::Matchers::Contains;
|
||||
using namespace std::string_literals;
|
||||
|
||||
std::stringstream sstream;
|
||||
SECTION( "Listing tags" ) {
|
||||
std::vector<Catch::TagInfo> tags(1);
|
||||
tags[0].add("fakeTag"_catch_sr);
|
||||
Catch::defaultListTags(sstream, tags, false);
|
||||
|
||||
auto listingString = sstream.str();
|
||||
REQUIRE_THAT(listingString, Contains("[fakeTag]"s));
|
||||
}
|
||||
SECTION( "Listing reporters" ) {
|
||||
std::vector<Catch::ReporterDescription> reporters(
|
||||
{ { "fake reporter", "fake description" } } );
|
||||
Catch::defaultListReporters(sstream, reporters, Catch::Verbosity::Normal);
|
||||
|
||||
auto listingString = sstream.str();
|
||||
REQUIRE_THAT(listingString, Contains("fake reporter"s));
|
||||
}
|
||||
SECTION( "Listing tests" ) {
|
||||
Catch::TestCaseInfo fakeInfo{
|
||||
""s,
|
||||
{ "fake test name"_catch_sr, "[fakeTestTag]"_catch_sr },
|
||||
{ "fake-file.cpp", 123456789 } };
|
||||
std::vector<Catch::TestCaseHandle> tests({ {&fakeInfo, nullptr} });
|
||||
Catch::defaultListTests(sstream, tests, false, Catch::Verbosity::Normal);
|
||||
|
||||
auto listingString = sstream.str();
|
||||
REQUIRE_THAT( listingString,
|
||||
Contains( "fake test name"s ) &&
|
||||
Contains( "fakeTestTag"s ) );
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE( "Reporter's write listings to provided stream", "[reporters]" ) {
|
||||
using Catch::Matchers::Contains;
|
||||
using namespace std::string_literals;
|
||||
|
||||
auto const& factories = Catch::getRegistryHub().getReporterRegistry().getFactories();
|
||||
// If there are no reporters, the test would pass falsely
|
||||
// while there is something obviously broken
|
||||
REQUIRE_FALSE(factories.empty());
|
||||
|
||||
for (auto const& factory : factories) {
|
||||
INFO("Tested reporter: " << factory.first);
|
||||
std::stringstream sstream;
|
||||
|
||||
Catch::ConfigData config_data;
|
||||
Catch::Config config( config_data );
|
||||
Catch::ReporterConfig rep_config( &config, sstream );
|
||||
auto reporter = factory.second->create( rep_config );
|
||||
|
||||
DYNAMIC_SECTION( factory.first << " reporter lists tags" ) {
|
||||
std::vector<Catch::TagInfo> tags(1);
|
||||
tags[0].add("fakeTag"_catch_sr);
|
||||
reporter->listTags(tags);
|
||||
|
||||
auto listingString = sstream.str();
|
||||
REQUIRE_THAT(listingString, Contains("fakeTag"s));
|
||||
}
|
||||
|
||||
DYNAMIC_SECTION( factory.first << " reporter lists reporters" ) {
|
||||
std::vector<Catch::ReporterDescription> reporters(
|
||||
{ { "fake reporter", "fake description" } } );
|
||||
reporter->listReporters(reporters);
|
||||
|
||||
auto listingString = sstream.str();
|
||||
REQUIRE_THAT(listingString, Contains("fake reporter"s));
|
||||
}
|
||||
|
||||
DYNAMIC_SECTION( factory.first << " reporter lists tests" ) {
|
||||
Catch::TestCaseInfo fakeInfo{
|
||||
""s,
|
||||
{ "fake test name"_catch_sr, "[fakeTestTag]"_catch_sr },
|
||||
{ "fake-file.cpp", 123456789 } };
|
||||
std::vector<Catch::TestCaseHandle> tests({ {&fakeInfo, nullptr} });
|
||||
reporter->listTests(tests);
|
||||
|
||||
auto listingString = sstream.str();
|
||||
REQUIRE_THAT( listingString,
|
||||
Contains( "fake test name"s ) &&
|
||||
Contains( "fakeTestTag"s ) );
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user