Commit d4b4353a authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner.qml2puppet: Adding simple test

This test will fail and give an error message, if
inbuild item are missing.

Change-Id: Ib7a33e7d1fbd22f76c8ac31e1dbc68912aa8edaa
Reviewed-by: default avatarMarco Bubke <marco.bubke@digia.com>
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent edf8b4a5
......@@ -34,6 +34,9 @@
#include <qt5nodeinstanceclientproxy.h>
#include <QQmlComponent>
#include <QQmlEngine>
#ifdef ENABLE_QT_BREAKPAD
#include <qtsystemexceptionhandler.h>
#endif
......@@ -51,6 +54,25 @@ int main(int argc, char *argv[])
QCoreApplication::setApplicationName("Qml2Puppet");
QCoreApplication::setApplicationVersion("1.0.0");
if (application.arguments().count() == 2 && application.arguments().at(1) == "--test") {
qDebug() << QCoreApplication::applicationVersion();
QQmlEngine engine;
QQmlComponent component(&engine);
component.setData("import QtQuick 2.0\nItem {\n}\n", QUrl::fromLocalFile("test.qml"));
QObject *object = component.create();
if (object) {
qDebug() << "Basic QtQuick 2.0 working...";
} else {
qDebug() << "Basic QtQuick 2.0 not working...";
qDebug() << component.errorString();
}
delete object;
return 0;
}
if (application.arguments().count() == 2 && application.arguments().at(1) == "--version") {
qDebug() << QCoreApplication::applicationVersion();
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment