44#
55# Mozilla Public License Version 2.0
66
7- message (STATUS "Building 'detray::test_utils' component" )
8-
97# Set the common C++ flags.
108include (detray-compiler-options-cpp )
119
@@ -14,37 +12,84 @@ include_directories(
1412 $<TARGET_PROPERTY :covfie ::core ,INTERFACE_INCLUDE_DIRECTORIES >
1513)
1614
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)
1943if (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+
2068 file (
2169 GLOB _detray_test_utils_headers
2270 RELATIVE "${CMAKE_CURRENT_SOURCE_DIR } "
2371 "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"
2872 )
2973
3074 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 )
3577
3678 unset (_detray_test_utils_headers)
3779endif ()
3880
39- # Build extended validation tools
81+ # Build extended validation tools (actsvg and csv depencies)
4082if (DETRAY_BUILD_VALIDATION_TOOLS)
83+ message (STATUS "Building 'detray::validation_utils' component" )
84+
4185 file (
4286 GLOB _detray_validation_headers
4387 RELATIVE "${CMAKE_CURRENT_SOURCE_DIR } "
4488 "include/detray/test/validation/*.hpp"
4589 )
4690
4791 detray_add_library (detray_validation_utils validation_utils ${_detray_validation_headers} )
92+
4893 target_link_libraries (
4994 detray_validation_utils
5095 INTERFACE
@@ -58,33 +103,6 @@ if(DETRAY_BUILD_VALIDATION_TOOLS)
58103 unset (_detray_validation_headers)
59104endif ()
60105
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-
88106# Include all of the code-holding sub-directories.
89107
90108# Build the benchmarks
0 commit comments