2020-05-16 15:59:10 -04:00
|
|
|
find_package(Threads REQUIRED)
|
2020-10-15 05:35:44 -04:00
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/src/)
|
2016-06-26 09:51:12 -04:00
|
|
|
|
|
|
|
# Create a single OSSupport library that contains all the OSSupport code used in the tests:
|
2020-05-16 15:59:10 -04:00
|
|
|
set (OSSupport_SRCS
|
2020-10-15 05:35:44 -04:00
|
|
|
${PROJECT_SOURCE_DIR}/src/OSSupport/CriticalSection.cpp
|
|
|
|
${PROJECT_SOURCE_DIR}/src/OSSupport/Event.cpp
|
|
|
|
${PROJECT_SOURCE_DIR}/src/StringUtils.cpp
|
2020-05-16 15:59:10 -04:00
|
|
|
)
|
|
|
|
set (OSSupport_HDRS
|
2020-10-15 05:35:44 -04:00
|
|
|
${PROJECT_SOURCE_DIR}/src/OSSupport/CriticalSection.h
|
|
|
|
${PROJECT_SOURCE_DIR}/src/OSSupport/Event.h
|
|
|
|
${PROJECT_SOURCE_DIR}/src/StringUtils.h
|
|
|
|
${PROJECT_SOURCE_DIR}/src/Globals.h
|
2020-05-16 15:59:10 -04:00
|
|
|
)
|
|
|
|
add_library(OSSupport
|
|
|
|
${OSSupport_SRCS}
|
|
|
|
${OSSupport_HDRS}
|
|
|
|
)
|
|
|
|
target_link_libraries(OSSupport PUBLIC fmt::fmt)
|
2016-06-26 09:51:12 -04:00
|
|
|
|
|
|
|
# Define individual tests:
|
|
|
|
|
|
|
|
# StressEvent: Stress-test the cEvent implementation:
|
|
|
|
add_executable(StressEvent-exe StressEvent.cpp)
|
2020-05-16 15:59:10 -04:00
|
|
|
target_link_libraries(StressEvent-exe OSSupport fmt::fmt Threads::Threads)
|
2016-06-26 09:51:12 -04:00
|
|
|
add_test(NAME StressEvent-test COMMAND StressEvent-exe)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Put all the tests into a solution folder (MSVC):
|
|
|
|
set_target_properties(
|
|
|
|
StressEvent-exe
|
|
|
|
PROPERTIES FOLDER Tests/OSSupport
|
|
|
|
)
|
|
|
|
set_target_properties(
|
|
|
|
OSSupport
|
2020-05-16 15:59:10 -04:00
|
|
|
PROPERTIES FOLDER Tests/Libraries
|
2016-06-26 09:51:12 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|