Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Changed console reporter test duration reporting format

Was
"<section-name> completed in XXX s."
Now is
"XXX s: <section-name>"

Closes #322

(cherry picked from commit 0805539)
Commit
9bab7c8229930edc369e33138281d59b86a273c2
Author
Martin Hořeňovský ·
Committer
Phil Nash
Parents
d8c4512b259c

Files · Download .tar.gz

Changes

 include/reporters/catch_reporter_console.hpp | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp
index 96f18dc2..31adf8d4 100644
--- a/include/reporters/catch_reporter_console.hpp
+++ b/include/reporters/catch_reporter_console.hpp
@@ -67,15 +67,12 @@ namespace Catch {
                     stream << "\nNo assertions in test case";
                 stream << " '" << _sectionStats.sectionInfo.name << "'\n" << std::endl;
             }
+            if( m_config->showDurations() == ShowDurations::Always ) {
+                stream << _sectionStats.durationInSeconds << " s: " << _sectionStats.sectionInfo.name << std::endl;
+            }
             if( m_headerPrinted ) {
-                if( m_config->showDurations() == ShowDurations::Always )
-                    stream << "Completed in " << _sectionStats.durationInSeconds << 's' << std::endl;
                 m_headerPrinted = false;
             }
-            else {
-                if( m_config->showDurations() == ShowDurations::Always )
-                    stream << _sectionStats.sectionInfo.name << " completed in " << _sectionStats.durationInSeconds << 's' << std::endl;
-            }
             StreamingReporterBase::sectionEnded( _sectionStats );
         }