unittest.pro 7.03 KB
Newer Older
1
INCLUDEPATH += ../mockup
2

3 4 5 6
QT += core network testlib widgets
CONFIG += console c++14 testcase object_parallel_to_source
CONFIG -= app_bundle shared

7 8 9
include(gmock_dependency.pri)
include(clang_dependency.pri)
include(creator_dependency.pri)
10
include(benchmark_dependency.pri)
11

12 13
OBJECTS_DIR = $$OUT_PWD/obj # workaround for qmake bug in object_parallel_to_source

14
!msvc:force_debug_info:QMAKE_CXXFLAGS += -fno-omit-frame-pointer
15

16
DEFINES += \
Orgad Shaneh's avatar
Orgad Shaneh committed
17
    QT_RESTRICTED_CAST_FROM_ASCII \
18
    UNIT_TESTS \
19
    DONT_CHECK_MESSAGE_COUNTER \
20
    TESTDATA_DIR=\"R\\\"xxx($$PWD/data)xxx\\\"\"
21
msvc: QMAKE_CXXFLAGS_WARN_ON -= -w34100 # 'unreferenced formal parameter' in MATCHER_* functions
22 23 24
win32:DEFINES += ECHOSERVER=\"R\\\"xxx($$OUT_PWD/../echo)xxx\\\"\"
unix: DEFINES += ECHOSERVER=\"R\\\"xxx($$OUT_PWD/../echoserver/echo)xxx\\\"\"

25 26 27 28 29 30
linux {
QMAKE_LFLAGS_RELEASE = #disable optimization
QMAKE_LFLAGS += -fno-merge-debug-strings -fuse-ld=gold
CONFIG(release, debug|release):QMAKE_LFLAGS += -Wl,--strip-debug
}

31 32 33 34 35 36 37
# create fake CppTools.json for the mime type definitions
dependencyList = "\"Dependencies\" : []"
cpptoolsjson.input = $$PWD/../../../src/plugins/cpptools/CppTools.json.in
cpptoolsjson.output = $$OUT_PWD/CppTools.json
QMAKE_SUBSTITUTES += cpptoolsjson
DEFINES += CPPTOOLS_JSON=\"R\\\"xxx($${cpptoolsjson.output})xxx\\\"\"

38
SOURCES += \
39 40 41 42
    changedfilepathcompressor-test.cpp \
    clangpathwatcher-test.cpp \
    clangqueryexamplehighlightmarker-test.cpp \
    clangqueryhighlightmarker-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
43
    clientserverinprocess-test.cpp \
44
    clientserveroutsideprocess-test.cpp \
45
    cppprojectfilecategorizer-test.cpp \
46
    cppprojectinfogenerator-test.cpp \
47
    cppprojectpartchooser-test.cpp \
48 49 50 51 52 53 54
    fakeprocess.cpp \
    faketimer.cpp \
    filepath-test.cpp \
    gtest-creator-printing.cpp \
    gtest-qt-printing.cpp \
    lineprefixer-test.cpp \
    matchingtext-test.cpp \
55
    mimedatabase-utilities.cpp \
56 57 58 59 60 61 62
    pchgenerator-test.cpp \
    pchmanagerclientserverinprocess-test.cpp \
    pchmanagerclient-test.cpp \
    pchmanagerserver-test.cpp \
    processevents-utilities.cpp \
    projectparts-test.cpp \
    projectupdater-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
63 64 65
    readandwritemessageblock-test.cpp \
    sizedarray-test.cpp \
    smallstring-test.cpp \
66
    sourcerangefilter-test.cpp \
67
    spydummy.cpp \
Marco Bubke's avatar
Marco Bubke committed
68
    symbolindexer-test.cpp \
69
    stringcache-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
70
    unittests-main.cpp \
Marco Bubke's avatar
Marco Bubke committed
71 72
    utf8-test.cpp \
    symbolstorage-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
73 74
    mocksqlitereadstatement.cpp \
    symbolquery-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
75
    storagesqlitestatementfactory-test.cpp \
76
    sqliteindex-test.cpp \
77
    sqlitetransaction-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
78 79 80 81
    refactoringdatabaseinitializer-test.cpp \
    filepathcache-test.cpp \
    filepathstorage-test.cpp \
    filepathstoragesqlitestatementfactory-test.cpp
82

