From 604ef6d4a7108d6c5632a1c85d0f248249f6dbe5 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Date: Wed, 18 Nov 2015 13:09:26 +0100 Subject: [PATCH] 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ø <tor.arne.vestbo@theqtcompany.com> Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com> --- mkspecs/features/qt_build_config.prf | 3 +++ mkspecs/features/testcase.prf | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/qt_build_config.prf b/mkspecs/features/qt_build_config.prf index 7197f84c9a7..eaf23cf63a8 100644 --- a/mkspecs/features/qt_build_config.prf +++ b/mkspecs/features/qt_build_config.prf @@ -55,6 +55,9 @@ QMAKE_DIR_REPLACE_SANE = PRECOMPILED_DIR OBJECTS_DIR MOC_DIR RCC_DIR UI_DIR cross_compile: \ CONFIG += force_bootstrap +android|ios|winrt: \ + CONFIG += builtin_testdata + CONFIG += \ create_prl link_prl \ prepare_docs qt_docs_targets \ diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf index 6f6f073f70e..6bac0546c32 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 -- GitLab