From 3fc27e7835b0a058c991c115cea53a4377f556fa Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 29 Jan 2015 17:25:31 +0100 Subject: fix env variable setup on unix for testcases when DESTDIR is set prepend the 'cd' command only after prepending the variables, as otherwise they'd apply to the cd command only. Task-number: QTBUG-44183 Change-Id: Ibf96a16ce2c9cd9c0e80ca3cd5433e64ec19b136 Reviewed-by: Jake Petroules --- mkspecs/features/testcase.prf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf index 6656d1b898..770afa3386 100644 --- a/mkspecs/features/testcase.prf +++ b/mkspecs/features/testcase.prf @@ -21,9 +21,6 @@ debug_and_release:debug_and_release_target { TEST_TARGET_DIR = $$relative_path($$absolute_path($$DESTDIR, $$OUT_PWD), $$absolute_path($$TESTRUN_CWD, $$OUT_PWD)) } -!isEmpty(TESTRUN_CWD):!contains(TESTRUN_CWD,^\\./?): \ - check.commands = cd $$shell_path($$TESTRUN_CWD) && - # Allow for a custom test runner script check.commands += $(TESTRUNNER) @@ -46,6 +43,10 @@ check.commands += $(TESTARGS) # Add environment for non-installed builds qtAddTargetEnv(check.commands, QT) +# This must happen after adding the environment. +!isEmpty(TESTRUN_CWD):!contains(TESTRUN_CWD, ^\\./?): \ + check.commands = cd $$shell_path($$TESTRUN_CWD) && $$check.commands + # If the test is marked as insignificant, discard the exit code insignificant_test:check.commands = -$${check.commands} -- cgit v1.2.3