summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools/moc
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2016-07-29 11:26:03 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2016-07-29 12:10:36 +0000
commita5c851598c96a9b7c9b0fd9b38b4f7aec42322de (patch)
tree179ee1289c1bec9eb0b046c9c86445fa6eab396a /tests/auto/tools/moc
parentdd3a08dd539a17e52bb8eec19c9aff27f4de7de4 (diff)
moc: Add warnings when resolving and opening includes fails
Previously, only cryptic warnings: QFSFileEngine::open: No file name specified occurred. Task-number: QTBUG-55014 Change-Id: Ic99614eb58c605ed6e1b86d3d4b8f527c5b9244c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'tests/auto/tools/moc')
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index d9a0a6ad60..94df29f539 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -2027,6 +2027,13 @@ void tst_Moc::warnings_data()
<< 1
<< QString("IGNORE_ALL_STDOUT")
<< QString(":-1: Error: Unexpected character in macro argument list.");
+
+ QTest::newRow("Missing header warning")
+ << QByteArray("class X : public QObject { Q_OBJECT };")
+ << (QStringList() << QStringLiteral("--include") << QStringLiteral("doesnotexist.h"))
+ << 0
+ << QString("IGNORE_ALL_STDOUT")
+ << QStringLiteral("Warning: Failed to resolve include \"doesnotexist.h\" for moc file <standard input>");
}
void tst_Moc::warnings()