Commit 7fc325cc by Jamie Madill Committed by Commit Bot

Test Runner: Print total test execution time.

Also has a few other tweaks to test spin-up. Bug: angleproject:3162 Change-Id: I8753f1afedbcc5c4b5ae257965ce68dc4a02ae06 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2407836 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org>
parent 852f61f7
...@@ -1075,6 +1075,13 @@ bool TestSuite::finishProcess(ProcessInfo *processInfo) ...@@ -1075,6 +1075,13 @@ bool TestSuite::finishProcess(ProcessInfo *processInfo)
return false; return false;
} }
if (!batchResults.results.empty())
{
const TestIdentifier &id = batchResults.results.begin()->first;
std::string config = GetConfigNameFromTestIdentifier(id);
printf("Completed batch with config: %s\n", config.c_str());
}
// Process results and print unexpected errors. // Process results and print unexpected errors.
for (const auto &resultIter : batchResults.results) for (const auto &resultIter : batchResults.results)
{ {
...@@ -1147,6 +1154,9 @@ int TestSuite::run() ...@@ -1147,6 +1154,9 @@ int TestSuite::run()
return RUN_ALL_TESTS(); return RUN_ALL_TESTS();
} }
Timer totalRunTime;
totalRunTime.start();
constexpr double kIdleMessageTimeout = 5.0; constexpr double kIdleMessageTimeout = 5.0;
Timer messageTimer; Timer messageTimer;
...@@ -1157,7 +1167,7 @@ int TestSuite::run() ...@@ -1157,7 +1167,7 @@ int TestSuite::run()
bool progress = false; bool progress = false;
// Spawn a process if needed and possible. // Spawn a process if needed and possible.
while (static_cast<int>(mCurrentProcesses.size()) < mMaxProcesses && !mTestQueue.empty()) if (static_cast<int>(mCurrentProcesses.size()) < mMaxProcesses && !mTestQueue.empty())
{ {
std::vector<TestIdentifier> testsInBatch = mTestQueue.front(); std::vector<TestIdentifier> testsInBatch = mTestQueue.front();
mTestQueue.pop(); mTestQueue.pop();
...@@ -1223,12 +1233,15 @@ int TestSuite::run() ...@@ -1223,12 +1233,15 @@ int TestSuite::run()
} }
// Sleep briefly and continue. // Sleep briefly and continue.
angle::Sleep(10); angle::Sleep(100);
} }
// Dump combined results. // Dump combined results.
WriteOutputFiles(true, mTestResults, mResultsFile, mHistogramJsonFile, mTestSuiteName.c_str()); WriteOutputFiles(true, mTestResults, mResultsFile, mHistogramJsonFile, mTestSuiteName.c_str());
totalRunTime.stop();
printf("Tests completed in %lf seconds\n", totalRunTime.getElapsedTime());
return printFailuresAndReturnCount() == 0; return printFailuresAndReturnCount() == 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment