summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/testcase.prf
diff options
context:
space:
mode:
Diffstat (limited to 'mkspecs/features/testcase.prf')
-rw-r--r--mkspecs/features/testcase.prf41
1 files changed, 29 insertions, 12 deletions
diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf
index 8d51c9d028..79883b7f09 100644
--- a/mkspecs/features/testcase.prf
+++ b/mkspecs/features/testcase.prf
@@ -9,6 +9,18 @@ testcase_exceptions: CONFIG += exceptions
# Set in qt_build_config.prf
testcase_no_bundle: CONFIG -= app_bundle
+# Allow testcases to mark themselves as not supporting high-DPI
+testcase_lowdpi {
+ macos {
+ !isEmpty(QMAKE_INFO_PLIST): \
+ error("QMAKE_INFO_PLIST already set, can't apply testcase_lowdpi")
+
+ QMAKE_INFO_PLIST = $$QMAKESPEC/Info.plist.disable_highdpi
+ } else {
+ # TODO: Add support for other platforms if possible
+ }
+}
+
benchmark: type = benchmark
else: type = check
@@ -77,12 +89,11 @@ isEmpty(BUILDS)|build_pass {
# Install tests unless no_testcase_installs is set, or there is already
# a `target' in INSTALLS.
#
- # Tests are installed under a directory named after the target so that each
- # test has its own directory for testdata etc.
+ # Tests are installed under a directory named after their source folder
+ # so that each test has its own directory for testdata etc.
#
- load(resolve_target)
- TARGET_BASENAME = $$basename(QMAKE_RESOLVED_TARGET)
- target.path = $$[QT_INSTALL_TESTS]/$$TARGET_BASENAME
+ TEST_FOLDER = $$basename(_PRO_FILE_PWD_)
+ target.path = $$[QT_INSTALL_TESTS]/$$TEST_FOLDER
INSTALLS += target
}
@@ -183,20 +194,26 @@ isEmpty(BUILDS)|build_pass {
}
builtin_testdata {
- ALL_TESTDATA = $$TESTDATA $$GENERATED_TESTDATA
-
- # BLACKLIST needs to be added to the testdata
- BLACKLISTPATH = $$_PRO_FILE_PWD_/BLACKLIST
- exists($$BLACKLISTPATH): ALL_TESTDATA *= $$BLACKLISTPATH
-
# RESOURCES does not support wildcards (for good reasons)
- for(td, ALL_TESTDATA): \
+ for (td, TESTDATA): \
testdata.files += $$files($$absolute_path($$td, $$_PRO_FILE_PWD_))
+ # BLACKLIST needs to be added to the testdata
+ BLACKLISTPATH = $$_PRO_FILE_PWD_/BLACKLIST
+ exists($$BLACKLISTPATH): \
+ testdata.files *= $$BLACKLISTPATH
!isEmpty(testdata.files) {
testdata.base = $$_PRO_FILE_PWD_
RESOURCES += testdata
}
+ # Extra compilers don't create wildcards to start with.
+ for (td, GENERATED_TESTDATA): \
+ gentestdata.files += $$absolute_path($$td, $$OUT_PWD)
+ !isEmpty(gentestdata.files) {
+ gentestdata.base = $$OUT_PWD
+ RESOURCES += gentestdata
+ }
+
!isEmpty(TEST_HELPER_INSTALLS): \
error("This platform does not support tests which require helpers.")
}