Add a new reporter customization point: reporting all assertions

By opting the JUnit and XML reporters into it, we no longer run
into problem where they underreport the results without `-s` flag.

Related to #1264, #1267, #1310
This commit is contained in:
Martin Hořeňovský
2018-07-14 20:51:02 +02:00
parent 9ee4c1db52
commit d6c7392b24
6 changed files with 6 additions and 7 deletions

View File

@@ -42,6 +42,7 @@ namespace Catch {
struct ReporterPreferences {
bool shouldRedirectStdOut = false;
bool shouldReportAllAssertions = false;
};
template<typename T>

View File

@@ -17,7 +17,7 @@ namespace Catch {
m_config(_config),
m_reporter(std::move(reporter)),
m_lastAssertionInfo{ StringRef(), SourceLineInfo("",0), StringRef(), ResultDisposition::Normal },
m_includeSuccessfulResults( m_config->includeSuccessfulResults() )
m_includeSuccessfulResults( m_config->includeSuccessfulResults() || m_reporter->getPreferences().shouldReportAllAssertions )
{
m_context.setRunner(this);
m_context.setConfig(m_config);