CMakeLists.txt 11.5 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(syncElectTest2 "")
M
Minghao Li 已提交
32
add_executable(syncElectTest3 "")
M
Minghao Li 已提交
33
add_executable(syncEncodeTest "")
M
Minghao Li 已提交
34
add_executable(syncWriteTest "")
M
Minghao Li 已提交
35
add_executable(syncReplicateTest "")
M
Minghao Li 已提交
36
add_executable(syncReplicateTest2 "")
M
Minghao Li 已提交
37
add_executable(syncRefTest "")
M
Minghao Li 已提交
38 39 40 41 42 43 44 45 46 47


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


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 已提交
200
target_include_directories(syncPingTimerTest
M
Minghao Li 已提交
201 202 203 204
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
sync io  
Minghao Li 已提交
205
target_include_directories(syncIOTickQTest
M
sync io  
Minghao Li 已提交
206 207 208 209
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
sync io  
Minghao Li 已提交
210
target_include_directories(syncIOTickPingTest
M
sync io  
Minghao Li 已提交
211 212 213 214
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
sync io  
Minghao Li 已提交
215 216 217 218 219
target_include_directories(syncIOSendMsgTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
220
target_include_directories(syncIOClientTest
M
sync io  
Minghao Li 已提交
221 222 223 224
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
225
target_include_directories(syncIOServerTest
M
sync io  
Minghao Li 已提交
226 227 228 229
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
230 231 232 233 234
target_include_directories(syncRaftStoreTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
235 236 237 238 239
target_include_directories(syncEnqTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
240 241 242 243 244
target_include_directories(syncIndexTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
245 246 247 248 249
target_include_directories(syncInitTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
250 251 252 253 254
target_include_directories(syncUtilTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
255 256 257 258 259
target_include_directories(syncVotesGrantedTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
260 261 262 263 264
target_include_directories(syncVotesRespondTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
265 266 267 268 269
target_include_directories(syncIndexMgrTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
270 271 272 273 274
target_include_directories(syncLogStoreTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
275 276 277 278 279
target_include_directories(syncEntryTest
    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 290
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 已提交
291 292 293 294
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
295
target_include_directories(syncAppendEntriesReplyTest
M
Minghao Li 已提交
296 297 298 299
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
300 301 302 303 304 305 306 307 308 309
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 已提交
310 311 312 313 314 315 316 317 318 319
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 已提交
320 321 322 323 324
target_include_directories(syncRpcMsgTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
325 326 327 328 329 330 331 332 333 334
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 已提交
335 336 337 338 339
target_include_directories(syncElectTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
340
target_include_directories(syncElectTest2
M
Minghao Li 已提交
341 342 343 344
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
345 346 347 348 349
target_include_directories(syncElectTest3
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
350 351 352 353 354
target_include_directories(syncEncodeTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
355 356 357 358 359
target_include_directories(syncWriteTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
360 361 362 363 364
target_include_directories(syncReplicateTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
365 366 367 368 369
target_include_directories(syncReplicateTest2
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
370 371 372 373 374
target_include_directories(syncRefTest
    PUBLIC
    "${CMAKE_SOURCE_DIR}/include/libs/sync"
    "${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
M
Minghao Li 已提交
375 376 377 378 379 380 381 382 383 384


target_link_libraries(syncTest
    sync
    gtest_main
)
target_link_libraries(syncEnvTest
    sync
    gtest_main
)
M
Minghao Li 已提交
385
target_link_libraries(syncPingTimerTest
M
Minghao Li 已提交
386 387 388
    sync
    gtest_main
)
M
sync io  
Minghao Li 已提交
389
target_link_libraries(syncIOTickQTest
M
sync io  
Minghao Li 已提交
390 391 392
    sync
    gtest_main
)
M
sync io  
Minghao Li 已提交
393
target_link_libraries(syncIOTickPingTest
M
sync io  
Minghao Li 已提交
394 395 396
    sync
    gtest_main
)
M
sync io  
Minghao Li 已提交
397 398 399 400
target_link_libraries(syncIOSendMsgTest
    sync
    gtest_main
)
M
Minghao Li 已提交
401
target_link_libraries(syncIOClientTest
M
sync io  
Minghao Li 已提交
402 403 404
    sync
    gtest_main
)
M
Minghao Li 已提交
405
target_link_libraries(syncIOServerTest
M
sync io  
Minghao Li 已提交
406 407 408
    sync
    gtest_main
)
M
Minghao Li 已提交
409 410 411 412
target_link_libraries(syncRaftStoreTest
    sync
    gtest_main
)
M
Minghao Li 已提交
413 414 415 416
target_link_libraries(syncEnqTest
    sync
    gtest_main
)
M
Minghao Li 已提交
417 418 419 420
target_link_libraries(syncIndexTest
    sync
    gtest_main
)
M
Minghao Li 已提交
421 422 423 424
target_link_libraries(syncInitTest
    sync
    gtest_main
)
M
Minghao Li 已提交
425 426 427 428
target_link_libraries(syncUtilTest
    sync
    gtest_main
)
M
Minghao Li 已提交
429 430 431 432
target_link_libraries(syncVotesGrantedTest
    sync
    gtest_main
)
M
Minghao Li 已提交
433 434 435 436
target_link_libraries(syncVotesRespondTest
    sync
    gtest_main
)
M
Minghao Li 已提交
437 438 439 440
target_link_libraries(syncIndexMgrTest
    sync
    gtest_main
)
M
Minghao Li 已提交
441 442 443 444
target_link_libraries(syncLogStoreTest
    sync
    gtest_main
)
M
Minghao Li 已提交
445 446 447 448
target_link_libraries(syncEntryTest
    sync
    gtest_main
)
M
Minghao Li 已提交
449 450 451 452 453 454 455 456 457
target_link_libraries(syncRequestVoteTest
    sync
    gtest_main
)
target_link_libraries(syncRequestVoteReplyTest
    sync
    gtest_main
)
target_link_libraries(syncAppendEntriesTest
M
Minghao Li 已提交
458 459 460
    sync
    gtest_main
)
M
Minghao Li 已提交
461
target_link_libraries(syncAppendEntriesReplyTest
M
Minghao Li 已提交
462 463 464
    sync
    gtest_main
)
M
Minghao Li 已提交
465 466 467 468 469 470 471 472
target_link_libraries(syncClientRequestTest
    sync
    gtest_main
)
target_link_libraries(syncTimeoutTest
    sync
    gtest_main
)
M
Minghao Li 已提交
473 474 475 476 477 478 479 480
target_link_libraries(syncPingTest
    sync
    gtest_main
)
target_link_libraries(syncPingReplyTest
    sync
    gtest_main
)
M
Minghao Li 已提交
481 482 483 484
target_link_libraries(syncRpcMsgTest
    sync
    gtest_main
)
M
Minghao Li 已提交
485 486 487 488 489 490 491 492
target_link_libraries(syncPingTimerTest2
    sync
    gtest_main
)
target_link_libraries(syncPingSelfTest
    sync
    gtest_main
)
M
Minghao Li 已提交
493 494 495 496
target_link_libraries(syncElectTest
    sync
    gtest_main
)
M
Minghao Li 已提交
497 498 499 500
target_link_libraries(syncElectTest2
    sync
    gtest_main
)
M
Minghao Li 已提交
501 502 503 504
target_link_libraries(syncElectTest3
    sync
    gtest_main
)
M
Minghao Li 已提交
505 506 507 508
target_link_libraries(syncEncodeTest
    sync
    gtest_main
)
M
Minghao Li 已提交
509 510 511 512
target_link_libraries(syncWriteTest
    sync
    gtest_main
)
M
Minghao Li 已提交
513 514 515 516
target_link_libraries(syncReplicateTest
    sync
    gtest_main
)
M
Minghao Li 已提交
517 518 519 520
target_link_libraries(syncReplicateTest2
    sync
    gtest_main
)
M
Minghao Li 已提交
521 522 523 524
target_link_libraries(syncRefTest
    sync
    gtest_main
)
M
Minghao Li 已提交
525 526 527 528 529 530 531


enable_testing()
add_test(
    NAME sync_test
    COMMAND syncTest
)
M
Minghao Li 已提交
532 533