4
4
#
5
5
# Mozilla Public License Version 2.0
6
6
7
- message (STATUS "Building 'detray::test_utils' component" )
8
-
9
7
# Set the common C++ flags.
10
8
include (detray-compiler-options -cpp)
11
9
@@ -14,37 +12,84 @@ include_directories(
14
12
$<TARGET_PROPERTY:covfie::core,INTERFACE_INCLUDE_DIRECTORIES >
15
13
)
16
14
17
- # Set up a test library, which can be used by downstream projects without
18
- # building the detray unit and integration
15
+ # Detray unit and integration test framework (depends on google test)
16
+ if (DETRAY_BUILD_TESTING)
17
+ message (STATUS "Building 'detray::test_framework' component" )
18
+
19
+ file (
20
+ GLOB _detray_test_headers
21
+ RELATIVE "${CMAKE_CURRENT_SOURCE_DIR} "
22
+ "include/detray/test/framework/*.hpp"
23
+ )
24
+
25
+ add_library (detray_test_framework INTERFACE "${_detray_test_headers} " )
26
+ add_library (detray::test_framework ALIAS detray_test_framework)
27
+
28
+ target_include_directories (
29
+ detray_test_framework
30
+ INTERFACE "${CMAKE_CURRENT_SOURCE_DIR} /include"
31
+ )
32
+
33
+ target_link_libraries (
34
+ detray_test_framework
35
+ INTERFACE GTest::gtest vecmem::core detray::core detray::detectors
36
+ )
37
+
38
+ unset (_detray_test_headers)
39
+ endif ()
40
+
41
+ # Common test dependencies such as test detectors, B-fields and track generators
42
+ # (depends on covfie)
19
43
if (DETRAY_BUILD_TEST_UTILS)
44
+ message (STATUS "Building 'detray::test_common' component" )
45
+
46
+ file (
47
+ GLOB _detray_test_common_headers
48
+ RELATIVE "${CMAKE_CURRENT_SOURCE_DIR} "
49
+ "include/detray/test/common/*.hpp"
50
+ "include/detray/test/common/factories/*.hpp"
51
+ "include/detray/test/common/event_generator/*.hpp"
52
+ )
53
+
54
+ detray_add_library(detray_test_common test_common "${_detray_test_common_headers} " )
55
+
56
+ target_link_libraries (
57
+ detray_test_common
58
+ INTERFACE vecmem::core covfie::core detray::core detray::detectors
59
+ )
60
+
61
+ unset (_detray_test_common_headers)
62
+ endif ()
63
+
64
+ # Lightweight test utils library without external dependencies
65
+ if (DETRAY_BUILD_TEST_UTILS OR DETRAY_BUILD_VALIDATION_TOOLS)
66
+ message (STATUS "Building 'detray::test_utils' component" )
67
+
20
68
file (
21
69
GLOB _detray_test_utils_headers
22
70
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR} "
23
71
"include/detray/test/utils/*.hpp"
24
- "include/detray/test/utils/detectors/*.hpp"
25
- "include/detray/test/utils/detectors/factories/*.hpp"
26
- "include/detray/test/utils/simulation/event_generator/*.hpp"
27
- "include/detray/test/utils/simulation/*.hpp"
28
72
)
29
73
30
74
detray_add_library(detray_test_utils test_utils ${_detray_test_utils_headers} )
31
- target_link_libraries (
32
- detray_test_utils
33
- INTERFACE vecmem::core detray::core detray::detectors
34
- )
75
+
76
+ target_link_libraries (detray_test_utils INTERFACE vecmem::core detray::core)
35
77
36
78
unset (_detray_test_utils_headers)
37
79
endif ()
38
80
39
- # Build extended validation tools
81
+ # Build extended validation tools (actsvg and csv depencies)
40
82
if (DETRAY_BUILD_VALIDATION_TOOLS)
83
+ message (STATUS "Building 'detray::validation_utils' component" )
84
+
41
85
file (
42
86
GLOB _detray_validation_headers
43
87
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR} "
44
88
"include/detray/test/validation/*.hpp"
45
89
)
46
90
47
91
detray_add_library(detray_validation_utils validation_utils ${_detray_validation_headers} )
92
+
48
93
target_link_libraries (
49
94
detray_validation_utils
50
95
INTERFACE
@@ -58,33 +103,6 @@ if(DETRAY_BUILD_VALIDATION_TOOLS)
58
103
unset (_detray_validation_headers)
59
104
endif ()
60
105
61
- # Build the common (host and device) test library (mostly for integration tests)
62
- if (DETRAY_BUILD_TESTING)
63
- message (STATUS "Building 'detray::test_common' component" )
64
-
65
- file (
66
- GLOB _detray_test_headers
67
- RELATIVE "${CMAKE_CURRENT_SOURCE_DIR} "
68
- "include/detray/test/common/*.hpp"
69
- "include/detray/test/common/detail/*.hpp"
70
- )
71
-
72
- add_library (detray_test_common INTERFACE "${_detray_test_headers} " )
73
- add_library (detray::test_common ALIAS detray_test_common)
74
-
75
- target_include_directories (
76
- detray_test_common
77
- INTERFACE "${CMAKE_CURRENT_SOURCE_DIR} /include"
78
- )
79
-
80
- target_link_libraries (
81
- detray_test_common
82
- INTERFACE GTest::gtest vecmem::core detray::core detray::test_utils
83
- )
84
-
85
- unset (_detray_test_headers)
86
- endif ()
87
-
88
106
# Include all of the code-holding sub-directories.
89
107
90
108
# Build the benchmarks
0 commit comments