From 604ef6d4a7108d6c5632a1c85d0f248249f6dbe5 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 18 Nov 2015 13:09:26 +0100 Subject: automatically put TESTDATA into RESOURCES on android/ios/winrt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QFINDTESTDATA is already prepared to find it there. Change-Id: I467392786ce6bcfbf1bd0b6079f60c9df06834b1 Reviewed-by: Tor Arne Vestbø Reviewed-by: Oliver Wolff Reviewed-by: Maurice Kalinowski --- mkspecs/features/testcase.prf | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'mkspecs/features/testcase.prf') diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf index 6f6f073f70..6bac0546c3 100644 --- a/mkspecs/features/testcase.prf +++ b/mkspecs/features/testcase.prf @@ -79,7 +79,7 @@ isEmpty(BUILDS)|build_pass { INSTALLS += target } -contains(INSTALLS, target) { +!builtin_testdata:contains(INSTALLS, target) { # Install testdata and helpers as well, but only if we're actually installing the test. # # Testdata is installed relative to the directory containing the testcase @@ -180,6 +180,20 @@ contains(INSTALLS, target) { } } +builtin_testdata { + ALL_TESTDATA = $$TESTDATA $$GENERATED_TESTDATA + # RESOURCES does not support wildcards (for good reasons) + for(td, ALL_TESTDATA): \ + testdata.files += $$files($$absolute_path($$td, $$_PRO_FILE_PWD_)) + !isEmpty(testdata.files) { + testdata.base = $$_PRO_FILE_PWD_ + RESOURCES += testdata + } + + !isEmpty(TEST_HELPER_INSTALLS): \ + error("This platform does not support tests which require helpers.") +} + macx-xcode:bundle:isEmpty(QMAKE_BUNDLE_EXTENSION) { QMAKE_PBX_PRODUCT_TYPE = com.apple.product-type.bundle.unit-test QMAKE_PBX_BUNDLE_TYPE = wrapper.cfbundle -- cgit v1.2.3