diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2010-05-31 00:22:24 (GMT) |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2010-06-02 23:09:30 (GMT) |
commit | 012a777ecec0ca74cf95683f069cb79774b7093a (patch) | |
tree | 6db403a7432643e1d9af1dc2c4bb4878d358d53c /mkspecs/features | |
parent | d29e1dda8fbc24087b9cf0bf08d929bef74f5c96 (diff) | |
download | Qt-012a777ecec0ca74cf95683f069cb79774b7093a.zip Qt-012a777ecec0ca74cf95683f069cb79774b7093a.tar.gz Qt-012a777ecec0ca74cf95683f069cb79774b7093a.tar.bz2 |
Fix `make check' for debug-and-release on Windows.
Diffstat (limited to 'mkspecs/features')
-rw-r--r-- | mkspecs/features/testcase.prf | 18 |
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) |