1
1
function (add_tests)
2
+ get_filename_component (prefix ${CMAKE_CURRENT_SOURCE_DIR} NAME )
2
3
foreach (name ${ARGN} )
3
4
string (REPLACE "/" "_" test ${name} )
4
5
add_unit_test(
5
- "${test} _test"
6
+ "${prefix} _ ${ test} _test"
6
7
CATCH2
7
8
FILES
8
9
"${name} .cpp"
@@ -12,227 +13,12 @@ function(add_tests)
12
13
endforeach ()
13
14
endfunction ()
14
15
15
- add_unit_test(
16
- "flow_flow_test"
17
- CATCH2
18
- FILES
19
- "flow/flow.cpp"
20
- "flow/flow_cib_func.cpp"
21
- LIBRARIES
22
- warnings
23
- cib)
24
-
25
- add_tests(
26
- cib/builder_meta
27
- cib/callback
28
- cib/nexus
29
- cib/readme_hello_world
30
- flow/graph
31
- flow/graph_builder
32
- interrupt/dynamic_controller
33
- interrupt/irq_impl
34
- interrupt/manager
35
- interrupt/shared_irq_impl
36
- interrupt/shared_sub_irq_impl
37
- interrupt/sub_irq_impl
38
- interrupt/policies
39
- log /fmt_logger
40
- log /log
41
- log /mipi_encoder
42
- log /mipi_logger
43
- log /module_id
44
- lookup/input
45
- lookup/linear_search
46
- lookup/pseudo_pext_lookup
47
- lookup/lookup
48
- match/and
49
- match/constant
50
- match/equivalence
51
- match/implies
52
- match/not
53
- match/or
54
- match/predicate
55
- match/simplify_and
56
- match/simplify_custom
57
- match/simplify_not
58
- match/simplify_or
59
- match/sum_of_products
60
- msg/callback
61
- msg/field_extract
62
- msg/field_insert
63
- msg/field_matchers
64
- msg/handler
65
- msg/handler_builder
66
- msg/indexed_builder
67
- msg/indexed_callback
68
- msg/indexed_handler
69
- msg/message
70
- msg/send
71
- sc/format
72
- sc/string_constant
73
- seq/sequencer)
74
-
75
- add_library (catalog1_lib STATIC log /catalog1_lib.cpp)
76
- add_library (catalog2_lib OBJECT log /catalog2a_lib.cpp log /catalog2b_lib.cpp)
77
- target_include_directories (catalog1_lib PRIVATE ${CMAKE_SOURCE_DIR} /test /)
78
- target_include_directories (catalog2_lib PRIVATE ${CMAKE_SOURCE_DIR} /test /)
79
- target_link_libraries (catalog1_lib PRIVATE warnings cib)
80
- target_link_libraries (catalog2_lib PRIVATE warnings cib)
81
- gen_str_catalog(
82
- GEN_STR_CATALOG
83
- ${CMAKE_SOURCE_DIR} /tools/gen_str_catalog.py
84
- OUTPUT_CPP
85
- ${CMAKE_CURRENT_BINARY_DIR} /strings .cpp
86
- OUTPUT_JSON
87
- ${CMAKE_CURRENT_BINARY_DIR} /strings .json
88
- OUTPUT_XML
89
- ${CMAKE_CURRENT_BINARY_DIR} /strings .xml
90
- INPUT_LIBS
91
- catalog1_lib
92
- catalog2_lib
93
- INPUT_JSON
94
- log /catalog_extra.json
95
- STABLE_JSON
96
- log /stable_strings.json
97
- INPUT_HEADERS
98
- log /catalog_enums.hpp
99
- CLIENT_NAME
100
- "test"
101
- VERSION
102
- "test version"
103
- GUID_ID
104
- "01234567-89ab-cdef-0123-456789abcdef"
105
- GUID_MASK
106
- "ffffffff-ffff-ffff-ffff-ffffffffffff" )
107
-
108
- add_library (catalog_strings STATIC ${CMAKE_CURRENT_BINARY_DIR} /strings .cpp)
109
- target_link_libraries (catalog_strings PUBLIC cib)
110
-
111
- add_unit_test(
112
- log_catalog_test
113
- CATCH2
114
- FILES
115
- log /catalog_app.cpp
116
- LIBRARIES
117
- warnings
118
- cib
119
- catalog1_lib
120
- catalog2_lib
121
- catalog_strings)
122
-
123
- add_compile_fail_test(flow/fail/cyclic_flow.cpp LIBRARIES warnings cib)
124
- add_compile_fail_test(msg/fail/callback_bad_field_name.cpp LIBRARIES warnings
125
- cib)
126
- add_compile_fail_test(msg/fail/field_location.cpp LIBRARIES warnings cib)
127
- add_compile_fail_test(msg/fail/field_size.cpp LIBRARIES warnings cib)
128
- add_compile_fail_test(msg/fail/impossible_match_callback.cpp LIBRARIES warnings
129
- cib)
130
- add_compile_fail_test(msg/fail/impossible_match_field.cpp LIBRARIES warnings
131
- cib)
132
- add_compile_fail_test(msg/fail/owning_msg_incompatible_storage.cpp LIBRARIES
133
- warnings cib)
134
- add_compile_fail_test(msg/fail/owning_msg_incompatible_view.cpp LIBRARIES
135
- warnings cib)
136
- add_compile_fail_test(msg/fail/message_cmp_owner.cpp LIBRARIES warnings cib)
137
- add_compile_fail_test(msg/fail/message_cmp_view.cpp LIBRARIES warnings cib)
138
- add_compile_fail_test(msg/fail/message_const_field_write.cpp LIBRARIES warnings
139
- cib)
140
- add_compile_fail_test(msg/fail/message_dangling_view.cpp LIBRARIES warnings cib)
141
- add_compile_fail_test(msg/fail/message_dup_fieldnames.cpp LIBRARIES warnings
142
- cib)
143
- add_compile_fail_test(msg/fail/message_incompatible_matcher.cpp LIBRARIES
144
- warnings cib)
145
- add_compile_fail_test(msg/fail/message_uninitialized_field.cpp LIBRARIES
146
- warnings cib)
147
- add_compile_fail_test(msg/fail/view_upsize.cpp LIBRARIES warnings cib)
148
-
149
- add_versioned_package("gh:boost-ext/mph#v1.0.8" )
150
- add_versioned_package("gh:serge-sans-paille/frozen#292a811" )
151
-
152
- # Define the variable values
153
- set (BENCH_ALG_NAMES
154
- std_map
155
- std_unordered_map
156
- frozen_map
157
- frozen_unordered_map
158
- pseudo_pext_direct
159
- pseudo_pext_indirect_1
160
- pseudo_pext_indirect_2
161
- pseudo_pext_indirect_3
162
- pseudo_pext_indirect_4
163
- pseudo_pext_indirect_5
164
- pseudo_pext_indirect_6)
165
-
166
- foreach (type IN ITEMS uint16 uint32)
167
- foreach (i RANGE 1 10)
168
- list (APPEND BENCH_DATASETS exp_${i} _${type} )
169
- endforeach ()
170
- foreach (i RANGE 20 100 10)
171
- list (APPEND BENCH_DATASETS exp_${i} _${type} )
172
- endforeach ()
173
- foreach (i RANGE 200 1000 100)
174
- list (APPEND BENCH_DATASETS exp_${i} _${type} )
175
- endforeach ()
176
- endforeach ()
177
-
178
- set (EXCLUDED_COMBINATIONS
179
- mph_pext_exp_70_uint32
180
- mph_pext_exp_80_uint32
181
- mph_pext_exp_90_uint32
182
- mph_pext_exp_100_uint32
183
- mph_pext_exp_200_uint32
184
- mph_pext_exp_300_uint32
185
- mph_pext_exp_400_uint32
186
- mph_pext_exp_500_uint32
187
- mph_pext_exp_600_uint32
188
- mph_pext_exp_700_uint32
189
- mph_pext_exp_800_uint32
190
- mph_pext_exp_900_uint32
191
- mph_pext_exp_1000_uint32
192
- mph_pext_exp_70_uint16
193
- mph_pext_exp_80_uint16
194
- mph_pext_exp_90_uint16
195
- mph_pext_exp_100_uint16
196
- mph_pext_exp_200_uint16
197
- mph_pext_exp_300_uint16
198
- mph_pext_exp_400_uint16
199
- mph_pext_exp_500_uint16
200
- mph_pext_exp_600_uint16
201
- mph_pext_exp_700_uint16
202
- mph_pext_exp_800_uint16
203
- mph_pext_exp_900_uint16
204
- mph_pext_exp_1000_uint16)
205
-
206
- # Generate all possible combinations of the variables
207
- foreach (BENCH_ALG_NAME ${BENCH_ALG_NAMES} )
208
- foreach (BENCH_DATASET ${BENCH_DATASETS} )
209
- if ("${BENCH_ALG_NAME} _${BENCH_DATASET} " IN_LIST EXCLUDED_COMBINATIONS)
210
- continue ()
211
- endif ()
212
- set (name "${BENCH_ALG_NAME} _${BENCH_DATASET} _bench" )
213
-
214
- add_benchmark(
215
- ${name}
216
- NANO
217
- FILES
218
- lookup/pseudo_pext.cpp
219
- SYSTEM_LIBRARIES
220
- cib
221
- mph
222
- frozen-headers)
223
- target_compile_features (${name} PRIVATE cxx_std_23)
224
- target_compile_options (${name} PRIVATE -fconstexpr-steps=4000000000)
225
- target_compile_definitions (
226
- ${name}
227
- PRIVATE ALG_NAME=bench_${BENCH_ALG_NAME}
228
- QALG_NAME="bench_${BENCH_ALG_NAME} "
229
- BENCH_DATASET=${BENCH_DATASET}
230
- QBENCH_DATASET="${BENCH_DATASET} " )
231
- endforeach ()
232
- endforeach ()
233
-
234
- # Create a target for the current configuration
235
- add_benchmark(handler_bench NANO FILES msg/handler_bench.cpp SYSTEM_LIBRARIES
236
- cib)
237
- target_compile_options (handler_bench PRIVATE -fconstexpr-steps=4000000000
238
- -fbracket-depth=1024)
16
+ add_subdirectory (cib)
17
+ add_subdirectory (flow)
18
+ add_subdirectory (interrupt)
19
+ add_subdirectory (log )
20
+ add_subdirectory (lookup)
21
+ add_subdirectory (match)
22
+ add_subdirectory (msg)
23
+ add_subdirectory (sc)
24
+ add_subdirectory (seq)
0 commit comments