CMakeLists.txt 9.8 KB
Newer Older
M
Minghao Li 已提交
1 2
add_executable(syncTest "")
add_executable(syncEnvTest "")
M
Minghao Li 已提交
3
add_executable(syncPingTimerTest "")
M
sync io  
Minghao Li 已提交
4 5
add_executable(syncIOTickQTest "")
add_executable(syncIOTickPingTest "")
M
sync io  
Minghao Li 已提交
6
add_executable(syncIOSendMsgTest "")
M
Minghao Li 已提交
7 8
add_executable(syncIOClientTest "")
add_executable(syncIOServerTest "")
M
Minghao Li 已提交
9
add_executable(syncRaftStoreTest "")
M
Minghao Li 已提交
10
add_executable(syncEnqTest "")
M
Minghao Li 已提交
11
add_executable(syncIndexTest "")
M
Minghao Li 已提交
12
add_executable(syncInitTest "")
M
Minghao Li 已提交
13
add_executable(syncUtilTest "")
M
Minghao Li 已提交
14
add_executable(syncVotesGrantedTest "")
M
Minghao Li 已提交
15
add_executable(syncVotesRespondTest "")
M
Minghao Li 已提交
16
add_executable(syncIndexMgrTest "")
M
Minghao Li 已提交
17
add_executable(syncLogStoreTest "")
M
Minghao Li 已提交
18
add_executable(syncEntryTest "")
M
Minghao Li 已提交
19 20 21 22
add_executable(syncRequestVoteTest "")
add_executable(syncRequestVoteReplyTest "")
add_executable(syncAppendEntriesTest "")
add_executable(syncAppendEntriesReplyTest "")
M
Minghao Li 已提交
23 24
add_executable(syncClientRequestTest "")
add_executable(syncTimeoutTest "")
M
Minghao Li 已提交
25 26
add_executable(syncPingTest "")
add_executable(syncPingReplyTest "")
M
Minghao Li 已提交
27
add_executable(syncRpcMsgTest "")
M
Minghao Li 已提交
28 29
add_executable(syncPingTimerTest2 "")
add_executable(syncPingSelfTest "")
M
Minghao Li 已提交
30
add_executable(syncElectTest "")
M
Minghao Li 已提交
31
add_executable(syncEncodeTest "")
M
Minghao Li 已提交
32 33 34 35 36 37 38 39 40 41


