summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/testcase.prf
diff options
context:
space:
mode:
authorQt by Nokia <qt-info@nokia.com>2011-04-27 12:05:43 +0200
committeraxis <qt-info@nokia.com>2011-04-27 12:05:43 +0200
commit38be0d13830efd2d98281c645c3a60afe05ffece (patch)
tree6ea73f3ec77f7d153333779883e8120f82820abe /mkspecs/features/testcase.prf
Initial import from the monolithic Qt.
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12
Diffstat (limited to 'mkspecs/features/testcase.prf')
-rw-r--r--mkspecs/features/testcase.prf65
1 files changed, 65 insertions, 0 deletions
diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf
new file mode 100644
index 0000000000..7a7c9e305a
--- /dev/null
+++ b/mkspecs/features/testcase.prf
@@ -0,0 +1,65 @@
+!contains(TEMPLATE,subdirs) {
+
+check.files =
+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.
+# 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)
+
+macx {
+ app_bundle: check.commands += ./$(QMAKE_TARGET).app/Contents/MacOS/$(QMAKE_TARGET)
+ else: check.commands += ./$(QMAKE_TARGET)
+}
+else:unix: check.commands += ./$(QMAKE_TARGET)
+else: check.commands += $(DESTDIR_TARGET)
+
+# For Qt/Embedded, run every test app as a QWS server
+embedded: check.commands += -qws
+
+# Allow for custom arguments to tests
+check.commands += $(TESTARGS)
+QMAKE_EXTRA_TARGETS *= check
+
+!debug_and_release|build_pass {
+ check.depends = first
+} else {
+ check.CONFIG = recursive
+ # In debug and release mode, only run the test once.
+ # Run debug if available, release otherwise.
+ debug_and_release {
+ check.target = dummy_check
+ check.recurse_target = check
+ debug {
+ real_check.depends = debug-check
+ real_check.target = check
+ QMAKE_EXTRA_TARGETS += real_check
+ } else {
+ real_check.depends = release-check
+ real_check.target = check
+ QMAKE_EXTRA_TARGETS += real_check
+ }
+ }
+}
+
+}
+