CMakeLists.txt 6.5 KB
Newer Older
M
Minghao Li 已提交
1 2 3
add_executable(syncTest "")
add_executable(syncEnvTest "")
add_executable(syncPingTest "")
M
Minghao Li 已提交
4
add_executable(syncEncodeTest "")
M
sync io  
Minghao Li 已提交
5 6
add_executable(syncIOTickQTest "")
add_executable(syncIOTickPingTest "")
M
sync io  
Minghao Li 已提交
7 8 9
add_executable(syncIOSendMsgTest "")
add_executable(syncIOSendMsgClientTest "")
add_executable(syncIOSendMsgServerTest "")
M
Minghao Li 已提交
10
add_executable(syncRaftStoreTest "")
M
Minghao Li 已提交
11
add_executable(syncEnqTest "")
M
Minghao Li 已提交
12
add_executable(syncIndexTest "")
M
Minghao Li 已提交
13
add_executable(syncInitTest "")
M
Minghao Li 已提交
14
add_executable(syncUtilTest "")
M
Minghao Li 已提交
15
add_executable(syncVotesGrantedTest "")
M
Minghao Li 已提交
16
add_executable(syncVotesRespondTest "")
M
Minghao Li 已提交
17
add_executable(syncIndexMgrTest "")
M
Minghao Li 已提交
18
add_executable(syncLogStoreTest "")
M
Minghao Li 已提交
19
add_executable(syncEntryTest "")
M
Minghao Li 已提交
20
add_executable(syncRequestVote "")
M
Minghao Li 已提交
21
add_executable(syncRequestVoteReply "")
M
Minghao Li 已提交
22 23 24 25 26 27 28 29 30 31 32 33 34 35


target_sources(syncTest
    PRIVATE
    "syncTest.cpp"
)
target_sources(syncEnvTest
    PRIVATE
    "syncEnvTest.cpp"
)
target_sources(syncPingTest
    PRIVATE
    "syncPingTest.cpp"
)
M
Minghao Li 已提交
36 37 38 39
target_sources(syncEncodeTest
    PRIVATE
    "syncEncodeTest.cpp"
)
M
sync io  
Minghao Li 已提交
40
target_sources(syncIOTickQTest
M
sync io  
Minghao Li 已提交
41
    PRIVATE
M
sync io  
Minghao Li 已提交
42
    "syncIOTickQTest.cpp"
M
sync io  
Minghao Li 已提交
43
)
M
sync io  
Minghao Li 已提交
44
target_sources(syncIOTickPingTest
M
sync io  
Minghao Li 已提交
45
    PRIVATE
M
sync io  
Minghao Li 已提交
46
    "syncIOTickPingTest.cpp"
M
sync io  
Minghao Li 已提交
47
)
M
sync io  
Minghao Li 已提交
48 49 50 51 52 53 54 55 56 57 58 59
target_sources(syncIOSendMsgTest
    PRIVATE
    "syncIOSendMsgTest.cpp"
)
target_sources(syncIOSendMsgClientTest
    PRIVATE
    "syncIOSendMsgClientTest.cpp"
)
target_sources(syncIOSendMsgServerTest
    PRIVATE
    "syncIOSendMsgServerTest.cpp"
)
M
Minghao Li 已提交
60 61 62 63
target_sources(syncRaftStoreTest
    PRIVATE
    "syncRaftStoreTest.cpp"
)
M
Minghao Li 已提交
64 65 66 67
target_sources(syncEnqTest
    PRIVATE
    "syncEnqTest.cpp"
)
M
Minghao Li 已提交
68 69 70 71
target_sources(syncIndexTest
    PRIVATE
    "syncIndexTest.cpp"
)
M
Minghao Li 已提交
72 73 74 75
target_sources(syncInitTest
    PRIVATE
    "syncInitTest.cpp"
)
M
Minghao Li 已提交
76 77 78 79
target_sources(syncUtilTest
    PRIVATE
    "syncUtilTest.cpp"
)
M
Minghao Li 已提交
80 81 82 83
target_sources(syncVotesGrantedTest
    PRIVATE
    "syncVotesGrantedTest.cpp"
)
M
Minghao Li 已提交
84 85 86 87
target_sources(syncVotesRespondTest
    PRIVATE
    "syncVotesRespondTest.cpp"
)
M
Minghao Li 已提交
88 89 90 91
target_sources(syncIndexMgrTest
    PRIVATE
    "syncIndexMgrTest.cpp"
)
M
Minghao Li 已提交
92 93 94 95
target_sources(syncLogStoreTest
    PRIVATE
    "syncLogStoreTest.cpp"
)
M
Minghao Li 已提交
96 97 98 99
target_sources(syncEntryTest
    PRIVATE
    "syncEntryTest.cpp"
)
M
Minghao Li 已提交
100 101 102 103
target_sources(syncRequestVote
    PRIVATE
    "syncRequestVote.cpp"
)
M
Minghao Li 已提交
104 105 106 107
target_sources(syncRequestVoteReply
    PRIVATE
    "syncRequestVoteReply.cpp"
)
M
Minghao Li 已提交
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124


