forked from qt-creator/qt-creator
QmlDesigner.qml2puppet: Adding simple test
This test will fail and give an error message, if inbuild item are missing. Change-Id: Ib7a33e7d1fbd22f76c8ac31e1dbc68912aa8edaa Reviewed-by: Marco Bubke <marco.bubke@digia.com> Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user