-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd_test_suite.cmake
55 lines (41 loc) · 1.62 KB
/
add_test_suite.cmake
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
###############################################################
# Author: daniperez
###############################################################
###############################################################
function(
## Function name
add_test_suite
## Argument list
name # Test name
source_list # List of sources
# ... libraries to link with (up to 5)
)
add_executable(${name} ${source_list})
target_link_libraries(${name} ${ARGV2} ${ARGV3} ${ARGV4} ${ARGV5} ${ARGV6})
if ( WIN32 )
add_test(${name} ${COMMAND_INTERPRETER} ${name}.exe)
else ()
add_test(${name} ${name})
endif ()
endfunction(add_test_suite)
###############################################################
###############################################################
# This is similar to the previous ones but we check if the test
# is in the given list.
###############################################################
function(
## Function name
add_test_suite_if
## Argument list
list # List to check against. If our test is in
# the list, it will be compiled.
name # Test name
source_list # List of sources
# ... libraries to link with (up to 5)
)
list ( FIND list ${name} TO_BE_COMPILED )
if ( TO_BE_COMPILED GREATER -1 )
add_test_suite(${name} ${source_list} ${ARGN})
endif ()
endfunction(add_test_suite_if)
###############################################################