1TARGET = QtTest
2QT = core-private
3CONFIG += exceptions
4
5MODULE_CONFIG = console testlib_defines
6
7unix:!embedded:QMAKE_PKGCONFIG_DESCRIPTION = Qt \
8    Unit \
9    Testing \
10    Library
11
12QMAKE_DOCS = $$PWD/doc/qttestlib.qdocconf
13
14HEADERS = \
15    qabstracttestlogger_p.h \
16    qbenchmark.h \
17    qbenchmark_p.h \
18    qbenchmarkmeasurement_p.h \
19    qbenchmarktimemeasurers_p.h \
20    qbenchmarkevent_p.h \
21    qbenchmarkperfevents_p.h \
22    qbenchmarkmetric.h \
23    qbenchmarkmetric_p.h \
24    qcsvbenchmarklogger_p.h \
25    qplaintestlogger_p.h \
26    qsignaldumper_p.h \
27    qsignalspy.h \
28    qteamcitylogger_p.h \
29    qtestaccessible.h \
30    qtestassert.h \
31    qtestcase.h \
32    qtestcoreelement_p.h \
33    qtestcorelist_p.h \
34    qtestdata.h \
35    qtestevent.h \
36    qtesteventloop.h \
37    qtest_gui.h \
38    qtest_network.h \
39    qtest_widgets.h \
40    qtest.h \
41    qtestelement_p.h \
42    qtestelementattribute_p.h \
43    qtestkeyboard.h \
44    qtestlog_p.h \
45    qtestmouse.h \
46    qtestresult_p.h \
47    qtestspontaneevent.h \
48    qtestsystem.h \
49    qtesttable_p.h \
50    qtesttouch.h \
51    qtestblacklist_p.h \
52    qtesthelpers_p.h \
53    qttestglobal.h \
54    qtestjunitstreamer_p.h \
55    qtaptestlogger_p.h \
56    qxmltestlogger_p.h \
57    qjunittestlogger_p.h
58
59SOURCES = \
60    qtestcase.cpp \
61    qtestlog.cpp \
62    qtesttable.cpp \
63    qtestdata.cpp \
64    qtestresult.cpp \
65    qasciikey.cpp \
66    qplaintestlogger.cpp \
67    qxmltestlogger.cpp \
68    qsignaldumper.cpp \
69    qabstracttestlogger.cpp \
70    qbenchmark.cpp \
71    qbenchmarkmeasurement.cpp \
72    qbenchmarkevent.cpp \
73    qbenchmarkperfevents.cpp \
74    qbenchmarkmetric.cpp \
75    qcsvbenchmarklogger.cpp \
76    qteamcitylogger.cpp \
77    qtestelement.cpp \
78    qtestelementattribute.cpp \
79    qtestmouse.cpp \
80    qtestjunitstreamer.cpp \
81    qjunittestlogger.cpp \
82    qtestblacklist.cpp \
83    qtaptestlogger.cpp
84
85qtConfig(itemmodeltester) {
86    HEADERS += \
87        qabstractitemmodeltester.h
88
89    SOURCES += \
90        qabstractitemmodeltester.cpp
91}
92
93qtConfig(valgrind) {
94    HEADERS += \
95        qbenchmarkvalgrind_p.h
96    SOURCES += \
97        qbenchmarkvalgrind.cpp
98}
99
100DEFINES *= QT_NO_CAST_TO_ASCII \
101    QT_NO_CAST_FROM_ASCII \
102    QT_NO_FOREACH \
103    QT_NO_DATASTREAM
104embedded:QMAKE_CXXFLAGS += -fno-rtti
105
106mac {
107    LIBS += -framework Security
108
109    SOURCES += qappletestlogger.cpp
110    HEADERS += qappletestlogger_p.h
111
112    macos {
113        HEADERS += qtestutil_macos_p.h
114        OBJECTIVE_SOURCES += qtestutil_macos.mm
115        LIBS += -framework Foundation -framework ApplicationServices -framework IOKit -framework AppKit
116    }
117
118    # XCTest support (disabled for now)
119    false:!lessThan(QMAKE_XCODE_VERSION, "6.0") {
120        OBJECTIVE_SOURCES += qxctestlogger.mm
121        HEADERS += qxctestlogger_p.h
122
123        DEFINES += HAVE_XCTEST
124        LIBS += -framework Foundation
125
126        load(sdk)
127        !isEmpty(QMAKE_MAC_SDK_PLATFORM_PATH) {
128            platform_dev_frameworks_path = $${QMAKE_MAC_SDK_PLATFORM_PATH}/Developer/Library/Frameworks
129
130            # We can't put this path into LIBS (so that it propagates to the prl file), as we
131            # don't know yet if the target that links to testlib will build under Xcode or not.
132            # The corresponding flags for the target lives in xctest.prf, where we do know.
133            QMAKE_LFLAGS += -F$${platform_dev_frameworks_path} -weak_framework XCTest
134            QMAKE_CXXFLAGS += -F$${platform_dev_frameworks_path}
135            MODULE_CONFIG += xctest
136        }
137    }
138}
139
140# Exclude these headers from the clean check if their dependencies aren't
141# being built
142!qtHaveModule(gui) {
143    HEADERSCLEAN_EXCLUDE += qtest_gui.h \
144        qtestaccessible.h \
145        qtestkeyboard.h \
146        qtestmouse.h \
147        qtesttouch.h
148}
149
150!qtHaveModule(widgets): HEADERSCLEAN_EXCLUDE += qtest_widgets.h
151
152!qtHaveModule(network): HEADERSCLEAN_EXCLUDE += qtest_network.h
153
154include(selfcover.pri)
155load(qt_module)
156