From aac3d1876326e3658f4a34cf277f25b1816dbc75 Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Sun, 5 Feb 2012 20:56:21 +0000 Subject: [PATCH] [rosautotest] - When rosautotest is launched, show how much time has past since the machine has started - Also show how much time each individual test need to complete - The purpose of this feature isn't to benchmark the os but to let us spot regressions regarding test time svn path=/trunk/; revision=55441 --- rostests/rosautotest/CWineTest.cpp | 11 ++++++++++- rostests/rosautotest/main.cpp | 6 ++++++ rostests/rosautotest/precomp.h | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/rostests/rosautotest/CWineTest.cpp b/rostests/rosautotest/CWineTest.cpp index 976343b8296..f5dbd6bdcf2 100644 --- a/rostests/rosautotest/CWineTest.cpp +++ b/rostests/rosautotest/CWineTest.cpp @@ -263,11 +263,15 @@ CWineTest::RunTest(CTestInfo* TestInfo) bool BreakLoop = false; DWORD BytesAvailable; DWORD Temp; - stringstream ss; + stringstream ss, ssFinish; + DWORD StartTime = GetTickCount(); + float TotalTime; ss << "Running Wine Test, Module: " << TestInfo->Module << ", Test: " << TestInfo->Test << endl; StringOut(ss.str()); + StartTime = GetTickCount(); + { /* Execute the test */ CProcess Process(TestInfo->CommandLine, &m_StartupInfo); @@ -305,6 +309,11 @@ CWineTest::RunTest(CTestInfo* TestInfo) } while(!BreakLoop); } + + TotalTime = ((float)GetTickCount() - StartTime)/1000; + ssFinish << "Test " << TestInfo->Test << " completed in "; + ssFinish << setprecision(2) << fixed << TotalTime << " seconds." << endl; + StringOut(ssFinish.str()); } /** diff --git a/rostests/rosautotest/main.cpp b/rostests/rosautotest/main.cpp index 5fb5dd4c297..d9cdb37d828 100644 --- a/rostests/rosautotest/main.cpp +++ b/rostests/rosautotest/main.cpp @@ -51,11 +51,17 @@ wmain(int argc, wchar_t* argv[]) try { + stringstream ss; + /* Set up the configuration */ Configuration.ParseParameters(argc, argv); Configuration.GetSystemInformation(); Configuration.GetConfigurationFromFile(); + ss << "\n\nSystem uptime " << setprecision(2) << fixed ; + ss << ((float)GetTickCount()/1000) << " seconds\n"; + StringOut(ss.str()); + /* Run the tests */ WineTest.Run(); diff --git a/rostests/rosautotest/precomp.h b/rostests/rosautotest/precomp.h index f5e65ad0798..d70ae88f8dc 100644 --- a/rostests/rosautotest/precomp.h +++ b/rostests/rosautotest/precomp.h @@ -4,6 +4,7 @@ #include #include #include +#include using namespace std;