|
| 1 | +!contains(TEMPLATE,subdirs) { |
| 2 | + |
| 3 | +check.files = |
| 4 | +check.path = . |
| 5 | + |
| 6 | +# If the test ends up in a different directory, we should cd to that directory. |
| 7 | +# Note that qmake modifies DESTDIR after this file is processed, |
| 8 | +# therefore, testing DESTDIR for emptiness is not sufficient. |
| 9 | +!isEmpty(DESTDIR):!contains(DESTDIR,^\./?): check.commands = cd $(DESTDIR) && |
| 10 | +contains(TARGET,.*/.*): check.commands = cd $(DESTDIR) && |
| 11 | + |
| 12 | +# Allow for a custom test runner script |
| 13 | +check.commands += $(TESTRUNNER) |
| 14 | + |
| 15 | +macx { |
| 16 | + app_bundle: check.commands += ./$(QMAKE_TARGET).app/Contents/MacOS/$(QMAKE_TARGET) |
| 17 | + else: check.commands += ./$(QMAKE_TARGET) |
| 18 | +} |
| 19 | +else:unix: check.commands += ./$(QMAKE_TARGET) |
| 20 | +else: check.commands += $(DESTDIR_TARGET) |
| 21 | + |
| 22 | +# For Qt/Embedded, run every test app as a QWS server |
| 23 | +embedded: check.commands += -qws |
| 24 | + |
| 25 | +# Allow for custom arguments to tests |
| 26 | +check.commands += $(TESTARGS) |
| 27 | +QMAKE_EXTRA_TARGETS *= check |
| 28 | + |
| 29 | +!debug_and_release|build_pass { |
| 30 | + check.depends = first |
| 31 | +} else { |
| 32 | + check.CONFIG = recursive |
| 33 | + # In debug and release mode, only run the test once. |
| 34 | + # Run debug if available, release otherwise. |
| 35 | + debug_and_release { |
| 36 | + check.target = dummy_check |
| 37 | + check.recurse_target = check |
| 38 | + debug { |
| 39 | + real_check.depends = debug-check |
| 40 | + real_check.target = check |
| 41 | + QMAKE_EXTRA_TARGETS += real_check |
| 42 | + } else { |
| 43 | + real_check.depends = release-check |
| 44 | + real_check.target = check |
| 45 | + QMAKE_EXTRA_TARGETS += real_check |
| 46 | + } |
| 47 | + } |
| 48 | +} |
| 49 | + |
| 50 | +} |
| 51 | + |
0 commit comments