diff options
Diffstat (limited to 'tests/auto/testlib/selftests/tst_selftests.cpp')
-rw-r--r-- | tests/auto/testlib/selftests/tst_selftests.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index f33e7a3e0f..04696a1387 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -466,11 +466,26 @@ static inline QProcessEnvironment processEnvironment() if (!displayValue.isEmpty()) result.insert(display, displayValue); #endif + const QString platform = QStringLiteral("QT_QPA_PLATFORM"); + const QString platformValue = systemEnvironment.value(platform); + if (!platformValue.isEmpty()) + result.insert(platform, platformValue); return result; } void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& loggers, QStringList const& arguments) { +#if defined(__GNUC__) && defined(__i386) && defined(Q_OS_LINUX) + if (arguments.contains("-callgrind")) { + QProcess checkProcess; + QStringList args; + args << QLatin1String("--version"); + checkProcess.start(QLatin1String("valgrind"), args); + if (!checkProcess.waitForFinished(-1)) + QSKIP(QString("Valgrind broken or not available. Not running %1 test!").arg(subdir).toLocal8Bit()); + } +#endif + QProcess proc; static const QProcessEnvironment environment = processEnvironment(); proc.setProcessEnvironment(environment); |