diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2010-05-22 07:54:33 (GMT) |
---|---|---|
committer | João Abecasis <joao.abecasis@nokia.com> | 2011-01-17 15:20:26 (GMT) |
commit | 6aa5f3b94c6f94b85218f119fdb00e103b5ee442 (patch) | |
tree | 8f25c1823d4256c0a9c234dc303458250ca2dc64 | |
parent | 216f01fec8a8c0d63ea42c5b4f8b1d9f493a3f5e (diff) | |
download | Qt-6aa5f3b94c6f94b85218f119fdb00e103b5ee442.zip Qt-6aa5f3b94c6f94b85218f119fdb00e103b5ee442.tar.gz Qt-6aa5f3b94c6f94b85218f119fdb00e103b5ee442.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.
(cherry picked from commit d29e1dda8fbc24087b9cf0bf08d929bef74f5c96)
-rw-r--r-- | mkspecs/features/qttest_p4.prf | 36 | ||||
-rw-r--r-- | mkspecs/features/testcase.prf | 51 |
2 files changed, 52 insertions, 35 deletions
diff --git a/mkspecs/features/qttest_p4.prf b/mkspecs/features/qttest_p4.prf index e3faef1..0a78346 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 + } + } +} + +} + |