target_include_directories(syncTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
target_include_directories(syncEnvTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
target_include_directories(syncPingTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
125 126 127 128 129
target_include_directories(syncEncodeTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
sync io  
Minghao Li 已提交
130
target_include_directories(syncIOTickQTest
M
sync io  
Minghao Li 已提交
131 132 133 134
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
sync io  
Minghao Li 已提交
135
target_include_directories(syncIOTickPingTest
M
sync io  
Minghao Li 已提交
136 137 138 139
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
sync io  
Minghao Li 已提交
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
target_include_directories(syncIOSendMsgTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
target_include_directories(syncIOSendMsgClientTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
target_include_directories(syncIOSendMsgServerTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
155 156 157 158 159
target_include_directories(syncRaftStoreTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
160 161 162 163 164
target_include_directories(syncEnqTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
165 166 167 168 169
target_include_directories(syncIndexTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
170 171 172 173 174
target_include_directories(syncInitTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
175 176 177 178 179
target_include_directories(syncUtilTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
180 181 182 183 184
target_include_directories(syncVotesGrantedTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
185 186 187 188 189
target_include_directories(syncVotesRespondTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
190 191 192 193 194
target_include_directories(syncIndexMgrTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
195 196 197 198 199
target_include_directories(syncLogStoreTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
200 201 202 203 204
target_include_directories(syncEntryTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
205 206 207 208 209
target_include_directories(syncRequestVote
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
210 211 212 213 214
target_include_directories(syncRequestVoteReply
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
215 216 217 218 219 220 221 222 223 224 225 226 227 228


target_link_libraries(syncTest
    sync
    gtest_main
)
target_link_libraries(syncEnvTest
    sync
    gtest_main
)
target_link_libraries(syncPingTest
    sync
    gtest_main
)
M
Minghao Li 已提交
229 230 231 232
target_link_libraries(syncEncodeTest
    sync
    gtest_main
)
M
sync io  
Minghao Li 已提交
233
target_link_libraries(syncIOTickQTest
M
sync io  
Minghao Li 已提交
234 235 236
    sync
    gtest_main
)
M
sync io  
Minghao Li 已提交
237
target_link_libraries(syncIOTickPingTest
M
sync io  
Minghao Li 已提交
238 239 240
    sync
    gtest_main
)
M
sync io  
Minghao Li 已提交
241 242 243 244 245 246 247 248 249 250 251 252
target_link_libraries(syncIOSendMsgTest
    sync
    gtest_main
)
target_link_libraries(syncIOSendMsgClientTest
    sync
    gtest_main
)
target_link_libraries(syncIOSendMsgServerTest
    sync
    gtest_main
)
M
Minghao Li 已提交
253 254 255 256
target_link_libraries(syncRaftStoreTest
    sync
    gtest_main
)
M
Minghao Li 已提交
257 258 259 260
target_link_libraries(syncEnqTest
    sync
    gtest_main
)
M
Minghao Li 已提交
261 262 263 264
target_link_libraries(syncIndexTest
    sync
    gtest_main
)
M
Minghao Li 已提交
265 266 267 268
target_link_libraries(syncInitTest
    sync
    gtest_main
)
M
Minghao Li 已提交
269 270 271 272
target_link_libraries(syncUtilTest
    sync
    gtest_main
)
M
Minghao Li 已提交
273 274 275 276
target_link_libraries(syncVotesGrantedTest
    sync
    gtest_main
)
M
Minghao Li 已提交
277 278 279 280
target_link_libraries(syncVotesRespondTest
    sync
    gtest_main
)
M
Minghao Li 已提交
281 282 283 284
target_link_libraries(syncIndexMgrTest
    sync
    gtest_main
)
M
Minghao Li 已提交
285 286 287 288
target_link_libraries(syncLogStoreTest
    sync
    gtest_main
)
M
Minghao Li 已提交
289 290 291 292
target_link_libraries(syncEntryTest
    sync
    gtest_main
)
M
Minghao Li 已提交
293 294 295 296
target_link_libraries(syncRequestVote
    sync
    gtest_main
)
M
Minghao Li 已提交
297 298 299 300
target_link_libraries(syncRequestVoteReply
    sync
    gtest_main
)
M
Minghao Li 已提交
301 302 303 304 305 306 307


enable_testing()
add_test(
    NAME sync_test
    COMMAND syncTest
)
M
Minghao Li 已提交
308 309