summaryrefslogtreecommitdiffstats
path: root/mkspecs/features
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2010-05-22 07:54:33 (GMT)
committerRohan McGovern <rohan.mcgovern@nokia.com>2010-06-02 23:09:23 (GMT)
commitd29e1dda8fbc24087b9cf0bf08d929bef74f5c96 (patch)
tree28bafc7d451ae679504f7818e5b0bc0ca6209525 /mkspecs/features
parent55664a0ef4b88b67c9931c7d2f6853e5fa0a9716 (diff)
downloadQt-d29e1dda8fbc24087b9cf0bf08d929bef74f5c96.zip
Qt-d29e1dda8fbc24087b9cf0bf08d929bef74f5c96.tar.gz
Qt-d29e1dda8fbc24087b9cf0bf08d929bef74f5c96.tar.bz2
Move `check' target for autotests into testcase.prf
testcase.prf is installed, thus allowing `make check' to work outside of the Qt source tree.
Diffstat (limited to 'mkspecs/features')
-rw-r--r--mkspecs/features/qttest_p4.prf36
-rw-r--r--mkspecs/features/testcase.prf51
2 files changed, 52 insertions, 35 deletions
diff --git a/mkspecs/features/qttest_p4.prf b/mkspecs/features/qttest_p4.prf
index d2011d0..d1c7c2b 100644
--- a/mkspecs/features/qttest_p4.prf
+++ b/mkspecs/features/qttest_p4.prf
@@ -1,5 +1,5 @@
isEmpty(TEMPLATE):TEMPLATE=app
-CONFIG += qt warn_on console depend_includepath
+CONFIG += qt warn_on console depend_includepath testcase
qtAddLibrary(QtTest)
@@ -13,39 +13,5 @@ symbian:{
# prefix test binary with tst_
!contains(TARGET, ^tst_.*):TARGET = $$join(TARGET,,"tst_")
-
-check.files =
-check.path = .
-!isEmpty(DESTDIR): check.commands = cd ./$(DESTDIR) &&
-macx: check.commands += ./$(QMAKE_TARGET).app/Contents/MacOS/$(QMAKE_TARGET)
-else:unix: check.commands += ./$(QMAKE_TARGET)
-else:win32: {
- CONFIG(debug, debug|release):check.commands += $(DESTDIR_TARGET)
- else:check.commands += $(DESTDIR_TARGET)
-}
-embedded: check.commands += -qws
-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
- }
- }
-}
-
target.path += $$[QT_INSTALL_PREFIX]/tests/qt4
INSTALLS += target
diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf
new file mode 100644
index 0000000..db4f673
--- /dev/null
+++ b/mkspecs/features/testcase.prf
@@ -0,0 +1,51 @@
+!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.
+!isEmpty(DESTDIR):!contains(DESTDIR,^\./?): check.commands = cd $(DESTDIR) &&
+contains(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
+ }
+ }
+}
+
+}
+