diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2012-05-17 14:38:33 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-24 09:42:42 +0200 |
commit | 9539b88b7c36efb582f225fb1207db4fc27d3f49 (patch) | |
tree | 97f122b4f99ed29647d057165fdac68a17d03360 /tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp | |
parent | 2a5d05dd3c9d42794d6863425598b8a838ebfb63 (diff) |
Make qqmlmoduleplugin tests pass in shadow builds.
The plugin binary and qml files for a module need to be in the same
directory. This was solved for source builds because the files were
already located in the import path, but with shadow builds the files
were split between the build and source trees. To solve this we copy
the files to the import path when doing a build. So no files are
copied on top of themselves all mixed module files have been relocated
to their module source directory.
Change-Id: I238af998a0f766e67ed6d0023e5ab4c2a4ea67af
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp')
-rw-r--r-- | tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp b/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp index f6c165840d..81aed01a73 100644 --- a/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp @@ -75,14 +75,18 @@ private slots: private: QString m_importsDirectory; + QString m_dataImportsDirectory; }; void tst_qqmlmoduleplugin::initTestCase() { QQmlDataTest::initTestCase(); - m_importsDirectory = directory() + QStringLiteral("/imports"); + m_importsDirectory = QFINDTESTDATA(QStringLiteral("imports")); QVERIFY2(QFileInfo(m_importsDirectory).isDir(), qPrintable(QString::fromLatin1("Imports directory '%1' does not exist.").arg(m_importsDirectory))); + m_dataImportsDirectory = directory() + QStringLiteral("/imports"); + QVERIFY2(QFileInfo(m_dataImportsDirectory).isDir(), + qPrintable(QString::fromLatin1("Imports directory '%1' does not exist.").arg(m_dataImportsDirectory))); } #define VERIFY_ERRORS(errorfile) \ @@ -222,7 +226,7 @@ void tst_qqmlmoduleplugin::remoteImportWithQuotedUrl() { TestHTTPServer server(SERVER_PORT); QVERIFY(server.isValid()); - server.serveDirectory(m_importsDirectory); + server.serveDirectory(m_dataImportsDirectory); QQmlEngine engine; QQmlComponent component(&engine); @@ -243,10 +247,10 @@ void tst_qqmlmoduleplugin::remoteImportWithUnquotedUri() { TestHTTPServer server(SERVER_PORT); QVERIFY(server.isValid()); - server.serveDirectory(m_importsDirectory); + server.serveDirectory(m_dataImportsDirectory); QQmlEngine engine; - engine.addImportPath(m_importsDirectory); + engine.addImportPath(m_dataImportsDirectory); QQmlComponent component(&engine); component.setData("import com.nokia.PureQmlModule 1.0 \nComponentA { width: 300; ComponentB{} }", QUrl()); |