diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2012-06-22 12:03:39 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-04 02:46:27 +0200 |
commit | bcf20e122a037b9679ca47d3b95986db9f49c915 (patch) | |
tree | 956b1c3f1d02159d3d116bd98a29d66f36671aad /mkspecs | |
parent | 10edf63174414cc95165c4fc14a3278e944dfbe2 (diff) |
Avoid load(testcase) for installing test helper apps
Make test projects declare TEST_HELPER_INSTALLS rather than calling a
function exported by testcase.prf. load(testcase) may be unsafe, as
testcase.prf should be processed after default_post.prf.
Fixes silent disabling of various autotests.
Change-Id: I56b35ffd653a637ad5ab18d64dd1a1edadfac59f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Kurt Korbatits <kurt.korbatits@nokia.com>
Diffstat (limited to 'mkspecs')
-rw-r--r-- | mkspecs/features/testcase.prf | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf index c07688231a..f76018a6e4 100644 --- a/mkspecs/features/testcase.prf +++ b/mkspecs/features/testcase.prf @@ -76,7 +76,7 @@ QMAKE_EXTRA_TARGETS *= check } contains(INSTALLS, target) { - # Install testdata as well, but only if we're actually installing the test. + # 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 # binary itself, e.g. this: @@ -123,32 +123,36 @@ contains(INSTALLS, target) { INSTALLS += $$tdi } -} - -} # have_target -defineTest(installTestHelperApp) { - # args: relativeSource, relativeDestination, targetName - # description: install executables from other project directories as part of your installation. - # relativeSource - file to install including relative path - # relativeDestination - relative directory to install to - # targetName - executable without extension - targetName = $$replace(3, ' ', '_') # handle spaces in name - subTarget = $${targetName}.target - subInstall = $${targetName}_install - subConfig = $${subInstall}.CONFIG - subFiles = $${subInstall}.files - subPath = $${subInstall}.path + # TEST_HELPER_INSTALLS specifies additional test helper executables for installation. + # + # Typical usage is: + # + # TEST_HELPER_INSTALLS += ../some/helper1 ../some/helper2 + # + # Resulting in the test helpers being installed to: + # + # $$[QT_INSTALL_TESTS]/$$TARGET/some/helper1 + # $$[QT_INSTALL_TESTS]/$$TARGET/some/helper2 + # win32: extension = .exe - $$subTarget = $${2}/$${3}$${extension} - $$subFiles = $${OUT_PWD}/$${1}$${extension} - $$subPath = $${target.path}/$${2} - $$subConfig += no_check_exist executable - INSTALLS += $${subInstall} - export(INSTALLS) - export($$subTarget) - export($$subFiles) - export($$subPath) - export($$subConfig) + for(test_helper, TEST_HELPER_INSTALLS) { + test_helper_dir = $$dirname(test_helper) + output = $$basename(test_helper_dir) + target = $$basename(test_helper) + targetName = $$replace(target, ' ', '_') # handle spaces in name + subTarget = $${targetName}.target + subInstall = $${targetName}_install + subConfig = $${subInstall}.CONFIG + subFiles = $${subInstall}.files + subPath = $${subInstall}.path + $$subTarget = $${output}/$${target}$${extension} + $$subFiles = $${OUT_PWD}/$${test_helper}$${extension} + $$subPath = $${target.path}/$${output} + $$subConfig += no_check_exist executable + INSTALLS += $${subInstall} + } } +} # have_target + |