diff options
Diffstat (limited to 'Source/CTest/cmCTestRunTest.h')
-rw-r--r-- | Source/CTest/cmCTestRunTest.h | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h index 7e80157..48a5064 100644 --- a/Source/CTest/cmCTestRunTest.h +++ b/Source/CTest/cmCTestRunTest.h @@ -5,6 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include <cmath> #include <set> #include <stddef.h> #include <string> @@ -64,7 +65,7 @@ public: void CompressOutput(); // launch the test process, return whether it started correctly - bool StartTest(size_t total); + bool StartTest(size_t completed, size_t total); // capture and report the test results bool EndTest(size_t completed, size_t total, bool started); // Called by ctest -N to log the command string @@ -72,7 +73,7 @@ public: void ComputeWeightedCost(); - bool StartAgain(); + bool StartAgain(size_t completed); void StartFailure(std::string const& output); @@ -93,6 +94,9 @@ private: // Run post processing of the process output for MemCheck void MemCheckPostProcess(); + // Returns "completed/total Test #Index: " + std::string GetTestPrefix(size_t completed, size_t total) const; + cmCTestTestHandler::cmCTestTestProperties* TestProperties; bool TimeoutIsForStopTime = false; // Pointer back to the "parent"; the handler that invoked this test run @@ -118,14 +122,7 @@ private: inline int getNumWidth(size_t n) { - int numWidth = 1; - if (n >= 10) { - numWidth = 2; - } - if (n >= 100) { - numWidth = 3; - } - return numWidth; + return static_cast<int>(std::log10(n)) + 1; } #endif |