83
!isEmpty(LIBCLANG_LIBS) {
84
SOURCES += \
Marco Bubke's avatar
Marco Bubke committed
85 86
    activationsequencecontextprocessor-test.cpp \
    activationsequenceprocessor-test.cpp \
87
    chunksreportedmonitor.cpp \
Marco Bubke's avatar
Marco Bubke committed
88 89
    clangasyncjob-base.cpp \
    clangcodecompleteresults-test.cpp \
Nikolai Kosjar's avatar
Nikolai Kosjar committed
90
    clangcodemodelserver-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
91 92 93 94
    clangcompletecodejob-test.cpp \
    clangcompletioncontextanalyzer-test.cpp \
    clangcreateinitialdocumentpreamblejob-test.cpp \
    clangdiagnosticfilter-test.cpp \
95 96
    clangdocumentprocessors-test.cpp \
    clangdocumentprocessor-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
97
    clangdocuments-test.cpp \
98
    clangdocumentsuspenderresumer-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
99 100
    clangdocument-test.cpp \
    clangfixitoperation-test.cpp \
101
    clangfollowsymbol-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
102 103 104
    clangisdiagnosticrelatedtolocation-test.cpp \
    clangjobqueue-test.cpp \
    clangjobs-test.cpp \
105 106 107
    clangparsesupportivetranslationunitjob-test.cpp \
    clangreferencescollector-test.cpp \
    clangreparsesupportivetranslationunitjob-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
108
    clangrequestdocumentannotationsjob-test.cpp \
109
    clangrequestreferencesjob-test.cpp \
110
    clangresumedocumentjob-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
111
    clangstring-test.cpp \
112
    clangsupportivetranslationunitinitializer-test.cpp \
113
    clangsuspenddocumentjob-test.cpp \
114
    clangtranslationunits-test.cpp \
115
    clangtranslationunit-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
116
    clangupdatedocumentannotationsjob-test.cpp \
117
    codecompleter-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
    codecompletionsextractor-test.cpp \
    completionchunkstotextconverter-test.cpp \
    createtablesqlstatementbuilder-test.cpp \
    cursor-test.cpp \
    diagnosticset-test.cpp \
    diagnostic-test.cpp \
    fixit-test.cpp \
    highlightingmarksreporter-test.cpp \
    highlightingmarks-test.cpp \
    projectpart-test.cpp \
    senddocumenttracker-test.cpp \
    skippedsourceranges-test.cpp \
    sourcelocation-test.cpp \
    sourcerange-test.cpp \
    sqlitecolumn-test.cpp \
    sqlitedatabasebackend-test.cpp \
    sqlitedatabase-test.cpp \
    sqlitestatement-test.cpp \
    sqlitetable-test.cpp \
    sqlstatementbuilder-test.cpp \
    translationunitupdater-test.cpp \
    unsavedfiles-test.cpp \
    unsavedfile-test.cpp \
141
    utf8positionfromlinecolumn-test.cpp \
142 143
}

144
!isEmpty(LIBTOOLING_LIBS) {
145
SOURCES += \
146
    clangquerygatherer-test.cpp \
Tim Jenssen's avatar
Tim Jenssen committed
147
    clangqueryprojectfindfilter-test.cpp \
148 149 150 151
    clangquery-test.cpp \
    gtest-clang-printing.cpp \
    includecollector-test.cpp \
    pchcreator-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
152 153 154 155 156
    refactoringclientserverinprocess-test.cpp \
    refactoringclient-test.cpp \
    refactoringcompilationdatabase-test.cpp \
    refactoringengine-test.cpp \
    refactoringserver-test.cpp \
Tim Jenssen's avatar
Tim Jenssen committed
157
    sourcerangeextractor-test.cpp \
158
    symbolindexing-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
159
    symbolscollector-test.cpp \
160
    symbolfinder-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
161
    testclangtool.cpp \
162
}
Marco Bubke's avatar
Marco Bubke committed
163 164 165

exists($$GOOGLEBENCHMARK_DIR) {
SOURCES += \
Marco Bubke's avatar
Marco Bubke committed
166
    smallstring-benchmark.cpp
Marco Bubke's avatar
Marco Bubke committed
167
}
168 169

HEADERS += \
170 171 172 173 174 175
    compare-operators.h \
    conditionally-disabled-tests.h \
    dummyclangipcclient.h \
    dynamicastmatcherdiagnosticcontainer-matcher.h \
    fakeprocess.h \
    faketimer.h \
Marco Bubke's avatar
Marco Bubke committed
176 177
    filesystem-utilities.h \
    googletest.h \
178
    gtest-creator-printing.h \
179
    gtest-qt-printing.h \
180
    mimedatabase-utilities.h \
181 182 183
    mockchangedfilepathcompressor.h \
    mockclangcodemodelclient.h \
    mockclangcodemodelserver.h \
Marco Bubke's avatar
Marco Bubke committed
184
    mockclangpathwatcher.h \
185
    mockclangpathwatchernotifier.h \
186
    mockpchcreator.h \
Marco Bubke's avatar
Marco Bubke committed
187
    mockpchgeneratornotifier.h \
188 189
    mockpchmanagerclient.h \
    mockpchmanagernotifier.h \
190 191 192 193 194 195 196 197 198 199 200
    mockpchmanagerserver.h \
    mockprojectparts.h \
    mockqfilesystemwatcher.h \
    mocksearch.h \
    mocksearchhandle.h \
    mocksearchresult.h \
    mocksyntaxhighligher.h \
    processevents-utilities.h \
    sourcerangecontainer-matcher.h \
    spydummy.h \
    testenvironment.h \
Marco Bubke's avatar
Marco Bubke committed
201
    mocksymbolscollector.h \
Marco Bubke's avatar
Marco Bubke committed
202 203 204 205
    mocksymbolstorage.h \
    mocksqlitewritestatement.h \
    mocksqlitedatabase.h \
    mocksqlitereadstatement.h \
Marco Bubke's avatar
Marco Bubke committed
206
    google-using-declarations.h \
207
    mocksymbolindexing.h \
208
    sqliteteststatement.h \
Marco Bubke's avatar
Marco Bubke committed
209 210 211
    mockmutex.h \
    mockfilepathstorage.h \
    mockfilepathcaching.h \
212 213
    mocksqlitestatement.h \
    unittest-utility-functions.h
214

215
!isEmpty(LIBCLANG_LIBS) {
216 217
HEADERS += \
    chunksreportedmonitor.h \
Marco Bubke's avatar
Marco Bubke committed
218
    clangasyncjob-base.h \
219
    clangcompareoperators.h \
Marco Bubke's avatar
Marco Bubke committed
220
    diagnosticcontainer-matcher.h \
221 222
}

223
!isEmpty(LIBTOOLING_LIBS) {
224
HEADERS += \
225
    gtest-clang-printing.h \
Marco Bubke's avatar
Marco Bubke committed
226 227
    mockrefactoringclientcallback.h \
    mockrefactoringclient.h \
Tim Jenssen's avatar
Tim Jenssen committed
228
    mockrefactoringserver.h \
229
    testclangtool.h \
230
}
231

232
OTHER_FILES += $$files(data/*)