aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/snippets/tst_snippets.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-10-15 16:39:43 +0200
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-10-16 11:09:01 +0000
commit8a37e702a531dfb9d3db2e7b7adb2078c33f147f (patch)
tree40f5471139dd9ff426ba8dae3121c9572997bac5 /tests/auto/snippets/tst_snippets.cpp
parenta78dab0290bc6f6f55c2bf60ea425237a88eb22d (diff)
Make tst_snippets fail if there are QML warnings
Change-Id: I6680d891bd9a1c54746cc97c5eae742c1cca4e62 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests/auto/snippets/tst_snippets.cpp')
-rw-r--r--tests/auto/snippets/tst_snippets.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/snippets/tst_snippets.cpp b/tests/auto/snippets/tst_snippets.cpp
index 3a3ab218..f7191724 100644
--- a/tests/auto/snippets/tst_snippets.cpp
+++ b/tests/auto/snippets/tst_snippets.cpp
@@ -72,14 +72,25 @@ void tst_Snippets::initTestCase()
QVERIFY(!filePaths.isEmpty());
}
+Q_DECLARE_METATYPE(QList<QQmlError>)
+
void tst_Snippets::screenshots()
{
QFETCH(QString, input);
QFETCH(QString, output);
+ qRegisterMetaType<QList<QQmlError> >();
+
+ QSignalSpy warnings(view.engine(), SIGNAL(warnings(QList<QQmlError>)));
+ QVERIFY(warnings.isValid());
+
view.setSource(QUrl::fromLocalFile(input));
+ QCOMPARE(view.status(), QQuickView::Ready);
+ QVERIFY(view.errors().isEmpty());
QVERIFY(view.rootObject());
+ QVERIFY(warnings.isEmpty());
+
view.show();
view.requestActivate();
QVERIFY(QTest::qWaitForWindowActive(&view));