summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestcase.cpp
diff options
context:
space:
mode:
authorTasuku Suzuki <tasuku.suzuki@qbc.io>2019-05-22 15:27:03 +0900
committerTasuku Suzuki <tasuku.suzuki@qbc.io>2019-05-28 17:20:00 +0900
commita8162e1f59f2823bffddb0ee660829561b9b5090 (patch)
tree60fe6246d80ac1501f40f6f64c3d062227b73554 /src/testlib/qtestcase.cpp
parent1798d3ddc80b05cf41ee61807ec433d624b6ed6b (diff)
Replace QTESTLIB_USE_VALGRIND with a new feature 'valgrind'
Change-Id: I851788cb1872eef86c75c7bdb2de361a0ff2af6c Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/testlib/qtestcase.cpp')
-rw-r--r--src/testlib/qtestcase.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index cad29b5326..5faafba38d 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -574,7 +574,7 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, const char *const argv[], bool
" -nocrashhandler : Disables the crash handler. Useful for debugging crashes.\n"
"\n"
" Benchmarking options:\n"
-#ifdef QTESTLIB_USE_VALGRIND
+#if QT_CONFIG(valgrind)
" -callgrind : Use callgrind to time benchmarks\n"
#endif
#ifdef QTESTLIB_USE_PERF_EVENTS
@@ -717,7 +717,7 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, const char *const argv[], bool
}
} else if (strcmp(argv[i], "-nocrashhandler") == 0) {
QTest::noCrashHandler = true;
-#ifdef QTESTLIB_USE_VALGRIND
+#if QT_CONFIG(valgrind)
} else if (strcmp(argv[i], "-callgrind") == 0) {
if (QBenchmarkValgrindUtils::haveValgrind())
if (QFileInfo(QDir::currentPath()).isWritable()) {
@@ -1459,7 +1459,7 @@ void TestMethods::invokeTests(QObject *testObject) const
QScopedPointer<WatchDog> watchDog;
if (!debuggerPresent()
-#ifdef QTESTLIB_USE_VALGRIND
+#if QT_CONFIG(valgrind)
&& QBenchmarkGlobalData::current->mode() != QBenchmarkGlobalData::CallgrindChildProcess
#endif
) {
@@ -1866,7 +1866,7 @@ int QTest::qRun()
{
QTEST_ASSERT(currentTestObject);
-#ifdef QTESTLIB_USE_VALGRIND
+#if QT_CONFIG(valgrind)
int callgrindChildExitCode = 0;
#endif
@@ -1886,7 +1886,7 @@ int QTest::qRun()
} // !noCrashHandler
#endif // Q_OS_WIN
-#ifdef QTESTLIB_USE_VALGRIND
+#if QT_CONFIG(valgrind)
if (QBenchmarkGlobalData::current->mode() == QBenchmarkGlobalData::CallgrindParentProcess) {
if (Q_UNLIKELY(!qApp))
qFatal("QtTest: -callgrind option is not available with QTEST_APPLESS_MAIN");
@@ -1944,7 +1944,7 @@ int QTest::qRun()
}
#endif
-#ifdef QTESTLIB_USE_VALGRIND
+#if QT_CONFIG(valgrind)
if (QBenchmarkGlobalData::current->mode() == QBenchmarkGlobalData::CallgrindParentProcess)
return callgrindChildExitCode;
#endif