2018-08-05 12:46:36 +08:00
|
|
|
set(TARGET_TEST unittest)
|
|
|
|
|
|
|
|
set(SRC_TEST
|
|
|
|
testmain.cpp
|
|
|
|
test_callbacklist_basic.cpp
|
|
|
|
test_callbacklist_ctors.cpp
|
|
|
|
test_callbacklist_multithread.cpp
|
|
|
|
test_dispatcher_basic.cpp
|
|
|
|
test_dispatcher_ctors.cpp
|
|
|
|
test_dispatcher_multithread.cpp
|
|
|
|
test_queue_basic.cpp
|
2020-05-25 21:59:20 +08:00
|
|
|
test_queue_ctors.cpp
|
2018-08-05 12:46:36 +08:00
|
|
|
test_queue_multithread.cpp
|
2020-11-26 20:41:00 +08:00
|
|
|
test_queue_ordered_list.cpp
|
2019-03-28 15:32:24 +08:00
|
|
|
test_hetercallbacklist_basic.cpp
|
2020-04-18 21:23:39 +08:00
|
|
|
test_hetercallbacklist_ctors.cpp
|
2018-12-08 08:49:55 +08:00
|
|
|
test_heterdispatcher_basic.cpp
|
2020-04-19 21:18:27 +08:00
|
|
|
test_heterdispatcher_ctors.cpp
|
|
|
|
test_heterdispatcher_multithread.cpp
|
2018-12-15 10:50:39 +08:00
|
|
|
test_heterqueue_basic.cpp
|
2018-08-05 12:46:36 +08:00
|
|
|
test_eventutil.cpp
|
2020-01-22 16:55:25 +08:00
|
|
|
test_eventmaker.cpp
|
2018-08-05 12:46:36 +08:00
|
|
|
test_conditionalremover.cpp
|
|
|
|
test_counterremover.cpp
|
|
|
|
test_scopedremover.cpp
|
2020-12-11 09:45:23 +08:00
|
|
|
test_no_extra_copy_move.cpp
|
2021-01-19 15:15:27 +08:00
|
|
|
test_argumentadapter.cpp
|
2021-01-26 16:30:48 +08:00
|
|
|
test_conditionalfunctor.cpp
|
2021-01-29 21:32:57 +08:00
|
|
|
test_anyhashable.cpp
|
|
|
|
test_anyhashablevalue.cpp
|
2018-08-05 12:46:36 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(
|
|
|
|
${TARGET_TEST}
|
|
|
|
${SRC_TEST}
|
|
|
|
)
|
|
|
|
|
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
target_link_libraries(${TARGET_TEST} Threads::Threads)
|
|
|
|
|
2021-01-29 21:32:57 +08:00
|
|
|
set_target_properties(${TARGET_TEST} PROPERTIES CXX_STANDARD 17)
|
2020-04-15 21:01:31 +08:00
|
|
|
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
if(coverage)
|
|
|
|
set(CMAKE_CXX_FLAGS "-g -O0 -Wall -fprofile-arcs -ftest-coverage")
|
|
|
|
endif()
|
|
|
|
endif()
|
2020-07-09 09:06:41 +02:00
|
|
|
|
|
|
|
add_test(NAME ${TARGET_TEST} COMMAND ${TARGET_TEST})
|