diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2010-05-19 01:35:48 (GMT) |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2010-05-19 01:39:40 (GMT) |
commit | f29f46107204ea542ec899915508a69f520f6159 (patch) | |
tree | fe7ae011aecf15686765a3de18601b98d8fa2b9b /tests/auto/compilerwarnings | |
parent | dc2e494acbd0a8e371c9fd92aef2da6975c5cccb (diff) | |
download | Qt-f29f46107204ea542ec899915508a69f520f6159.zip Qt-f29f46107204ea542ec899915508a69f520f6159.tar.gz Qt-f29f46107204ea542ec899915508a69f520f6159.tar.bz2 |
Fixed tst_compilerwarnings test failure due to icecc node failures.
When an icecc node has some system error, icecc on the client side
outputs a warning. Since it's able to recover and the warning has
nothing to do with the code, we should ignore it.
Other distributed compile tools will have similar issues, but no attempt
has been made to cover them.
Diffstat (limited to 'tests/auto/compilerwarnings')
-rw-r--r-- | tests/auto/compilerwarnings/tst_compilerwarnings.cpp | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/tests/auto/compilerwarnings/tst_compilerwarnings.cpp b/tests/auto/compilerwarnings/tst_compilerwarnings.cpp index f910a18..82c327a 100644 --- a/tests/auto/compilerwarnings/tst_compilerwarnings.cpp +++ b/tests/auto/compilerwarnings/tst_compilerwarnings.cpp @@ -62,6 +62,9 @@ class tst_CompilerWarnings: public QObject private slots: void warnings_data(); void warnings(); + +private: + bool shouldIgnoreWarning(QString const&); }; #if 0 @@ -242,16 +245,37 @@ void tst_CompilerWarnings::warnings() 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" |