diff --git a/tests/auto/qml/qmldesigner/coretests/coretests.pro b/tests/auto/qml/qmldesigner/coretests/coretests.pro index 30b4081de5ca1969f4ba9bb2440058dbee1ef2c0..ffd725dfc66105111fc18914302c90587c241305 100644 --- a/tests/auto/qml/qmldesigner/coretests/coretests.pro +++ b/tests/auto/qml/qmldesigner/coretests/coretests.pro @@ -1,22 +1,25 @@ -include(../../../../../src/plugins/qmldesigner/config.pri) +CREATORDIR=$$PWD/../../../../.. + +include($$CREATORDIR/src/plugins/qmldesigner/config.pri) QT += testlib \ script \ declarative -include(../../../../../src/plugins/qmldesigner/core/core.pri) -include(../../../../../src/libs/qmljs/qmljs-lib.pri) -HEADERS+=../../../../../src/libs/utils/changeset.h -SOURCES+=../../../../../src/libs/utils/changeset.cpp -INCLUDEPATH+=../../../../../src/libs -DEFINES+=QTCREATOR_UTILS_STATIC_LIB QML_BUILD_STATIC_LIB QTCREATOR_TEST -DESTDIR = ../../../../../bin +include($$CREATORDIR/src/plugins/qmldesigner/core/core.pri) +include($$CREATORDIR/src/libs/qmljs/qmljs-lib.pri) +HEADERS+=$$CREATORDIR/src/libs/utils/changeset.h +SOURCES+=$$CREATORDIR/src/libs/utils/changeset.cpp -DEFINES+=MANUALTEST_PATH=\\\"$$PWD"/../../../../manual/qml/testfiles/"\\\" +INCLUDEPATH+=$$CREATORDIR/src/libs + +DEFINES+=QTCREATOR_UTILS_STATIC_LIB QML_BUILD_STATIC_LIB QTCREATOR_TEST +DEFINES+=QTCREATORDIR=\\\"$$CREATORDIR\\\" DEPENDPATH += .. -DEPENDPATH += ../../../../../src/plugins/qmldesigner/core/include +DEPENDPATH += $$CREATORDIR/src/plugins/qmldesigner/core/include TARGET = tst_qmldesigner_core + CONFIG += console CONFIG -= app_bundle TEMPLATE = app diff --git a/tests/auto/qml/qmldesigner/coretests/testcore.cpp b/tests/auto/qml/qmldesigner/coretests/testcore.cpp index 8ecbeeef3c623803b667d5bbc94729f74e074250..01121ea07fd2537bc7b2e547ff39e1235d5d545d 100644 --- a/tests/auto/qml/qmldesigner/coretests/testcore.cpp +++ b/tests/auto/qml/qmldesigner/coretests/testcore.cpp @@ -94,7 +94,20 @@ void TestCore::initTestCase() #endif Exception::setShouldAssert(false); - initializeMetaTypeSystem(QLatin1String("../../../../../share/qtcreator")); + initializeMetaTypeSystem(QLatin1String(QTCREATORDIR "/share/qtcreator")); + + + // Load plugins + +#ifdef Q_OS_MAC + const QString pluginPath = QTCREATORDIR "/PlugIns/QmlDesigner"; +#else + const QString pluginPath = QTCREATORDIR "/lib/qmldesigner"; +#endif + + qDebug() << pluginPath; + Q_ASSERT(QFileInfo(pluginPath).exists()); + MetaInfo::setPluginPaths(QStringList() << pluginPath); } void TestCore::cleanupTestCase() @@ -525,7 +538,7 @@ void TestCore::testRewriterDynamicProperties() void TestCore::loadSubItems() { - QFile file(QCoreApplication::applicationDirPath() + "/../data/fx/topitem.qml"); + QFile file(QString(QTCREATORDIR) + "/tests/auto/qml/qmldesigner/data/fx/topitem.qml"); QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text)); QPlainTextEdit textEdit1; @@ -3220,15 +3233,6 @@ void TestCore::testMetaInfoEnums() void TestCore::testMetaInfoDotProperties() { - -#ifdef Q_OS_MAC - const QString pluginPath = QCoreApplication::applicationDirPath() + "/../PlugIns/QmlDesigner"; -#else - const QString pluginPath = QCoreApplication::applicationDirPath() + "/../" - + QLatin1String("lib") + "/qmldesigner"; -#endif - MetaInfo::setPluginPaths(QStringList() << pluginPath); - QScopedPointer<Model> model(Model::create("Qt/Text")); QVERIFY(model.data()); @@ -6249,8 +6253,10 @@ void TestCore::loadWelcomeScreen() void TestCore::loadTestFiles() { + const QString manualTestPath = QLatin1String(QTCREATORDIR) + "/tests/manual/qml/testfiles"; + qDebug() << manualTestPath; { //empty.qml - QFile file(QString(MANUALTEST_PATH) + "/empty.qml"); + QFile file(manualTestPath + "/empty.qml"); QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text)); QPlainTextEdit textEdit; @@ -6273,7 +6279,7 @@ void TestCore::loadTestFiles() } { //helloworld.qml - QFile file(QString(MANUALTEST_PATH) + "/helloworld.qml"); + QFile file(manualTestPath + "/helloworld.qml"); QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text)); QPlainTextEdit textEdit; @@ -6303,7 +6309,7 @@ void TestCore::loadTestFiles() QCOMPARE(textNode.variantProperty("y").value().toInt(), 93); } { //states.qml - QFile file(QString(MANUALTEST_PATH) + "/states.qml"); + QFile file(manualTestPath + "/states.qml"); QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text)); QPlainTextEdit textEdit; @@ -6352,7 +6358,7 @@ void TestCore::loadTestFiles() QSKIP("See BAUHAUS-539 (component loading is broken)", SkipAll); { //usingbutton.qml - QFile file(QString(MANUALTEST_PATH) + "/usingbutton.qml"); + QFile file(manualTestPath + "/usingbutton.qml"); QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text)); QPlainTextEdit textEdit;