|
1 ###################################################################### |
|
2 # hbtest.pri |
|
3 ###################################################################### |
|
4 |
|
5 isEmpty(TEMPLATE):TEMPLATE = app |
|
6 |
|
7 contains(TEMPLATE, .*subdirs$) { |
|
8 |
|
9 !contains(_PRO_FILE_PWD_, .*/fute$) { |
|
10 # recurse into subdirs |
|
11 test.CONFIG += recursive |
|
12 autotest.CONFIG += recursive |
|
13 citest.CONFIG += recursive |
|
14 } |
|
15 |
|
16 root { |
|
17 # compile all tests first at the root level |
|
18 !win32|CONFIG(debug, debug|release):test.depends = first |
|
19 !win32|CONFIG(debug, debug|release):autotest.depends = first |
|
20 !win32|CONFIG(debug, debug|release):citest.depends = first |
|
21 } |
|
22 |
|
23 } else { |
|
24 |
|
25 # Flag all the test binaries SMP-safe in Symbian |
|
26 symbian:MMP_RULES += SMPSAFE |
|
27 |
|
28 INCLUDEPATH += $$_PRO_FILE_PWD_ |
|
29 DEPENDPATH += $$_PRO_FILE_PWD_ |
|
30 |
|
31 QMAKE_RPATHDIR += $${HB_BUILD_DIR}/lib |
|
32 |
|
33 HB_TEST_INSTALL_DIR = $${HB_INSTALL_DIR}/tsrc/bin |
|
34 DEFINES += HB_BUILD_DIR=\"\\\"$${HB_BUILD_DIR}\\\"\" |
|
35 |
|
36 hbtestresources { |
|
37 LIBS += -L$${HB_BUILD_DIR}/lib -lHbTestResources |
|
38 } |
|
39 |
|
40 HB = $$lower($$unique(HB)) |
|
41 isEmpty(HB):HB = hbcore hbwidgets |
|
42 !contains(HB, "hbcore"):!contains(HB_NOMAKE_PARTS, hbcore): HB += hbcore |
|
43 contains(HB, "hbutils")|contains(HB, "hbinput")|contains(HB, "hbfeedback"): HB *= hbwidgets |
|
44 |
|
45 for(COLLECTION, HB) { |
|
46 isEqual(COLLECTION, hbcore) { |
|
47 !contains(HB_NOMAKE_PARTS, hbcore):hbAddLibrary(hbcore/HbCore) |
|
48 } else:isEqual(COLLECTION, hbwidgets) { |
|
49 !contains(HB_NOMAKE_PARTS, hbwidgets):hbAddLibrary(hbwidgets/HbWidgets) |
|
50 } else:isEqual(COLLECTION, hbutils) { |
|
51 !contains(HB_NOMAKE_PARTS, hbutils):hbAddLibrary(hbutils/HbUtils) |
|
52 } else:isEqual(COLLECTION, hbinput) { |
|
53 !contains(HB_NOMAKE_PARTS, hbinput):hbAddLibrary(hbinput/HbInput) |
|
54 } else:isEqual(COLLECTION, hbfeedback) { |
|
55 !contains(HB_NOMAKE_PARTS, hbfeedback):hbAddLibrary(hbfeedback/HbFeedback) |
|
56 } else { |
|
57 message(Unknown COLLECTION: $$COLLECTION) |
|
58 next() |
|
59 } |
|
60 } |
|
61 |
|
62 plugin { |
|
63 |
|
64 # nothing to do for plugins |
|
65 |
|
66 } else { |
|
67 |
|
68 unit_test = false |
|
69 perf_test = false |
|
70 loc_test = false |
|
71 contains(_PRO_FILE_PWD_, .*/tsrc/unit/.*):unit_test = true |
|
72 contains(_PRO_FILE_PWD_, .*/tsrc/performance/.*):perf_test = true |
|
73 contains(_PRO_FILE_PWD_, .*/tsrc/loc/.*):loc_test = true |
|
74 |
|
75 $$unit_test|$$perf_test|$$loc_test { |
|
76 |
|
77 # a runnable test |
|
78 HEADERS += hbtest.h |
|
79 CONFIG -= app_bundle |
|
80 CONFIG += qtestlib console |
|
81 |
|
82 $$perf_test:include($${HB_SOURCE_DIR}/tsrc/performance/shared/shared.pri) |
|
83 |
|
84 # TODO: cleanup test execution |
|
85 win32:DESTDIR = debug |
|
86 # only Makefile.Debug on win32: |
|
87 !win32|CONFIG(debug, debug|release):build_pass:!isEmpty(DESTDIR) { |
|
88 test.commands += cd $$DESTDIR && |
|
89 autotest.commands += cd $$DESTDIR && |
|
90 citest.commands += cd $$DESTDIR && |
|
91 } |
|
92 unix { |
|
93 exists( /usr/local/bin/launcher ) { |
|
94 test.commands += /usr/local/bin/launcher ./$(TARGET) |
|
95 autotest.commands += /usr/local/bin/launcher ./$(TARGET) -style plastique -xml -o $${HB_BUILD_DIR}/autotest/$(QMAKE_TARGET).xml |
|
96 citest.commands += /usr/local/bin/launcher ./$(TARGET) -style plastique -xunitxml -o $${HB_BUILD_DIR}/autotest/$(QMAKE_TARGET).xml |
|
97 } else { |
|
98 test.commands += ./$(TARGET) |
|
99 autotest.commands += ./$(TARGET) -style plastique -xml -o $${HB_BUILD_DIR}/autotest/$(QMAKE_TARGET).xml |
|
100 citest.commands += ./$(TARGET) -style plastique -xunitxml -o $${HB_BUILD_DIR}/autotest/$(QMAKE_TARGET).xml |
|
101 } |
|
102 } else:win32 { |
|
103 test.CONFIG += recursive |
|
104 autotest.CONFIG += recursive |
|
105 citest.CONFIG += recursive |
|
106 # only Makefile.Debug: |
|
107 win32-g++:!isEmpty(QMAKE_SH) { |
|
108 CONFIG(debug, debug|release):build_pass { |
|
109 test.commands += ./$(TARGET) |
|
110 autotest.commands += ./$(TARGET) -xml -o $${HB_BUILD_DIR}/autotest/$(QMAKE_TARGET).xml |
|
111 citest.commands += ./$(TARGET) -xunitxml -o $${HB_BUILD_DIR}/autotest/$(QMAKE_TARGET).xml |
|
112 } |
|
113 } else { |
|
114 CONFIG(debug, debug|release):build_pass { |
|
115 test.commands += $(TARGET) |
|
116 autotest.commands += $(TARGET) -xml -o $${HB_BUILD_DIR}/autotest/$(QMAKE_TARGET).xml |
|
117 citest.commands += $(TARGET) -xunitxml -o $${HB_BUILD_DIR}/autotest/$(QMAKE_TARGET).xml |
|
118 } |
|
119 } |
|
120 } |
|
121 |
|
122 $$unit_test { |
|
123 symbian:RSS_RULES = "group_name=\"HbUnitTests\";" |
|
124 else:target.path = $${HB_TEST_INSTALL_DIR}/unit |
|
125 } else:$$loc_test { |
|
126 symbian:RSS_RULES = "group_name=\"HbLocTests\";" |
|
127 else:target.path = $${HB_TEST_INSTALL_DIR}/loc |
|
128 } else:$$perf_test { |
|
129 symbian:RSS_RULES = "group_name=\"HbPerfApps\";" |
|
130 else:target.path = $${HB_TEST_INSTALL_DIR}/perf |
|
131 } else { |
|
132 symbian:RSS_RULES = "group_name=\"HbUnknown\";" |
|
133 else:target.path = $${HB_TEST_INSTALL_DIR}/unknown |
|
134 } |
|
135 !symbian:INSTALLS += target |
|
136 |
|
137 } else:contains(_PRO_FILE_PWD_, .*/fute/.*) { |
|
138 |
|
139 # a fute app |
|
140 target.path = $${HB_TEST_INSTALL_DIR}/fute |
|
141 INSTALLS += target |
|
142 symbian { |
|
143 RSS_RULES = "group_name=\"HbTestApps\";" |
|
144 } |
|
145 |
|
146 } |
|
147 } |
|
148 } |
|
149 |
|
150 !contains(QMAKE_EXTRA_TARGETS, test):QMAKE_EXTRA_TARGETS += test |
|
151 !contains(QMAKE_EXTRA_TARGETS, autotest)::QMAKE_EXTRA_TARGETS += autotest |
|
152 !contains(QMAKE_EXTRA_TARGETS, citest)::QMAKE_EXTRA_TARGETS += citest |
|
153 |