unittest.pro 6.08 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 \
68
    stringcache-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
69
    unittests-main.cpp \
Tim Jenssen's avatar
Tim Jenssen committed
70
    utf8-test.cpp \
71

72
!isEmpty(LIBCLANG_LIBS) {
73
SOURCES += \
Marco Bubke's avatar
Marco Bubke committed
74 75
    activationsequencecontextprocessor-test.cpp \
    activationsequenceprocessor-test.cpp \
76
    chunksreportedmonitor.cpp \
Marco Bubke's avatar
Marco Bubke committed
77 78
    clangasyncjob-base.cpp \
    clangcodecompleteresults-test.cpp \
Nikolai Kosjar's avatar
Nikolai Kosjar committed
79
    clangcodemodelserver-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
80 81 82 83
    clangcompletecodejob-test.cpp \
    clangcompletioncontextanalyzer-test.cpp \
    clangcreateinitialdocumentpreamblejob-test.cpp \
    clangdiagnosticfilter-test.cpp \
84 85
    clangdocumentprocessors-test.cpp \
    clangdocumentprocessor-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
86 87 88 89 90 91
    clangdocuments-test.cpp \
    clangdocument-test.cpp \
    clangfixitoperation-test.cpp \
    clangisdiagnosticrelatedtolocation-test.cpp \
    clangjobqueue-test.cpp \
    clangjobs-test.cpp \
92 93 94
    clangparsesupportivetranslationunitjob-test.cpp \
    clangreferencescollector-test.cpp \
    clangreparsesupportivetranslationunitjob-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
95
    clangrequestdocumentannotationsjob-test.cpp \
96
    clangrequestreferencesjob-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
97
    clangstring-test.cpp \
98
    clangsupportivetranslationunitinitializer-test.cpp \
99
    clangtranslationunits-test.cpp \
100
    clangtranslationunit-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
101
    clangupdatedocumentannotationsjob-test.cpp \
102
    codecompleter-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
    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 \
126
    utf8positionfromlinecolumn-test.cpp \
127 128
}

129
!isEmpty(LIBTOOLING_LIBS) {
130
SOURCES += \
131
    clangquerygatherer-test.cpp \
Tim Jenssen's avatar
Tim Jenssen committed
132
    clangqueryprojectfindfilter-test.cpp \
133 134 135 136
    clangquery-test.cpp \
    gtest-clang-printing.cpp \
    includecollector-test.cpp \
    pchcreator-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
137 138 139 140 141
    refactoringclientserverinprocess-test.cpp \
    refactoringclient-test.cpp \
    refactoringcompilationdatabase-test.cpp \
    refactoringengine-test.cpp \
    refactoringserver-test.cpp \
Tim Jenssen's avatar
Tim Jenssen committed
142
    sourcerangeextractor-test.cpp \
143
    symbolfinder-test.cpp \
Marco Bubke's avatar
Marco Bubke committed
144
    testclangtool.cpp \
145
}
Marco Bubke's avatar
Marco Bubke committed
146 147 148

exists($$GOOGLEBENCHMARK_DIR) {
SOURCES += \
Marco Bubke's avatar
Marco Bubke committed
149
    smallstring-benchmark.cpp
Marco Bubke's avatar
Marco Bubke committed
150
}
151 152

HEADERS += \
153 154 155 156 157 158
    compare-operators.h \
    conditionally-disabled-tests.h \
    dummyclangipcclient.h \
    dynamicastmatcherdiagnosticcontainer-matcher.h \
    fakeprocess.h \
    faketimer.h \
Marco Bubke's avatar
Marco Bubke committed
159 160
    filesystem-utilities.h \
    googletest.h \
161
    gtest-creator-printing.h \
162
    gtest-qt-printing.h \
163
    mimedatabase-utilities.h \
164 165 166
    mockchangedfilepathcompressor.h \
    mockclangcodemodelclient.h \
    mockclangcodemodelserver.h \
Marco Bubke's avatar
Marco Bubke committed
167
    mockclangpathwatcher.h \
168
    mockclangpathwatchernotifier.h \
169
    mockpchcreator.h \
Marco Bubke's avatar
Marco Bubke committed
170
    mockpchgeneratornotifier.h \
171 172
    mockpchmanagerclient.h \
    mockpchmanagernotifier.h \
173 174 175 176 177 178 179 180 181 182 183
    mockpchmanagerserver.h \
    mockprojectparts.h \
    mockqfilesystemwatcher.h \
    mocksearch.h \
    mocksearchhandle.h \
    mocksearchresult.h \
    mocksyntaxhighligher.h \
    processevents-utilities.h \
    sourcerangecontainer-matcher.h \
    spydummy.h \
    testenvironment.h \
184

185
!isEmpty(LIBCLANG_LIBS) {
186 187
HEADERS += \
    chunksreportedmonitor.h \
Marco Bubke's avatar
Marco Bubke committed
188
    clangasyncjob-base.h \
189
    clangcompareoperators.h \
Marco Bubke's avatar
Marco Bubke committed
190
    diagnosticcontainer-matcher.h \
191 192
}

193
!isEmpty(LIBTOOLING_LIBS) {
194
HEADERS += \
195
    gtest-clang-printing.h \
Marco Bubke's avatar
Marco Bubke committed
196 197
    mockrefactoringclientcallback.h \
    mockrefactoringclient.h \
Tim Jenssen's avatar
Tim Jenssen committed
198
    mockrefactoringserver.h \
199
    testclangtool.h \
200
}
201

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