target_sources(syncTest
    PRIVATE
    "syncTest.cpp"
)
target_sources(syncEnvTest
    PRIVATE
    "syncEnvTest.cpp"
)
M
Minghao Li 已提交
42
target_sources(syncPingTimerTest
M
Minghao Li 已提交
43
    PRIVATE
M
Minghao Li 已提交
44
    "syncPingTimerTest.cpp"
M
Minghao Li 已提交
45
)
M
sync io  
Minghao Li 已提交
46
target_sources(syncIOTickQTest
M
sync io  
Minghao Li 已提交
47
    PRIVATE
M
sync io  
Minghao Li 已提交
48
    "syncIOTickQTest.cpp"
M
sync io  
Minghao Li 已提交
49
)
M
sync io  
Minghao Li 已提交
50
target_sources(syncIOTickPingTest
M
sync io  
Minghao Li 已提交
51
    PRIVATE
M
sync io  
Minghao Li 已提交
52
    "syncIOTickPingTest.cpp"
M
sync io  
Minghao Li 已提交
53
)
M
sync io  
Minghao Li 已提交
54 55 56 57
target_sources(syncIOSendMsgTest
    PRIVATE
    "syncIOSendMsgTest.cpp"
)
M
Minghao Li 已提交
58
target_sources(syncIOClientTest
M
sync io  
Minghao Li 已提交
59
    PRIVATE
M
Minghao Li 已提交
60
    "syncIOClientTest.cpp"
M
sync io  
Minghao Li 已提交
61
)
M
Minghao Li 已提交
62
target_sources(syncIOServerTest
M
sync io  
Minghao Li 已提交
63
    PRIVATE
M
Minghao Li 已提交
64
    "syncIOServerTest.cpp"
M
sync io  
Minghao Li 已提交
65
)
M
Minghao Li 已提交
66 67 68 69
target_sources(syncRaftStoreTest
    PRIVATE
    "syncRaftStoreTest.cpp"
)
M
Minghao Li 已提交
70 71 72 73
target_sources(syncEnqTest
    PRIVATE
    "syncEnqTest.cpp"
)
M
Minghao Li 已提交
74 75 76 77
target_sources(syncIndexTest
    PRIVATE
    "syncIndexTest.cpp"
)
M
Minghao Li 已提交
78 79 80 81
target_sources(syncInitTest
    PRIVATE
    "syncInitTest.cpp"
)
M
Minghao Li 已提交
82 83 84 85
target_sources(syncUtilTest
    PRIVATE
    "syncUtilTest.cpp"
)
M
Minghao Li 已提交
86 87 88 89
target_sources(syncVotesGrantedTest
    PRIVATE
    "syncVotesGrantedTest.cpp"
)
M
Minghao Li 已提交
90 91 92 93
target_sources(syncVotesRespondTest
    PRIVATE
    "syncVotesRespondTest.cpp"
)
M
Minghao Li 已提交
94 95 96 97
target_sources(syncIndexMgrTest
    PRIVATE
    "syncIndexMgrTest.cpp"
)
M
Minghao Li 已提交
98 99 100 101
target_sources(syncLogStoreTest
    PRIVATE
    "syncLogStoreTest.cpp"
)
M
Minghao Li 已提交
102 103 104 105
target_sources(syncEntryTest
    PRIVATE
    "syncEntryTest.cpp"
)
M
Minghao Li 已提交
106
target_sources(syncRequestVoteTest
M
Minghao Li 已提交
107
    PRIVATE
M
Minghao Li 已提交
108
    "syncRequestVoteTest.cpp"
M
Minghao Li 已提交
109
)
M
Minghao Li 已提交
110
target_sources(syncRequestVoteReplyTest
M
Minghao Li 已提交
111
    PRIVATE
M
Minghao Li 已提交
112 113 114 115 116 117 118 119 120
    "syncRequestVoteReplyTest.cpp"
)
target_sources(syncAppendEntriesTest
    PRIVATE
    "syncAppendEntriesTest.cpp"
)
target_sources(syncAppendEntriesReplyTest
    PRIVATE
    "syncAppendEntriesReplyTest.cpp"
M
Minghao Li 已提交
121
)
M
Minghao Li 已提交
122 123 124 125 126 127 128 129
target_sources(syncClientRequestTest
    PRIVATE
    "syncClientRequestTest.cpp"
)
target_sources(syncTimeoutTest
    PRIVATE
    "syncTimeoutTest.cpp"
)
M
Minghao Li 已提交
130 131 132 133 134 135 136 137
target_sources(syncPingTest
    PRIVATE
    "syncPingTest.cpp"
)
target_sources(syncPingReplyTest
    PRIVATE
    "syncPingReplyTest.cpp"
)
M
Minghao Li 已提交
138 139 140 141
target_sources(syncRpcMsgTest
    PRIVATE
    "syncRpcMsgTest.cpp"
)
M
Minghao Li 已提交
142 143 144 145 146 147 148 149
target_sources(syncPingTimerTest2
    PRIVATE
    "syncPingTimerTest2.cpp"
)
target_sources(syncPingSelfTest
    PRIVATE
    "syncPingSelfTest.cpp"
)
M
Minghao Li 已提交
150 151 152 153
target_sources(syncElectTest
    PRIVATE
    "syncElectTest.cpp"
)
M
Minghao Li 已提交
154 155 156 157
target_sources(syncEncodeTest
    PRIVATE
    "syncEncodeTest.cpp"
)
M
Minghao Li 已提交
158 159 160 161 162 163 164 165 166 167 168 169


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"
)
M
Minghao Li 已提交
170
target_include_directories(syncPingTimerTest
M
Minghao Li 已提交
171 172 173 174
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
sync io  
Minghao Li 已提交
175
target_include_directories(syncIOTickQTest
M
sync io  
Minghao Li 已提交
176 177 178 179
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
sync io  
Minghao Li 已提交
180
target_include_directories(syncIOTickPingTest
M
sync io  
Minghao Li 已提交
181 182 183 184
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
sync io  
Minghao Li 已提交
185 186 187 188 189
target_include_directories(syncIOSendMsgTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
190
target_include_directories(syncIOClientTest
M
sync io  
Minghao Li 已提交
191 192 193 194
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
195
target_include_directories(syncIOServerTest
M
sync io  
Minghao Li 已提交
196 197 198 199
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
200 201 202 203 204
target_include_directories(syncRaftStoreTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
205 206 207 208 209
target_include_directories(syncEnqTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
210 211 212 213 214
target_include_directories(syncIndexTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
215 216 217 218 219
target_include_directories(syncInitTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
220 221 222 223 224
target_include_directories(syncUtilTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
225 226 227 228 229
target_include_directories(syncVotesGrantedTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
230 231 232 233 234
target_include_directories(syncVotesRespondTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
235 236 237 238 239
target_include_directories(syncIndexMgrTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
240 241 242 243 244
target_include_directories(syncLogStoreTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
245 246 247 248 249
target_include_directories(syncEntryTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
250 251 252 253 254 255 256 257 258 259 260
target_include_directories(syncRequestVoteTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
target_include_directories(syncRequestVoteReplyTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
target_include_directories(syncAppendEntriesTest
M
Minghao Li 已提交
261 262 263 264
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
265
target_include_directories(syncAppendEntriesReplyTest
M
Minghao Li 已提交
266 267 268 269
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
270 271 272 273 274 275 276 277 278 279
target_include_directories(syncClientRequestTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
target_include_directories(syncTimeoutTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
280 281 282 283 284 285 286 287 288 289
target_include_directories(syncPingTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
target_include_directories(syncPingReplyTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
290 291 292 293 294
target_include_directories(syncRpcMsgTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
295 296 297 298 299 300 301 302 303 304
target_include_directories(syncPingTimerTest2
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
target_include_directories(syncPingSelfTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
305 306 307 308 309 310 311 312 313 314
target_include_directories(syncElectTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
target_include_directories(syncElectTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
315 316 317 318 319
target_include_directories(syncEncodeTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
320 321 322 323 324 325 326 327 328 329


target_link_libraries(syncTest
    sync
    gtest_main
)
target_link_libraries(syncEnvTest
    sync
    gtest_main
)
M
Minghao Li 已提交
330
target_link_libraries(syncPingTimerTest
M
Minghao Li 已提交
331 332 333
    sync
    gtest_main
)
M
sync io  
Minghao Li 已提交
334
target_link_libraries(syncIOTickQTest
M
sync io  
Minghao Li 已提交
335 336 337
    sync
    gtest_main
)
M
sync io  
Minghao Li 已提交
338
target_link_libraries(syncIOTickPingTest
M
sync io  
Minghao Li 已提交
339 340 341
    sync
    gtest_main
)
M
sync io  
Minghao Li 已提交
342 343 344 345
target_link_libraries(syncIOSendMsgTest
    sync
    gtest_main
)
M
Minghao Li 已提交
346
target_link_libraries(syncIOClientTest
M
sync io  
Minghao Li 已提交
347 348 349
    sync
    gtest_main
)
M
Minghao Li 已提交
350
target_link_libraries(syncIOServerTest
M
sync io  
Minghao Li 已提交
351 352 353
    sync
    gtest_main
)
M
Minghao Li 已提交
354 355 356 357
target_link_libraries(syncRaftStoreTest
    sync
    gtest_main
)
M
Minghao Li 已提交
358 359 360 361
target_link_libraries(syncEnqTest
    sync
    gtest_main
)
M
Minghao Li 已提交
362 363 364 365
target_link_libraries(syncIndexTest
    sync
    gtest_main
)
M
Minghao Li 已提交
366 367 368 369
target_link_libraries(syncInitTest
    sync
    gtest_main
)
M
Minghao Li 已提交
370 371 372 373
target_link_libraries(syncUtilTest
    sync
    gtest_main
)
M
Minghao Li 已提交
374 375 376 377
target_link_libraries(syncVotesGrantedTest
    sync
    gtest_main
)
M
Minghao Li 已提交
378 379 380 381
target_link_libraries(syncVotesRespondTest
    sync
    gtest_main
)
M
Minghao Li 已提交
382 383 384 385
target_link_libraries(syncIndexMgrTest
    sync
    gtest_main
)
M
Minghao Li 已提交
386 387 388 389
target_link_libraries(syncLogStoreTest
    sync
    gtest_main
)
M
Minghao Li 已提交
390 391 392 393
target_link_libraries(syncEntryTest
    sync
    gtest_main
)
M
Minghao Li 已提交
394 395 396 397 398 399 400 401 402
target_link_libraries(syncRequestVoteTest
    sync
    gtest_main
)
target_link_libraries(syncRequestVoteReplyTest
    sync
    gtest_main
)
target_link_libraries(syncAppendEntriesTest
M
Minghao Li 已提交
403 404 405
    sync
    gtest_main
)
M
Minghao Li 已提交
406
target_link_libraries(syncAppendEntriesReplyTest
M
Minghao Li 已提交
407 408 409
    sync
    gtest_main
)
M
Minghao Li 已提交
410 411 412 413 414 415 416 417
target_link_libraries(syncClientRequestTest
    sync
    gtest_main
)
target_link_libraries(syncTimeoutTest
    sync
    gtest_main
)
M
Minghao Li 已提交
418 419 420 421 422 423 424 425
target_link_libraries(syncPingTest
    sync
    gtest_main
)
target_link_libraries(syncPingReplyTest
    sync
    gtest_main
)
M
Minghao Li 已提交
426 427 428 429
target_link_libraries(syncRpcMsgTest
    sync
    gtest_main
)
M
Minghao Li 已提交
430 431 432 433 434 435 436 437
target_link_libraries(syncPingTimerTest2
    sync
    gtest_main
)
target_link_libraries(syncPingSelfTest
    sync
    gtest_main
)
M
Minghao Li 已提交
438 439 440 441
target_link_libraries(syncElectTest
    sync
    gtest_main
)
M
Minghao Li 已提交
442 443 444 445
target_link_libraries(syncEncodeTest
    sync
    gtest_main
)
M
Minghao Li 已提交
446 447 448 449 450 451 452


enable_testing()
add_test(
    NAME sync_test
    COMMAND syncTest
)
M
Minghao Li 已提交
453 454