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 <simon.hausmann@qt.io>
bb10
Sami Nurmenniemi 2017-03-21 12:11:26 +02:00
parent d33b9774ac
commit a262837505
2 changed files with 16 additions and 0 deletions

View File

@ -45,3 +45,6 @@ SUBPROGRAMS = \
verifyexceptionthrown \
warnings \
xunit
INCLUDEPATH += ../../../../shared/
HEADERS += ../../../../shared/emulationdetector.h

View File

@ -36,6 +36,8 @@
#include <private/cycle_p.h>
#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());