qt5base-lts/mkspecs/features/qmltestcase.prf
BogDan Vatra 45b56d86bb Fix running qml tests on Android
First and foremost the condition was wrong ...
In order to help running qml test cases on Android without any android
specific hack on
user's .pro files we copy the entire project folder to assets. I copy the
entire folder
and not only the tst_*.qml files because it might contain data which is
needed by the tests to run.

Change-Id: I06323d9d52904317410dd2f440de65a0766a48b5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2020-08-24 14:50:56 +03:00

30 lines
954 B
Plaintext

!isEmpty(SOURCES) {
QT += qml qmltest
load(testcase)
!android {
contains(TEMPLATE, vc.*): DEFINES += QUICK_TEST_SOURCE_DIR=\"$$_PRO_FILE_PWD_\"
else: DEFINES += QUICK_TEST_SOURCE_DIR=$$shell_quote(\"$$_PRO_FILE_PWD_\")
} else {
isEmpty(RESOURCES) {
ANDROID_EXTRA_PLUGINS *= $$_PRO_FILE_PWD_
DEFINES += QUICK_TEST_SOURCE_DIR=$$shell_quote(\"assets:/$$basename(_PRO_FILE_PWD_)\")
} else {
DEFINES += QUICK_TEST_SOURCE_DIR=$$shell_quote(\":/\")
}
}
} else {
# Allow a project to run tests without a CPP stub
TEMPLATE = aux
QMAKE_EXTRA_TARGETS += check
qtPrepareTool(QMAKE_QMLTESTRUNNER, qmltestrunner)
check.commands = $$QMAKE_QMLTESTRUNNER
}
# If the .pro file specified an IMPORTPATH, then add that to
# the command-line when the test is run.
!isEmpty(IMPORTPATH) {
for(import, IMPORTPATH): check.commands += -import \"$$import\"
}