summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2010-05-31 00:22:24 (GMT)
committerJoão Abecasis <joao.abecasis@nokia.com>2011-01-17 15:34:37 (GMT)
commite0bb13cdbcbbe772478c961efc5476c47e1b8eae (patch)
treea011bf43eeb6927241321609058661eb4851965a
parent6aa5f3b94c6f94b85218f119fdb00e103b5ee442 (diff)
downloadQt-e0bb13cdbcbbe772478c961efc5476c47e1b8eae.zip
Qt-e0bb13cdbcbbe772478c961efc5476c47e1b8eae.tar.gz
Qt-e0bb13cdbcbbe772478c961efc5476c47e1b8eae.tar.bz2
Fix `make check' for debug-and-release on Windows.
(cherry picked from commit 012a777ecec0ca74cf95683f069cb79774b7093a)
-rw-r--r--mkspecs/features/testcase.prf18
1 files changed, 16 insertions, 2 deletions
diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf
index db4f673..2a56d7d 100644
--- a/mkspecs/features/testcase.prf
+++ b/mkspecs/features/testcase.prf
@@ -6,8 +6,22 @@ check.path = .
# If the test ends up in a different directory, we should cd to that directory.
# Note that qmake modifies DESTDIR after this file is processed,
# therefore, testing DESTDIR for emptiness is not sufficient.
-!isEmpty(DESTDIR):!contains(DESTDIR,^\./?): check.commands = cd $(DESTDIR) &&
-contains(TARGET,.*/.*): check.commands = cd $(DESTDIR) &&
+# Also note that in debug-and-release mode we don't want to cd into the debug/release
+# directory (e.g. if the test goes to foo/release/tst_thing.exe, we want to do
+# cd foo && release/tst_thing.exe ).
+MUNGED_DESTDIR=$$DESTDIR
+MUNGED_TARGET=$$TARGET
+win32:debug_and_release {
+ contains(DESTDIR,^release$)|contains(DESTDIR,^debug$):MUNGED_DESTDIR=
+
+ # In debug-and-release mode, the first ../ in TARGET breaks out of the debug/release
+ # subdirectory. However, since make's working directory is already outside of the
+ # debug/release subdirectory, this first ../ should be ignored when deciding if
+ # we have to change directory before running the test.
+ MUNGED_TARGET=$$replace(MUNGED_TARGET,^\.\./,)
+}
+!isEmpty(MUNGED_DESTDIR):!contains(MUNGED_DESTDIR,^\./?):check.commands = cd $(DESTDIR) &&
+contains(MUNGED_TARGET,.*/.*):check.commands = cd $(DESTDIR) &&
# Allow for a custom test runner script
check.commands += $(TESTRUNNER)