11 } |
11 } |
12 |
12 |
13 # prefix test binary with tst_ |
13 # prefix test binary with tst_ |
14 !contains(TARGET, ^tst_.*):TARGET = $$join(TARGET,,"tst_") |
14 !contains(TARGET, ^tst_.*):TARGET = $$join(TARGET,,"tst_") |
15 |
15 |
16 ######################################################################## |
|
17 # Use install rule to run test application. |
|
18 # This lets you do 'make install' on a test to both build and run it, |
|
19 # and lets you easily build and run all tests from the parent directory. |
|
20 # ---------------------------------------------------------------------- |
|
21 |
16 |
22 runme.files = |
17 check.files = |
23 runme.path = . |
18 check.path = . |
24 !isEmpty(DESTDIR): runme.commands = cd ./$(DESTDIR) && |
19 !isEmpty(DESTDIR): check.commands = cd ./$(DESTDIR) && |
25 macx: runme.commands += ./$(QMAKE_TARGET).app/Contents/MacOS/$(QMAKE_TARGET) |
20 macx: check.commands += ./$(QMAKE_TARGET).app/Contents/MacOS/$(QMAKE_TARGET) |
26 else:unix: runme.commands += ./$(QMAKE_TARGET) |
21 else:unix: check.commands += ./$(QMAKE_TARGET) |
27 else:win32: { |
22 else:win32: { |
28 CONFIG(debug, debug|release):runme.commands += debug\\$(QMAKE_TARGET) |
23 CONFIG(debug, debug|release):check.commands += $(DESTDIR_TARGET) |
29 else:runme.commands += release\\$(QMAKE_TARGET) |
24 else:check.commands += $(DESTDIR_TARGET) |
30 } |
25 } |
31 embedded: runme.commands += -qws |
26 embedded: check.commands += -qws |
32 INSTALLS += runme |
27 QMAKE_EXTRA_TARGETS += check |
33 |
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 } |
34 |
49 |
35 ######################################################################## |
50 target.path += $$[QT_INSTALL_PREFIX]/tests/qt4 |
|
51 INSTALLS += target |