Skip to content

Commit 6aa5f3b

Browse files
Rohan McGovernJoão Abecasis
Rohan McGovern
authored and
João Abecasis
committed
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 d29e1dd)
1 parent 216f01f commit 6aa5f3b

File tree

2 files changed

+52
-35
lines changed

2 files changed

+52
-35
lines changed

mkspecs/features/qttest_p4.prf

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
isEmpty(TEMPLATE):TEMPLATE=app
2-
CONFIG += qt warn_on console depend_includepath
2+
CONFIG += qt warn_on console depend_includepath testcase
33

44
qtAddLibrary(QtTest)
55

@@ -13,39 +13,5 @@ symbian:{
1313
# prefix test binary with tst_
1414
!contains(TARGET, ^tst_.*):TARGET = $$join(TARGET,,"tst_")
1515

16-
17-
check.files =
18-
check.path = .
19-
!isEmpty(DESTDIR): check.commands = cd ./$(DESTDIR) &&
20-
macx: check.commands += ./$(QMAKE_TARGET).app/Contents/MacOS/$(QMAKE_TARGET)
21-
else:unix: check.commands += ./$(QMAKE_TARGET)
22-
else:win32: {
23-
CONFIG(debug, debug|release):check.commands += $(DESTDIR_TARGET)
24-
else:check.commands += $(DESTDIR_TARGET)
25-
}
26-
embedded: check.commands += -qws
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-
5016
target.path += $$[QT_INSTALL_PREFIX]/tests/qt4
5117
INSTALLS += target

mkspecs/features/testcase.prf

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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

Comments
 (0)