blob: 8fff570a479ea15b00e3bfd0713353d69479b30c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
cmake_minimum_required (VERSION 2.6)
enable_testing()
include_directories(${CMAKE_SOURCE_DIR}/src/)
add_definitions(-DTEST_GLOBALS=1)
# Create a single OSSupport library that contains all the OSSupport code used in the tests:
# Only needed for Windows; Linux already defines the OSSupport lib
if (WIN32)
set (OSSupport_SRCS
${CMAKE_SOURCE_DIR}/src/OSSupport/CriticalSection.cpp
${CMAKE_SOURCE_DIR}/src/OSSupport/Event.cpp
${CMAKE_SOURCE_DIR}/src/StringUtils.cpp
)
set (OSSupport_HDRS
${CMAKE_SOURCE_DIR}/src/OSSupport/CriticalSection.h
${CMAKE_SOURCE_DIR}/src/OSSupport/Event.h
${CMAKE_SOURCE_DIR}/src/StringUtils.h
${CMAKE_SOURCE_DIR}/src/Globals.h
)
add_library(OSSupport
${OSSupport_SRCS}
${OSSupport_HDRS}
)
endif()
# Define individual tests:
# StressEvent: Stress-test the cEvent implementation:
add_executable(StressEvent-exe StressEvent.cpp)
target_link_libraries(StressEvent-exe OSSupport)
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
PROPERTIES FOLDER Lib
)
|