From 75a4ac51b191092bee4a995a9742832c640188eb Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 12 Nov 2009 15:55:31 +0100 Subject: Launcher test: Clean stderr whitelist --- tests/auto/guiapplauncher/tst_guiapplauncher.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/auto/guiapplauncher/tst_guiapplauncher.cpp b/tests/auto/guiapplauncher/tst_guiapplauncher.cpp index 2a6c1e2..a61bd5e 100644 --- a/tests/auto/guiapplauncher/tst_guiapplauncher.cpp +++ b/tests/auto/guiapplauncher/tst_guiapplauncher.cpp @@ -439,6 +439,19 @@ static inline void ensureTerminated(QProcess *p) qWarning("Unable to terminate process"); } +static const QStringList &stderrWhiteList() +{ + static QStringList rc; + if (rc.empty()) { + rc << QLatin1String("QPainter::begin: Paint device returned engine == 0, type: 2") + << QLatin1String("QPainter::setRenderHint: Painter must be active to set rendering hints") + << QLatin1String("QPainter::setPen: Painter not active") + << QLatin1String("QPainter::setBrush: Painter not active") + << QLatin1String("QPainter::end: Painter not active, aborted"); + } + return rc; +} + bool tst_GuiAppLauncher::runApp(const AppLaunchData &data, QString *errorMessage) const { qDebug("Launching: %s\n", qPrintable(data.binary)); @@ -483,7 +496,7 @@ bool tst_GuiAppLauncher::runApp(const AppLaunchData &data, QString *errorMessage const QStringList stderrOutput = QString::fromLocal8Bit(process.readAllStandardOutput()).split(QLatin1Char('\n')); foreach(const QString &stderrLine, stderrOutput) { // Skip expected QPainter warnings from oxygen. - if (stderrLine.startsWith(QLatin1String("QPainter:"))) { + if (stderrWhiteList().contains(stderrLine)) { qWarning("%s: stderr: %s\n", qPrintable(data.binary), qPrintable(stderrLine)); } else { if (!stderrLine.isEmpty()) { // Split oddity gives empty messages -- cgit v0.12