summaryrefslogtreecommitdiffstats
path: root/qmake-features
diff options
context:
space:
mode:
authorBernd Weimer <bernd.weimer@pelagicore.com>2018-01-23 16:37:40 +0100
committerBernd Weimer <bernd.weimer@pelagicore.com>2018-02-02 07:56:22 +0000
commitbad6f90edc1cf0fac97b2c0f1918039fc0eb4435 (patch)
tree2f422a36179b9cd5089bc091bf7d180aab1f67de /qmake-features
parent2c5aa14677e3038ee46bf727122f090497e777ba (diff)
Extend and improve QML auto tests
Exposed a new type to QML auto tests that allows to ignore logging messages. In addition assets of QML tests will be copied to the build folder and instead of running the tests in the source folder, they will be run in the build folder again. Change-Id: Ief9d34aed1f74e28f15bd5435723bb6afee7d531 Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
Diffstat (limited to 'qmake-features')
-rw-r--r--qmake-features/am-qml-testcase.prf18
1 files changed, 16 insertions, 2 deletions
diff --git a/qmake-features/am-qml-testcase.prf b/qmake-features/am-qml-testcase.prf
index 05c663e1..b5568d71 100644
--- a/qmake-features/am-qml-testcase.prf
+++ b/qmake-features/am-qml-testcase.prf
@@ -7,8 +7,8 @@ load(am-config)
QT_TOOL_NAME = appman-qmltestrunner
!isEmpty(TEST_FILES): qtAddTargetEnv(COMMAND, QT)
-# Execute test in source folder in order to find any assets.
-TESTRUN_CWD = $$_PRO_FILE_PWD_
+# If the test ends up in a different directory, we should cd to that directory.
+TESTRUN_CWD = $$DESTDIR
debug_and_release:debug_and_release_target {
# But in debug-and-release-target mode we don't want to cd into the debug/release
@@ -72,3 +72,17 @@ for(file, TEST_FILES) {
}
check.commands += true;
OTHER_FILES += $$TEST_FILES
+
+# Copy assets to build folder
+for (d , DIRECTORIES) {
+ win32: do_copydata.commands += $(COPY_DIR) $$shell_path($$_PRO_FILE_PWD_/$${d}) $$shell_path($$OUT_PWD/$${d}) $$escape_expand(\n\t)
+ else: do_copydata.commands += $(COPY_DIR) $$shell_path($$_PRO_FILE_PWD_/$${d}) $$shell_path($$OUT_PWD) $$escape_expand(\n\t)
+}
+for (f , FILES) {
+ do_copydata.commands += $(COPY) $$shell_path($$_PRO_FILE_PWD_/$${f}) $$shell_path($$OUT_PWD/$${f}) $$escape_expand(\n\t)
+}
+
+!equals(_PRO_FILE_PWD_, $$OUT_PWD) {
+ check.depends = do_copydata
+ QMAKE_EXTRA_TARGETS += do_copydata
+}