MCPcopy Create free account
hub / github.com/catchorg/Catch2 / formatDuration

Function formatDuration

extras/catch_amalgamated.cpp:11043–11047  ·  view source on GitHub ↗

Formats the duration in seconds to 3 decimal places. This is done because some genius defined Maven Surefire schema in a way that only accepts 3 decimal places, and tools like Jenkins use that schema for validation JUnit reporter output.

Source from the content-addressed store, hash-verified

11041 // in a way that only accepts 3 decimal places, and tools like
11042 // Jenkins use that schema for validation JUnit reporter output.
11043 std::string formatDuration( double seconds ) {
11044 ReusableStringStream rss;
11045 rss << std::fixed << std::setprecision( 3 ) << seconds;
11046 return rss.str();
11047 }
11048
11049 static void normalizeNamespaceMarkers(std::string& str) {
11050 std::size_t pos = str.find( "::" );

Callers 2

writeRunMethod · 0.70
writeSectionMethod · 0.70

Calls 1

strMethod · 0.45

Tested by

no test coverage detected