This repository has been archived by the owner on Mar 8, 2024. It is now read-only.
forked from markol/machines
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
72 lines (67 loc) · 1.72 KB
/
CMakeLists.txt
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../include/libdev
${CMAKE_CURRENT_SOURCE_DIR}/../src/libdev
${CMAKE_CURRENT_SOURCE_DIR}/../src/libdev/device
)
enable_testing(true)
macro(append_test test_name test_srcs)
set(TESTS_SRCS ${TESTS_SRCS} ${test_srcs})
set(TESTS_NAME ${TESTS_NAME} ${test_name})
endmacro(append_test)
# Can't use `libs` because some libraries had to be substituted, like `afx` ':^/
# # You can still unit test afx lib's classes, except for AfxSdlApp
set(TESTING_THESE_GUYS
base
mathex
afx_lite
utility
profiler
system
device
world4d
gxin
xin
stdlib
render
sound
network
ctl
phys
sim
gui
recorder
envirnmt
machphys
machlog
machgui
)
#### Test Cases
#~:afx
append_test(AfxConfigurationTests afx/AfxConfigurationTests.cpp)
#~:ani
if(USE_SWSCALE)
append_test(FrameScalerTests ani/FrameScalerTests.cpp)
endif()
#~:device
append_test(DevButtonEventTests device/DevButtonEventTests.cpp)
append_test(DevEventQueueTests device/DevEventQueueTests.cpp)
append_test(DevMouseTests device/DevMouseTests.cpp)
#~:gui
append_test(GuiRootSharedBitmapsTests gui/GuiRootSharedBitmapsTests.cpp)
#~:system
append_test(SysPathNameTests system/SysPathNameTests.cpp)
#### Create executables
list(LENGTH TESTS_SRCS len1)
math(EXPR len2 "${len1} - 1")
foreach( val RANGE ${len2} )
list(GET TESTS_SRCS ${val} test_src)
list(GET TESTS_NAME ${val} test_name)
add_executable(${test_name} AssertionOverrides.cpp RenSurfaceOverrides.cpp ${test_src})
target_link_libraries( ${test_name}
gtest
gmock
gtest_main
${TESTING_THESE_GUYS}
)
add_test(NAME ${test_name} COMMAND ${test_name})
endforeach()