From a2628375057e7e8b39d2cf3a130cc9d7b1f56fb0 Mon Sep 17 00:00:00 2001 From: Sami Nurmenniemi Date: Tue, 21 Mar 2017 12:11:26 +0200 Subject: Fix tst_Selftest on QEMU Two changes are needed to pass tst_Selftest on QEMU 1. Pass QEMU specific env variables to the subtests 2. Ignore output on stderr on some tests when running on QEMU Change-Id: Ie1f722fd183aac5973e87d408005e06cbafcde17 Reviewed-by: Simon Hausmann --- tests/auto/testlib/selftests/selftests.pri | 3 +++ tests/auto/testlib/selftests/tst_selftests.cpp | 13 +++++++++++++ 2 files changed, 16 insertions(+) (limited to 'tests') diff --git a/tests/auto/testlib/selftests/selftests.pri b/tests/auto/testlib/selftests/selftests.pri index 7404a1c49b..66c7e06760 100644 --- a/tests/auto/testlib/selftests/selftests.pri +++ b/tests/auto/testlib/selftests/selftests.pri @@ -45,3 +45,6 @@ SUBPROGRAMS = \ verifyexceptionthrown \ warnings \ xunit + +INCLUDEPATH += ../../../../shared/ +HEADERS += ../../../../shared/emulationdetector.h diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index 0c078127b4..e7123fc059 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -36,6 +36,8 @@ #include +#include "emulationdetector.h" + struct LoggerSet; class tst_Selftests: public QObject @@ -550,6 +552,7 @@ static QProcessEnvironment processEnvironment() || key == QLatin1String("GRAPHICS_ROOT") || key == QLatin1String("TZ") #elif defined(Q_OS_UNIX) || key == QLatin1String("HOME") || key == QLatin1String("USER") // Required for X11 on openSUSE + || key == QLatin1String("QEMU_SET_ENV") || key == QLatin1String("QEMU_LD_PREFIX") // Required for QEMU # if !defined(Q_OS_MAC) || key == QLatin1String("DISPLAY") || key == QLatin1String("XAUTHLOCALHOSTNAME") || key.startsWith(QLatin1String("XDG_")) @@ -641,6 +644,16 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge #ifdef Q_CC_MINGW && subdir != QLatin1String("blacklisted") // calls qFatal() && subdir != QLatin1String("silent") // calls qFatal() +#endif +#ifdef Q_OS_LINUX + // QEMU outputs to stderr about uncaught signals + && (!EmulationDetector::isRunningArmOnX86() || + (subdir != QLatin1String("blacklisted") + && subdir != QLatin1String("silent") + && subdir != QLatin1String("assert") + && subdir != QLatin1String("crashes") + ) + ) #endif && subdir != QLatin1String("benchlibcallgrind")) QVERIFY2(err.isEmpty(), err.constData()); -- cgit v1.2.3