diff options
author | Caroline Chao <caroline.chao@digia.com> | 2013-01-17 09:07:14 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-17 20:33:45 +0100 |
commit | 7a2f9067445261f65dc2e340f7b75e30c23f0bed (patch) | |
tree | 4cc451c2fb9a27b4d39fe7fb05a439b0b78e64ff /tests/auto | |
parent | ce326a00b5fd57e82f350008296c0f7c18762486 (diff) | |
download | qtquickcontrols-7a2f9067445261f65dc2e340f7b75e30c23f0bed.tar.gz |
Tests: Refactor build and use of test plugin
The test plugin is now built as a standard plugin and
does not need to be installed. Using qml_plugin.prf
is not necessary any more and it didn't work particulary
well for our use case. With this change we remove the
"make install" hack in QMAKE_POST_LINK.
In qtdesktop test, use IMPORTPATH so qmlscene can
find the test plugin in a custom location when
make check is run. This is needed because qml test
files launched via qtdesktop should be able to import
the test plugin if needed (i.e. tst_tableview.qml).
Change-Id: I54d64bce5b1d5fbf1233a122d0c205f71193d55d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qtdesktop/qtdesktop.pro | 2 | ||||
-rw-r--r-- | tests/auto/testplugin/QtDesktopTest/qmldir (renamed from tests/auto/testplugin/qmldir) | 0 | ||||
-rw-r--r-- | tests/auto/testplugin/testplugin.pro | 24 |
3 files changed, 17 insertions, 9 deletions
diff --git a/tests/auto/qtdesktop/qtdesktop.pro b/tests/auto/qtdesktop/qtdesktop.pro index b59b762f..341f4449 100644 --- a/tests/auto/qtdesktop/qtdesktop.pro +++ b/tests/auto/qtdesktop/qtdesktop.pro @@ -1,6 +1,8 @@ TEMPLATE = app TARGET = tst_qtdesktop +IMPORTPATH = $$OUT_PWD/../testplugin + QT += widgets CONFIG += qmltestcase diff --git a/tests/auto/testplugin/qmldir b/tests/auto/testplugin/QtDesktopTest/qmldir index 8b6dadac..8b6dadac 100644 --- a/tests/auto/testplugin/qmldir +++ b/tests/auto/testplugin/QtDesktopTest/qmldir diff --git a/tests/auto/testplugin/testplugin.pro b/tests/auto/testplugin/testplugin.pro index aab9427f..b0df3acd 100644 --- a/tests/auto/testplugin/testplugin.pro +++ b/tests/auto/testplugin/testplugin.pro @@ -1,12 +1,15 @@ -CXX_MODULE = qml +TEMPLATE = lib +CONFIG += plugin TARGET = testplugin TARGETPATH = QtDesktopTest QT += qml quick widgets +QMLDIR = $$PWD/$$TARGETPATH/qmldir + OTHER_FILES += \ $$PWD/testplugin.json \ - $$PWD/qmldir + $$QMLDIR SOURCES += \ $$PWD/testplugin.cpp @@ -21,11 +24,14 @@ mac { LIBS += -framework Carbon } -load(qml_plugin) - -qmldir_path = $$PWD$${QMAKE_DIR_SEP}qmldir -win*: qmldir_path = $$replace(qmldir_path, /, \\) -destdir_path = $$DESTDIR -win*: destdir_path = $$replace(destdir_path, /, \\) +DESTDIR = $$TARGETPATH -QMAKE_POST_LINK = $(MAKE) -f $(MAKEFILE) install +!equals(PWD, $$OUT_PWD) { + # move qmldir alongside the plugin if shadow build + qmldirfile.input = QMLDIR + qmldirfile.output = $$DESTDIR/qmldir + qmldirfile.variable_out = PRE_TARGETDEPS + qmldirfile.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + qmldirfile.CONFIG = no_link no_clean + QMAKE_EXTRA_COMPILERS += qmldirfile +} |