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 <jake.petroules@petroules.com>
This commit is contained in:
Oswald Buddenhagen 2015-01-29 17:25:31 +01:00 committed by Liang Qi
parent cc4c684e03
commit 3fc27e7835
1 changed files with 4 additions and 3 deletions

View File

@ -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}