From 8cb52795f1dc0bdc06ce4fa9dc49ac9e5141ab0f Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Fri, 28 Oct 2011 18:19:05 +1000 Subject: Allow extra selftests without modifying source. Change-Id: I21708b725611eb64bdb0414cee08ca00dd62b213 Reviewed-by: Rohan McGovern --- tests/auto/testlib/selftests/tst_selftests.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index bbdc5ee9e9..9a56ce8c1b 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -305,13 +305,6 @@ void tst_Selftests::runSubTest_data() #endif << "benchlibeventcounter" << "benchliboptions" -#if 0 - // These tests are affected by timing and whether the CPU tick counter - // is monotonically increasing. They won't work on some machines so - // leave them off by default. Feel free to uncomment for your own testing. - << "benchlibtickcounter" - << "benchlibwalltime" -#endif << "cmptest" << "commandlinedata" << "crashes" @@ -344,6 +337,16 @@ void tst_Selftests::runSubTest_data() << "xunit" ; + // These tests are affected by timing and whether the CPU tick counter + // is monotonically increasing. They won't work on some machines so + // leave them off by default. Feel free to enable them for your own + // testing by setting the QTEST_ENABLE_EXTRA_SELFTESTS environment + // variable to something non-empty. + if (!qgetenv("QTEST_ENABLE_EXTRA_SELFTESTS").isEmpty()) + tests << "benchlibtickcounter" + << "benchlibwalltime" + ; + foreach (LoggerSet const& loggerSet, allLoggerSets()) { QStringList loggers = loggerSet.loggers; -- cgit v1.2.3