summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-06-30 15:58:47 +0200
committerMichael Stahl <mstahl@redhat.com>2016-07-01 11:21:10 +0200
commitf3cb21a3fb0141d27b8b7435a2d938439ab7a657 (patch)
treeaeef406b5bab65a495fccce198941f943e42a8f1 /sal
parent110a500b68bbc9010cf1cf896ef611c397c27d6f (diff)
cppunittester: always print execution time of each test
Not much point in disabling this by default, nobody but the author will find it. Change-Id: I637b214644d2cc7bc70b8bca4f214955355ea951
Diffstat (limited to 'sal')
-rw-r--r--sal/cppunittester/cppunittester.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx
index 3beb9013093c..2563d1bc698e 100644
--- a/sal/cppunittester/cppunittester.cxx
+++ b/sal/cppunittester/cppunittester.cxx
@@ -81,12 +81,12 @@ std::string convertLazy(rtl::OUString const & s16) {
s8.getStr(), static_cast< std::string::size_type >(s8.getLength()));
}
-#if defined TIMETESTS
//Output how long each test took
class TimingListener
: public CppUnit::TestListener
{
public:
+ TimingListener() = default;
TimingListener(const TimingListener&) = delete;
TimingListener& operator=(const TimingListener&) = delete;
@@ -98,14 +98,13 @@ public:
void endTest( CppUnit::Test *test ) override
{
sal_uInt32 nEndTime = osl_getGlobalTimer();
- std::cout << test->getName() << ": " << nEndTime-m_nStartTime
- << "ms" << std::endl;
+ std::cout << test->getName() << " finished in: "
+ << nEndTime-m_nStartTime << "ms" << std::endl;
}
private:
sal_uInt32 m_nStartTime;
};
-#endif
#ifdef UNX
#include <stdlib.h>
@@ -275,10 +274,8 @@ public:
LogFailuresAsTheyHappen logger;
result.addListener(&logger);
-#ifdef TIMETESTS
TimingListener timer;
result.addListener(&timer);
-#endif
#ifdef UNX
EyecatcherListener eye;