Skip to content
Snippets Groups Projects
Commit 884ba93b authored by Kai Koehne's avatar Kai Koehne
Browse files

QmlProjectManager: Fix autotests

parent c19fe3d7
No related branches found
No related tags found
No related merge requests found
#include "qmlprojectitem.h" #include "qmlprojectitem.h"
#include "filefilteritems.h" #include "filefilteritems.h"
#include <QmlComponent> #include "qmlprojectfileformat.h"
#include <QmlContext> #include <QDeclarativeComponent>
#include <QmlEngine> #include <QDeclarativeContext>
#include <QDeclarativeEngine>
#include <QtTest> #include <QtTest>
using namespace QmlProjectManager; using namespace QmlProjectManager;
...@@ -21,7 +22,7 @@ private slots: ...@@ -21,7 +22,7 @@ private slots:
TestProject::TestProject() TestProject::TestProject()
{ {
QmlProjectFileFormat::registerDeclarativeTypes();
} }
QString testDataDir = QLatin1String(SRCDIR "/data"); QString testDataDir = QLatin1String(SRCDIR "/data");
...@@ -39,8 +40,8 @@ void TestProject::testFileFilter() ...@@ -39,8 +40,8 @@ void TestProject::testFileFilter()
"}\n"); "}\n");
{ {
QmlEngine engine; QDeclarativeEngine engine;
QmlComponent component(&engine); QDeclarativeComponent component(&engine);
component.setData(projectFile.toUtf8(), QUrl()); component.setData(projectFile.toUtf8(), QUrl());
if (!component.isReady()) if (!component.isReady())
qDebug() << component.errorsString(); qDebug() << component.errorsString();
...@@ -68,8 +69,8 @@ void TestProject::testFileFilter() ...@@ -68,8 +69,8 @@ void TestProject::testFileFilter()
"}\n"); "}\n");
{ {
QmlEngine engine; QDeclarativeEngine engine;
QmlComponent component(&engine); QDeclarativeComponent component(&engine);
component.setData(projectFile.toUtf8(), QUrl()); component.setData(projectFile.toUtf8(), QUrl());
if (!component.isReady()) if (!component.isReady())
qDebug() << component.errorsString(); qDebug() << component.errorsString();
...@@ -98,8 +99,8 @@ void TestProject::testFileFilter() ...@@ -98,8 +99,8 @@ void TestProject::testFileFilter()
"}\n"); "}\n");
{ {
QmlEngine engine; QDeclarativeEngine engine;
QmlComponent component(&engine); QDeclarativeComponent component(&engine);
component.setData(projectFile.toUtf8(), QUrl()); component.setData(projectFile.toUtf8(), QUrl());
QVERIFY(component.isReady()); QVERIFY(component.isReady());
...@@ -127,8 +128,8 @@ void TestProject::testFileFilter() ...@@ -127,8 +128,8 @@ void TestProject::testFileFilter()
"}\n"); "}\n");
{ {
QmlEngine engine; QDeclarativeEngine engine;
QmlComponent component(&engine); QDeclarativeComponent component(&engine);
component.setData(projectFile.toUtf8(), QUrl()); component.setData(projectFile.toUtf8(), QUrl());
if (!component.isReady()) if (!component.isReady())
qDebug() << component.errorsString(); qDebug() << component.errorsString();
...@@ -159,8 +160,8 @@ void TestProject::testFileFilter() ...@@ -159,8 +160,8 @@ void TestProject::testFileFilter()
"}\n"); "}\n");
{ {
QmlEngine engine; QDeclarativeEngine engine;
QmlComponent component(&engine); QDeclarativeComponent component(&engine);
component.setData(projectFile.toUtf8(), QUrl()); component.setData(projectFile.toUtf8(), QUrl());
if (!component.isReady()) if (!component.isReady())
qDebug() << component.errorsString(); qDebug() << component.errorsString();
...@@ -188,8 +189,8 @@ void TestProject::testFileFilter() ...@@ -188,8 +189,8 @@ void TestProject::testFileFilter()
"}\n"); "}\n");
{ {
QmlEngine engine; QDeclarativeEngine engine;
QmlComponent component(&engine); QDeclarativeComponent component(&engine);
component.setData(projectFile.toUtf8(), QUrl()); component.setData(projectFile.toUtf8(), QUrl());
if (!component.isReady()) if (!component.isReady())
qDebug() << component.errorsString(); qDebug() << component.errorsString();
...@@ -222,8 +223,8 @@ void TestProject::testMatchesFile() ...@@ -222,8 +223,8 @@ void TestProject::testMatchesFile()
" }" " }"
"}\n"); "}\n");
QmlEngine engine; QDeclarativeEngine engine;
QmlComponent component(&engine); QDeclarativeComponent component(&engine);
component.setData(projectFile.toUtf8(), QUrl()); component.setData(projectFile.toUtf8(), QUrl());
if (!component.isReady()) if (!component.isReady())
qDebug() << component.errorsString(); qDebug() << component.errorsString();
...@@ -253,8 +254,8 @@ void TestProject::testLibraryPaths() ...@@ -253,8 +254,8 @@ void TestProject::testLibraryPaths()
"}\n"); "}\n");
{ {
QmlEngine engine; QDeclarativeEngine engine;
QmlComponent component(&engine); QDeclarativeComponent component(&engine);
component.setData(projectFile.toUtf8(), QUrl()); component.setData(projectFile.toUtf8(), QUrl());
if (!component.isReady()) if (!component.isReady())
qDebug() << component.errorsString(); qDebug() << component.errorsString();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment