tests/auto/compilerwarnings/tst_compilerwarnings.cpp
changeset 29 b72c6db6890b
parent 18 2f34d5167611
child 37 758a864f9613
--- a/tests/auto/compilerwarnings/tst_compilerwarnings.cpp	Fri Jun 11 14:24:45 2010 +0300
+++ b/tests/auto/compilerwarnings/tst_compilerwarnings.cpp	Wed Jun 23 19:07:03 2010 +0300
@@ -62,6 +62,9 @@
 private slots:
     void warnings_data();
     void warnings();
+
+private:
+    bool shouldIgnoreWarning(QString const&);
 };
 
 #if 0
@@ -242,16 +245,37 @@
     if (!errs.isEmpty()) {
         errList = errs.split("\n");
         qDebug() << "Arguments:" << args;
-        foreach (QString err, errList) {
-            qDebug() << err;
+        QStringList validErrors;
+        foreach (QString const& err, errList) {
+            bool ignore = shouldIgnoreWarning(err);
+            qDebug() << err << (ignore ? " [ignored]" : "");
+            if (!ignore) {
+                validErrors << err;
+            }
         }
+        errList = validErrors;
     }
     QCOMPARE(errList.count(), 0); // verbose info how many lines of errors in output
-    QVERIFY(errs.isEmpty());
 
     tmpQSourceFile.remove();
 }
 
+bool tst_CompilerWarnings::shouldIgnoreWarning(QString const& warning)
+{
+    if (warning.isEmpty()) {
+        return true;
+    }
+
+    // icecc outputs warnings if some icecc node breaks
+    if (warning.startsWith("ICECC[")) {
+        return true;
+    }
+
+    // Add more bogus warnings here
+
+    return false;
+}
+
 QTEST_APPLESS_MAIN(tst_CompilerWarnings)
 
 #include "tst_compilerwarnings.moc"