summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@qt.io>2022-04-26 13:52:03 +0200
committerDominik Holland <dominik.holland@qt.io>2022-05-17 16:14:28 +0200
commit913a7c08a25b5256d3bfa6dd7161c3deb009f89b (patch)
tree9f1c13003e8a3a6b6b8e5d52fb5d7cf4009bf0c7
parente5bdbb08eb75d3ed9b0a55932273230221b2f0a4 (diff)
downloadqtapplicationmanager-913a7c08a25b5256d3bfa6dd7161c3deb009f89b.tar.gz
Enable qml tests on coin
Coin uses a custom prf to detect what tests need to be executed in the test phase. To make this custom prf happy we need to adapt am-qml-testcase.prf accordingly. Change-Id: Id32f8244ebf7efecd211c94ccfeb1f411be524a8 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
-rw-r--r--qmake-features/am-qml-testcase.prf23
-rw-r--r--tests/tests.pro4
2 files changed, 23 insertions, 4 deletions
diff --git a/qmake-features/am-qml-testcase.prf b/qmake-features/am-qml-testcase.prf
index adf91f1e..aa5c968b 100644
--- a/qmake-features/am-qml-testcase.prf
+++ b/qmake-features/am-qml-testcase.prf
@@ -1,4 +1,17 @@
-TEMPLATE = aux
+# The following is needed to let the qmltests run on coin
+# coin is using a custom prf to detect all test cases which need to be run
+# during the build phase.
+# The custom prf mandates that it needs to be a binary and qmltestcase or testcase
+# is loaded.
+# Load qmltestcase to directly use the created targets and helper functions
+load(qmltestcase)
+# Also set it in CONFIG to make sure the custom prf in coin detects it as well.
+CONFIG += qmltestcase
+# Create an empty dummy library to make the custom prf in coin happy
+TEMPLATE = lib
+CONFIG -= debug_and_release
+# Create a static lib on MSVC because dynamic libs can't be empty in MSVC
+msvc: CONFIG += static
load(am-config)
@@ -38,6 +51,7 @@ prefix_build {
AM_TESTRUNNER_DIR = $$[QT_INSTALL_BINS]
}
}
+AM_TESTRUNNER_DIR = $$[QT_INSTALL_BINS]
# The check command
COMMAND += $$AM_TESTRUNNER_DIR/appman-qmltestrunner --no-cache --no-dlt-logging
@@ -62,13 +76,14 @@ OTHER_FILES += $$AM_CONFIG
# Make AM_TESTDATA_DIR known
!isEmpty(AM_TESTDATA_DIR) {
- COMMAND += -o \'systemProperties: { public: { AM_TESTDATA_DIR: $$AM_TESTDATA_DIR } }\'
+ COMMAND += -o \"systemProperties: { public: { AM_TESTDATA_DIR: $$AM_TESTDATA_DIR } }\"
}
!isEmpty(TESTRUN_CWD):!contains(TESTRUN_CWD, ^\\./?): \
COMMAND = cd $$shell_path($$TESTRUN_CWD) && $$eval(COMMAND)
-QMAKE_EXTRA_TARGETS *= check
+!contains(QMAKE_EXTRA_TARGETS, "check"): QMAKE_EXTRA_TARGETS *= check
+else: check.commands = ""
# Set default test configuration (each config is run separately)
isEmpty(TEST_CONFIGURATIONS) {
@@ -82,7 +97,7 @@ for(file, TEST_FILES) {
check.commands += $$COMMAND $$absolute_path($$file, $$_PRO_FILE_PWD_) $${config} -- $(TESTARGS) &&
}
}
-msvc:check.commands += VER>NUL
+win32:check.commands += VER>NUL
else:check.commands += true;
OTHER_FILES += $$TEST_FILES
diff --git a/tests/tests.pro b/tests/tests.pro
index 3bfd9083..808c386a 100644
--- a/tests/tests.pro
+++ b/tests/tests.pro
@@ -51,6 +51,10 @@ OTHER_FILES += \
# qmake would create a default check target implicitly, but since we need 'testdata' as an
# dependency, we have to set it up explicitly
check.depends = testdata $$check.depends
+
+ # add the first target to make sure the testdata is created already at the compile step
+ first.depends = testdata
+ QMAKE_EXTRA_TARGETS *= first
}
QMAKE_EXTRA_TARGETS *= check
}