-
Notifications
You must be signed in to change notification settings - Fork 84
/
CMakeLists.txt
558 lines (502 loc) · 29.2 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
celix_subproject(PUBSUB_INTEGRATION "Option to build the pubsub integration" ON DEPS SHELL SHELL_TUI)
if (PUBSUB_INTEGRATION)
find_package(jansson REQUIRED)
add_celix_bundle(pubsub_endpoint_sut
#"Vanilla" bundle which is under test
SOURCES
gtest/sut_endpoint_activator.c
VERSION 1.0.0
)
target_include_directories(pubsub_endpoint_sut PRIVATE gtest)
target_link_libraries(pubsub_endpoint_sut PRIVATE Celix::pubsub_api)
celix_bundle_files(pubsub_endpoint_sut
meta_data/msg.descriptor
DESTINATION "META-INF/descriptors"
)
celix_bundle_files(pubsub_endpoint_sut
meta_data/ping2.properties
DESTINATION "META-INF/topics/pub"
)
add_celix_bundle(pubsub_endpoint_tst
#Test bundle containing cpputests and uses celix_test_runner launcher instead of the celix launcher
SOURCES
gtest/tst_endpoint_activator.c
VERSION 1.0.0
)
target_link_libraries(pubsub_endpoint_tst PRIVATE Celix::framework Celix::pubsub_api)
celix_bundle_files(pubsub_endpoint_tst
meta_data/msg.descriptor
DESTINATION "META-INF/descriptors"
)
celix_bundle_files(pubsub_endpoint_tst
meta_data/pong3.properties
DESTINATION "META-INF/topics/sub"
)
add_celix_bundle(pubsub_loopback
#"Vanilla" bundle which is under test
SOURCES
gtest/loopback_activator.c
VERSION 1.0.0
)
target_include_directories(pubsub_loopback PRIVATE gtest)
target_link_libraries(pubsub_loopback PRIVATE Celix::pubsub_api)
celix_bundle_files(pubsub_loopback
meta_data/msg.descriptor
DESTINATION "META-INF/descriptors"
)
celix_bundle_files(pubsub_loopback
meta_data/ping3.properties
DESTINATION "META-INF/topics/pub"
)
celix_bundle_files(pubsub_loopback
meta_data/pong2.properties
DESTINATION "META-INF/topics/sub"
)
add_celix_bundle(pubsub_sut
#"Vanilla" bundle which is under test
SOURCES
gtest/sut_activator.c
VERSION 1.0.0
)
target_include_directories(pubsub_sut PRIVATE gtest)
target_link_libraries(pubsub_sut PRIVATE Celix::pubsub_api)
celix_bundle_files(pubsub_sut
meta_data/msg.descriptor
DESTINATION "META-INF/descriptors"
)
celix_bundle_files(pubsub_sut
meta_data/ping.properties
DESTINATION "META-INF/topics/pub"
)
add_celix_bundle(pubsub_tst
#Test bundle containing cpputests and uses celix_test_runner launcher instead of the celix launcher
SOURCES
gtest/tst_activator.c
VERSION 1.0.0
)
target_link_libraries(pubsub_tst PRIVATE Celix::framework Celix::pubsub_api)
celix_bundle_files(pubsub_tst
meta_data/msg.descriptor
DESTINATION "META-INF/descriptors"
)
celix_bundle_files(pubsub_tst
meta_data/ping.properties
DESTINATION "META-INF/topics/sub"
)
add_celix_bundle(pubsub_deadlock_sut
#"Vanilla" bundle which is used to trigger a publisher added call
SOURCES
gtest/sut_activator.c
VERSION 1.0.0
)
celix_bundle_files(pubsub_deadlock_sut
meta_data/msg.descriptor
DESTINATION "META-INF/descriptors"
)
celix_bundle_files(pubsub_deadlock_sut
meta_data/deadlock.scope.properties
DESTINATION "META-INF/topics/pub"
)
celix_bundle_files(pubsub_deadlock_sut
meta_data/deadlock.scope2.properties
DESTINATION "META-INF/topics/pub"
)
target_link_libraries(pubsub_deadlock_sut PRIVATE Celix::pubsub_api)
celix_get_bundle_file(pubsub_deadlock_sut DEADLOCK_SUT_BUNDLE_FILE)
add_celix_bundle(pubsub_serializer
#serializer bundle
SOURCES
gtest/serializer_activator.cc
VERSION 1.0.0
)
target_include_directories(pubsub_serializer PRIVATE gtest)
target_link_libraries(pubsub_serializer PRIVATE Celix::pubsub_api Celix::pubsub_spi)
if (BUILD_PUBSUB_PSA_UDP_MC)
add_celix_container(pubsub_udpmc_tests
USE_CONFIG #ensures that a config.properties will be created with the launch bundles.
LAUNCHER_SRC ${CMAKE_CURRENT_LIST_DIR}/gtest/PubSubIntegrationTestSuite.cc
DIR ${CMAKE_CURRENT_BINARY_DIR}
PROPERTIES
LOGHELPER_STDOUT_FALLBACK_INCLUDE_DEBUG=true
CELIX_LOGGING_DEFAULT_ACTIVE_LOG_LEVEL=trace
BUNDLES
Celix::celix_pubsub_serializer_json
Celix::celix_pubsub_topology_manager
Celix::celix_pubsub_admin_udp_multicast
pubsub_sut
pubsub_tst
)
target_link_libraries(pubsub_udpmc_tests PRIVATE Celix::pubsub_api jansson::jansson Celix::dfi GTest::gtest GTest::gtest_main)
target_include_directories(pubsub_udpmc_tests SYSTEM PRIVATE gtest)
add_celix_container(pstm_deadlock_udpmc_test
USE_CONFIG #ensures that a config.properties will be created with the launch bundles.
LAUNCHER_SRC ${CMAKE_CURRENT_LIST_DIR}/pstm_deadlock_test/test_runner.cc
DIR ${CMAKE_CURRENT_BINARY_DIR}
PROPERTIES
LOGHELPER_STDOUT_FALLBACK_INCLUDE_DEBUG=true
CELIX_LOGGING_DEFAULT_ACTIVE_LOG_LEVEL=trace
BUNDLES
Celix::celix_pubsub_serializer_json
Celix::celix_pubsub_protocol_wire_v2
Celix::celix_pubsub_topology_manager
Celix::celix_pubsub_admin_udp_multicast
Celix::shell
Celix::shell_tui
)
target_compile_definitions(pstm_deadlock_udpmc_test PRIVATE -DDEADLOCK_SUT_BUNDLE_FILE=\"${DEADLOCK_SUT_BUNDLE_FILE}\")
target_link_libraries(pstm_deadlock_udpmc_test PRIVATE Celix::pubsub_api jansson::jansson Celix::dfi GTest::gtest GTest::gtest_main)
target_include_directories(pstm_deadlock_udpmc_test SYSTEM PRIVATE pstm_deadlock_udpmc_test)
add_celix_bundle_dependencies(pstm_deadlock_udpmc_test pubsub_deadlock_sut)
#Framework "bundle" has no cache dir. Default as "cache dir" the cwd is used.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/meta_data/msg.descriptor ${CMAKE_CURRENT_BINARY_DIR}/pstm_deadlock_udpmc_gtest/META-INF/descriptors/msg.descriptor COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/meta_data/deadlock.scope.properties ${CMAKE_CURRENT_BINARY_DIR}/pstm_deadlock_udpmc_gtest/META-INF/topics/pub/deadlock.properties COPYONLY)
add_test(NAME pstm_deadlock_udpmc_test COMMAND pstm_deadlock_udpmc_test WORKING_DIRECTORY $<TARGET_PROPERTY:pstm_deadlock_udpmc_test,CONTAINER_LOC>)
setup_target_for_coverage(pstm_deadlock_udpmc_test SCAN_DIR ..)
#TODO fix issues with UDPMC and reanble test again
#add_test(NAME pubsub_udpmc_tests COMMAND pubsub_udpmc_tests WORKING_DIRECTORY $<TARGET_PROPERTY:pubsub_udpmc_tests,CONTAINER_LOC>)
#setup_target_for_coverage(pubsub_udpmc_tests SCAN_DIR ..)
endif()
if (BUILD_PUBSUB_PSA_TCP)
# TCP v2 tests
add_celix_container(pubsub_tcp_v2_wire_v1_tests
USE_CONFIG #ensures that a config.properties will be created with the launch bundles.
LAUNCHER_SRC ${CMAKE_CURRENT_LIST_DIR}/gtest/PubSubIntegrationTestSuite.cc
DIR ${CMAKE_CURRENT_BINARY_DIR}
PROPERTIES
LOGHELPER_STDOUT_FALLBACK_INCLUDE_DEBUG=true
CELIX_LOGGING_DEFAULT_ACTIVE_LOG_LEVEL=trace
BUNDLES
Celix::shell
Celix::shell_tui
Celix::celix_pubsub_serializer_json
Celix::celix_pubsub_protocol_wire_v1
Celix::celix_pubsub_topology_manager
Celix::celix_pubsub_admin_tcp
pubsub_sut
pubsub_tst
pubsub_serializer
)
target_link_libraries(pubsub_tcp_v2_wire_v1_tests PRIVATE Celix::pubsub_api Celix::dfi GTest::gtest GTest::gtest_main)
target_include_directories(pubsub_tcp_v2_wire_v1_tests SYSTEM PRIVATE gtest)
add_test(NAME pubsub_tcp_v2_wire_v1_tests COMMAND pubsub_tcp_v2_wire_v1_tests WORKING_DIRECTORY $<TARGET_PROPERTY:pubsub_tcp_v2_wire_v1_tests,CONTAINER_LOC>)
setup_target_for_coverage(pubsub_tcp_v2_wire_v1_tests SCAN_DIR ..)
add_celix_container(pubsub_tcp_v2_wire_v2_tests
USE_CONFIG #ensures that a config.properties will be created with the launch bundles.
LAUNCHER_SRC ${CMAKE_CURRENT_LIST_DIR}/gtest/PubSubIntegrationTestSuite.cc
DIR ${CMAKE_CURRENT_BINARY_DIR}
PROPERTIES
LOGHELPER_STDOUT_FALLBACK_INCLUDE_DEBUG=true
CELIX_LOGGING_DEFAULT_ACTIVE_LOG_LEVEL=trace
BUNDLES
Celix::shell
Celix::shell_tui
Celix::celix_pubsub_serializer_json
Celix::celix_pubsub_protocol_wire_v2
Celix::celix_pubsub_topology_manager
Celix::celix_pubsub_admin_tcp
pubsub_sut
pubsub_tst
pubsub_serializer
)
target_link_libraries(pubsub_tcp_v2_wire_v2_tests PRIVATE Celix::pubsub_api Celix::dfi GTest::gtest GTest::gtest_main)
target_include_directories(pubsub_tcp_v2_wire_v2_tests SYSTEM PRIVATE gtest)
add_test(NAME pubsub_tcp_v2_wire_v2_tests COMMAND pubsub_tcp_v2_wire_v2_tests WORKING_DIRECTORY $<TARGET_PROPERTY:pubsub_tcp_v2_wire_v2_tests,CONTAINER_LOC>)
setup_target_for_coverage(pubsub_tcp_v2_wire_v2_tests SCAN_DIR ..)
add_celix_container(pubsub_tcp_v2_wire_v2_with_no_scope_tests
USE_CONFIG #ensures that a config.properties will be created with the launch bundles.
LAUNCHER_SRC ${CMAKE_CURRENT_LIST_DIR}/gtest/PubSubIntegrationTestSuite.cc
DIR ${CMAKE_CURRENT_BINARY_DIR}
PROPERTIES
LOGHELPER_STDOUT_FALLBACK_INCLUDE_DEBUG=true
CELIX_LOGGING_DEFAULT_ACTIVE_LOG_LEVEL=trace
CELIX_PUBSUB_TEST_USE_NEGATIVE_SCOPE_FILTER=false
BUNDLES
Celix::shell
Celix::shell_tui
Celix::celix_pubsub_serializer_json
Celix::celix_pubsub_protocol_wire_v2
Celix::celix_pubsub_topology_manager
Celix::celix_pubsub_admin_tcp
pubsub_sut
pubsub_tst
pubsub_serializer
)
target_link_libraries(pubsub_tcp_v2_wire_v2_with_no_scope_tests PRIVATE Celix::pubsub_api Celix::dfi GTest::gtest GTest::gtest_main)
target_include_directories(pubsub_tcp_v2_wire_v2_with_no_scope_tests SYSTEM PRIVATE gtest)
add_test(NAME pubsub_tcp_v2_wire_v2_with_no_scope_tests COMMAND pubsub_tcp_v2_wire_v2_with_no_scope_tests WORKING_DIRECTORY $<TARGET_PROPERTY:pubsub_tcp_v2_wire_v2_with_no_scope_tests,CONTAINER_LOC>)
setup_target_for_coverage(pubsub_tcp_v2_wire_v2_with_no_scope_tests SCAN_DIR ..)
add_celix_container(pubsub_tcp_v2_endpoint_tests
USE_CONFIG #ensures that a config.properties will be created with the launch bundles.
LAUNCHER_SRC ${CMAKE_CURRENT_LIST_DIR}/gtest/PubSubEndpointIntegrationTestSuite.cc
DIR ${CMAKE_CURRENT_BINARY_DIR}
PROPERTIES
LOGHELPER_STDOUT_FALLBACK_INCLUDE_DEBUG=true
CELIX_LOGGING_DEFAULT_ACTIVE_LOG_LEVEL=trace
BUNDLES
Celix::shell
Celix::shell_tui
Celix::celix_pubsub_serializer_json
Celix::celix_pubsub_protocol_wire_v2
Celix::celix_pubsub_topology_manager
Celix::celix_pubsub_admin_tcp
pubsub_endpoint_tst
pubsub_endpoint_sut
pubsub_loopback
pubsub_serializer
)
target_link_libraries(pubsub_tcp_v2_endpoint_tests PRIVATE Celix::pubsub_api Celix::dfi GTest::gtest GTest::gtest_main)
target_include_directories(pubsub_tcp_v2_endpoint_tests SYSTEM PRIVATE gtest)
add_celix_container(pstm_deadlock_tcp_v2_test
USE_CONFIG #ensures that a config.properties will be created with the launch bundles.
LAUNCHER_SRC ${CMAKE_CURRENT_LIST_DIR}/pstm_deadlock_test/test_runner.cc
DIR ${CMAKE_CURRENT_BINARY_DIR}
PROPERTIES
LOGHELPER_STDOUT_FALLBACK_INCLUDE_DEBUG=true
CELIX_LOGGING_DEFAULT_ACTIVE_LOG_LEVEL=trace
BUNDLES
Celix::celix_pubsub_serializer_json
Celix::celix_pubsub_protocol_wire_v2
Celix::celix_pubsub_topology_manager
Celix::celix_pubsub_admin_tcp
Celix::shell
Celix::shell_tui
pubsub_serializer
)
target_compile_definitions(pstm_deadlock_tcp_v2_test PRIVATE -DDEADLOCK_SUT_BUNDLE_FILE=\"${DEADLOCK_SUT_BUNDLE_FILE}\")
target_link_libraries(pstm_deadlock_tcp_v2_test PRIVATE Celix::pubsub_api GTest::gtest GTest::gtest_main Celix::dfi)
target_include_directories(pstm_deadlock_tcp_v2_test SYSTEM PRIVATE pstm_deadlock_tcp_v2_test)
#Note we do not link to bundles, as result (to ensure a bundle zip file is created) an dependency on the bundle is needed.
add_celix_bundle_dependencies(pstm_deadlock_tcp_v2_test pubsub_deadlock_sut)
#Framework "bundle" has no cache dir. Default as "cache dir" the cwd is used.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/meta_data/msg.descriptor ${CMAKE_CURRENT_BINARY_DIR}/pstm_deadlock_tcp_gtest/META-INF/descriptors/msg.descriptor COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/meta_data/deadlock.scope.properties ${CMAKE_CURRENT_BINARY_DIR}/pstm_deadlock_tcp_gtest/META-INF/topics/pub/deadlock.properties COPYONLY)
add_test(NAME pstm_deadlock_tcp_v2_test COMMAND pstm_deadlock_tcp_v2_test WORKING_DIRECTORY $<TARGET_PROPERTY:pstm_deadlock_tcp_v2_test,CONTAINER_LOC>)
setup_target_for_coverage(pstm_deadlock_tcp_v2_test SCAN_DIR ..)
#TCP Endpoint test is disabled because the test is not stable when running on Travis
if (ENABLE_PUBSUB_PSA_TCP_ENDPOINT_TEST)
add_test(NAME pubsub_tcp_v2_endpoint_tests COMMAND pubsub_tcp_v2_endpoint_tests WORKING_DIRECTORY $<TARGET_PROPERTY:pubsub_tcp_v2_endpoint_tests,CONTAINER_LOC>)
setup_target_for_coverage(pubsub_tcp_v2_endpoint_tests SCAN_DIR ..)
endif()
endif()
if (BUILD_PUBSUB_PSA_WS)
add_celix_container(pubsub_websocket_v2_tests
USE_CONFIG
LAUNCHER_SRC ${CMAKE_CURRENT_LIST_DIR}/gtest/PubSubIntegrationTestSuite.cc
DIR ${CMAKE_CURRENT_BINARY_DIR}
PROPERTIES
LOGHELPER_STDOUT_FALLBACK_INCLUDE_DEBUG=true
CELIX_LOGGING_DEFAULT_ACTIVE_LOG_LEVEL=trace
CELIX_HTTP_ADMIN_LISTENING_PORTS=58080
BUNDLES
Celix::celix_pubsub_serializer_json
Celix::http_admin
Celix::celix_pubsub_topology_manager
Celix::celix_pubsub_admin_websocket
pubsub_sut
pubsub_tst
pubsub_serializer
)
target_link_libraries(pubsub_websocket_v2_tests PRIVATE Celix::pubsub_api jansson::jansson civetweb_shared GTest::gtest GTest::gtest_main)
target_include_directories(pubsub_websocket_v2_tests SYSTEM PRIVATE gtest)
add_test(NAME pubsub_websocket_v2_tests COMMAND pubsub_websocket_v2_tests WORKING_DIRECTORY $<TARGET_PROPERTY:pubsub_websocket_v2_tests,CONTAINER_LOC>)
setup_target_for_coverage(pubsub_websocket_v2_tests SCAN_DIR ..)
add_celix_container(pstm_deadlock_websocket_v2_test
USE_CONFIG #ensures that a config.properties will be created with the launch bundles.
LAUNCHER_SRC ${CMAKE_CURRENT_LIST_DIR}/pstm_deadlock_test/test_runner.cc
DIR ${CMAKE_CURRENT_BINARY_DIR}
PROPERTIES
LOGHELPER_STDOUT_FALLBACK_INCLUDE_DEBUG=true
CELIX_LOGGING_DEFAULT_ACTIVE_LOG_LEVEL=trace
CELIX_HTTP_ADMIN_LISTENING_PORTS=58080
BUNDLES
Celix::celix_pubsub_serializer_json
Celix::celix_pubsub_topology_manager
Celix::celix_pubsub_admin_websocket
Celix::shell
Celix::shell_tui
pubsub_serializer
)
target_compile_definitions(pstm_deadlock_websocket_v2_test PRIVATE -DDEADLOCK_SUT_BUNDLE_FILE=\"${DEADLOCK_SUT_BUNDLE_FILE}\")
target_link_libraries(pstm_deadlock_websocket_v2_test PRIVATE Celix::pubsub_api GTest::gtest GTest::gtest_main jansson::jansson Celix::dfi civetweb_shared)
target_include_directories(pstm_deadlock_websocket_v2_test SYSTEM PRIVATE pstm_deadlock_websocket_v2_test)
#Note we do not link to bundles, as result (to ensure a bundle zip file is created) an dependency on the bundle is needed.
add_celix_bundle_dependencies(pstm_deadlock_websocket_v2_test pubsub_deadlock_sut)
#Framework "bundle" has no cache dir. Default as "cache dir" the cwd is used.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/meta_data/msg.descriptor ${CMAKE_CURRENT_BINARY_DIR}/pstm_deadlock_websocket_v2_test/META-INF/descriptors/msg.descriptor COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/meta_data/deadlock.scope.properties ${CMAKE_CURRENT_BINARY_DIR}/pstm_deadlock_websocket_v2_test/META-INF/topics/pub/deadlock.properties COPYONLY)
add_test(NAME pstm_deadlock_websocket_v2_test COMMAND pstm_deadlock_websocket_v2_test WORKING_DIRECTORY $<TARGET_PROPERTY:pstm_deadlock_websocket_v2_test,CONTAINER_LOC>)
setup_target_for_coverage(pstm_deadlock_websocket_v2_test SCAN_DIR ..)
endif()
if (BUILD_PUBSUB_PSA_ZMQ)
find_package(ZeroMQ REQUIRED)
find_package(czmq REQUIRED)
add_celix_container(pubsub_zmq_v2_tests
USE_CONFIG #ensures that a config.properties will be created with the launch bundles.
LAUNCHER_SRC ${CMAKE_CURRENT_LIST_DIR}/gtest/PubSubIntegrationTestSuite.cc
DIR ${CMAKE_CURRENT_BINARY_DIR}
PROPERTIES
LOGHELPER_STDOUT_FALLBACK_INCLUDE_DEBUG=true
CELIX_LOGGING_DEFAULT_ACTIVE_LOG_LEVEL=trace
BUNDLES
Celix::celix_pubsub_serializer_json
Celix::celix_pubsub_topology_manager
Celix::celix_pubsub_admin_zmq
Celix::celix_pubsub_protocol_wire_v2
pubsub_sut
pubsub_tst
pubsub_serializer
)
target_link_libraries(pubsub_zmq_v2_tests PRIVATE Celix::pubsub_api Celix::dfi ZeroMQ::ZeroMQ czmq::czmq GTest::gtest GTest::gtest_main)
target_include_directories(pubsub_zmq_v2_tests SYSTEM PRIVATE gtest)
add_test(NAME pubsub_zmq_v2_tests COMMAND pubsub_zmq_v2_tests WORKING_DIRECTORY $<TARGET_PROPERTY:pubsub_zmq_v2_tests,CONTAINER_LOC>)
setup_target_for_coverage(pubsub_zmq_v2_tests SCAN_DIR ..)
add_celix_container(pubsub_zmq_v2_zerocopy_tests
USE_CONFIG #ensures that a config.properties will be created with the launch bundles.
LAUNCHER_SRC ${CMAKE_CURRENT_LIST_DIR}/gtest/PubSubIntegrationTestSuite.cc
DIR ${CMAKE_CURRENT_BINARY_DIR}
PROPERTIES
LOGHELPER_STDOUT_FALLBACK_INCLUDE_DEBUG=true
PSA_ZMQ_ZEROCOPY_ENABLED=true
CELIX_LOGGING_DEFAULT_ACTIVE_LOG_LEVEL=trace
BUNDLES
Celix::celix_pubsub_serializer_json
Celix::celix_pubsub_topology_manager
Celix::celix_pubsub_admin_zmq
Celix::celix_pubsub_protocol_wire_v2
Celix::shell
Celix::shell_tui
pubsub_sut
pubsub_tst
pubsub_serializer
)
target_link_libraries(pubsub_zmq_v2_zerocopy_tests PRIVATE Celix::pubsub_api Celix::dfi ZeroMQ::ZeroMQ czmq::czmq GTest::gtest GTest::gtest_main)
target_include_directories(pubsub_zmq_v2_zerocopy_tests SYSTEM PRIVATE gtest)
add_test(NAME pubsub_zmq_v2_zerocopy_tests COMMAND pubsub_zmq_v2_zerocopy_tests WORKING_DIRECTORY $<TARGET_PROPERTY:pubsub_zmq_v2_zerocopy_tests,CONTAINER_LOC>)
setup_target_for_coverage(pubsub_zmq_v2_zerocopy_tests SCAN_DIR ..)
add_celix_container(pstm_deadlock_zmq_v2_test
USE_CONFIG #ensures that a config.properties will be created with the launch bundles.
LAUNCHER_SRC ${CMAKE_CURRENT_LIST_DIR}/pstm_deadlock_test/test_runner.cc
DIR ${CMAKE_CURRENT_BINARY_DIR}
PROPERTIES
LOGHELPER_STDOUT_FALLBACK_INCLUDE_DEBUG=true
CELIX_LOGGING_DEFAULT_ACTIVE_LOG_LEVEL=trace
BUNDLES
Celix::celix_pubsub_serializer_json
Celix::celix_pubsub_topology_manager
Celix::celix_pubsub_admin_zmq
Celix::celix_pubsub_protocol_wire_v2
)
target_compile_definitions(pstm_deadlock_zmq_v2_test PRIVATE -DDEADLOCK_SUT_BUNDLE_FILE=\"${DEADLOCK_SUT_BUNDLE_FILE}\")
target_link_libraries(pstm_deadlock_zmq_v2_test PRIVATE Celix::pubsub_api GTest::gtest GTest::gtest_main Celix::dfi ZeroMQ::ZeroMQ czmq::czmq)
target_include_directories(pstm_deadlock_zmq_v2_test SYSTEM PRIVATE pstm_deadlock_zmq_v2_test)
#Note we do not link to bundles, as result (to ensure a bundle zip file is created) an dependency on the bundle is needed.
add_celix_bundle_dependencies(pstm_deadlock_zmq_v2_test pubsub_deadlock_sut)
#Framework "bundle" has no cache dir. Default as "cache dir" the cwd is used.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/meta_data/msg.descriptor ${CMAKE_CURRENT_BINARY_DIR}/pstm_deadlock_zmq_v2_test/META-INF/descriptors/msg.descriptor COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/meta_data/deadlock.scope.properties ${CMAKE_CURRENT_BINARY_DIR}/pstm_deadlock_zmq_v2_test/META-INF/topics/pub/deadlock.properties COPYONLY)
add_test(NAME pstm_deadlock_zmq_v2_test COMMAND pstm_deadlock_zmq_v2_test WORKING_DIRECTORY $<TARGET_PROPERTY:pstm_deadlock_zmq_v2_test,CONTAINER_LOC>)
setup_target_for_coverage(pstm_deadlock_zmq_v2_test SCAN_DIR ..)
endif ()
if (BUILD_PUBSUB_PSA_ZMQ)
#Test suite to test if component with same topic and different scope combinations work
add_executable(test_pubsub_topic_and_scope_integration
gtest/PubSubTopicAndScopeIntegrationTestSuite.cc
)
target_link_libraries(test_pubsub_topic_and_scope_integration PRIVATE Celix::framework Celix::pubsub_api GTest::gtest GTest::gtest_main)
add_test(NAME test_pubsub_topic_and_scope_integration COMMAND test_pubsub_topic_and_scope_integration)
setup_target_for_coverage(test_pubsub_topic_and_scope_integration SCAN_DIR ..)
#configure topology manager and pubsub zmq, json serializer and wire protocol v2 bundles
celix_get_bundle_file(Celix::celix_pubsub_serializer_json PUBSUB_JSON_BUNDLE_FILE)
celix_get_bundle_file(Celix::celix_pubsub_topology_manager PUBSUB_TOPMAN_BUNDLE_FILE)
celix_get_bundle_file(Celix::celix_pubsub_admin_zmq PUBSUB_ZMQ_BUNDLE_FILE)
celix_get_bundle_file(Celix::celix_pubsub_protocol_wire_v2 PUBSUB_WIRE_BUNDLE_FILE)
add_celix_bundle_dependencies(test_pubsub_topic_and_scope_integration
celix_pubsub_serializer_json
celix_pubsub_topology_manager
celix_pubsub_admin_zmq
celix_pubsub_protocol_wire_v2
)
target_compile_definitions(test_pubsub_topic_and_scope_integration PRIVATE
PUBSUB_JSON_BUNDLE_FILE="${PUBSUB_JSON_BUNDLE_FILE}"
PUBSUB_TOPMAN_BUNDLE_FILE="${PUBSUB_TOPMAN_BUNDLE_FILE}"
PUBSUB_ZMQ_BUNDLE_FILE="${PUBSUB_ZMQ_BUNDLE_FILE}"
PUBSUB_WIRE_BUNDLE_FILE="${PUBSUB_WIRE_BUNDLE_FILE}"
)
endif ()
#[[
Add a integration test with use interceptors for a configurable PSA and wire protocol
ARGV0 is test target name
ARGV1 is PSA target name
ARGV2 is wire protocol target name
ARGV3 is option boolean whether http admin bundle should be used
]]
function(add_celix_interceptors_test_for_psa_and_wire)
set(TEST_TARGET_NAME ${ARGV0})
set(PSA ${ARGV1})
set(WIRE ${ARGV2})
set(USE_HTTP_ADMIN ${ARGV3})
#Test suite to test if pusbub interceptors
add_executable(${TEST_TARGET_NAME}
gtest/PubSubInterceptorTestSuite.cc
)
target_link_libraries(${TEST_TARGET_NAME} PRIVATE Celix::framework Celix::pubsub_api GTest::gtest GTest::gtest_main Celix::pubsub_spi)
target_include_directories(${TEST_TARGET_NAME} PRIVATE gtest)
add_test(NAME ${TEST_TARGET_NAME} COMMAND ${TEST_TARGET_NAME})
setup_target_for_coverage(${TEST_TARGET_NAME} SCAN_DIR ..)
#configure topology manager and pubsub admin, json serializer and wire protocol bundles
celix_get_bundle_file(Celix::celix_pubsub_serializer_json PUBSUB_JSON_BUNDLE_FILE)
celix_get_bundle_file(Celix::celix_pubsub_topology_manager PUBSUB_TOPMAN_BUNDLE_FILE)
celix_get_bundle_file(${PSA} PUBSUB_PSA_BUNDLE_FILE)
celix_get_bundle_file(${WIRE} PUBSUB_WIRE_BUNDLE_FILE)
celix_get_bundle_file(pubsub_sut PUBSUB_PUBLISHER_BUNDLE_FILE)
celix_get_bundle_file(pubsub_tst PUBSUB_SUBSCRIBER_BUNDLE_FILE)
add_celix_bundle_dependencies(${TEST_TARGET_NAME} Celix::celix_pubsub_serializer_json Celix::celix_pubsub_topology_manager ${PSA} ${WIRE} pubsub_sut pubsub_tst)
target_compile_definitions(${TEST_TARGET_NAME} PRIVATE
PUBSUB_JSON_BUNDLE_FILE="${PUBSUB_JSON_BUNDLE_FILE}"
PUBSUB_TOPMAN_BUNDLE_FILE="${PUBSUB_TOPMAN_BUNDLE_FILE}"
PUBSUB_PSA_BUNDLE_FILE="${PUBSUB_PSA_BUNDLE_FILE}"
PUBSUB_WIRE_BUNDLE_FILE="${PUBSUB_WIRE_BUNDLE_FILE}"
PUBSUB_PUBLISHER_BUNDLE_FILE="${PUBSUB_PUBLISHER_BUNDLE_FILE}"
PUBSUB_SUBSCRIBER_BUNDLE_FILE="${PUBSUB_SUBSCRIBER_BUNDLE_FILE}"
)
#if PSA websocket is enabled add http_admin bundle
if (USE_HTTP_ADMIN)
target_link_libraries(${TEST_TARGET_NAME} PRIVATE Celix::http_admin_api)
celix_get_bundle_file(Celix::http_admin HTTP_ADMIN_BUNDLE_FILE)
add_celix_bundle_dependencies(${TEST_TARGET_NAME} Celix::http_admin)
target_compile_definitions(${TEST_TARGET_NAME} PRIVATE HTTP_ADMIN_BUNDLE_FILE="${HTTP_ADMIN_BUNDLE_FILE}")
endif ()
#Linking against zmq if present
if (TARGET ZeroMQ::ZeroMQ AND TARGET czmq::czmq)
target_link_libraries(${TEST_TARGET_NAME} PRIVATE ZeroMQ::ZeroMQ czmq::czmq)
endif ()
endfunction()
if (BUILD_PUBSUB_PSA_WS)
add_celix_interceptors_test_for_psa_and_wire(test_pubsub_interceptors_ws_and_wire_v1_integration Celix::celix_pubsub_admin_websocket Celix::celix_pubsub_protocol_wire_v1 true)
add_celix_interceptors_test_for_psa_and_wire(test_pubsub_interceptors_ws_and_wire_v2_integration Celix::celix_pubsub_admin_websocket Celix::celix_pubsub_protocol_wire_v2 true)
endif ()
if (BUILD_PUBSUB_PSA_TCP)
add_celix_interceptors_test_for_psa_and_wire(test_pubsub_interceptors_tcp_and_wire_v1_integration Celix::celix_pubsub_admin_tcp Celix::celix_pubsub_protocol_wire_v1)
add_celix_interceptors_test_for_psa_and_wire(test_pubsub_interceptors_tcp_and_wire_v2_integration Celix::celix_pubsub_admin_tcp Celix::celix_pubsub_protocol_wire_v2)
endif ()
if (BUILD_PUBSUB_PSA_ZMQ)
add_celix_interceptors_test_for_psa_and_wire(test_pubsub_interceptors_zmq_and_wire_v1_integration Celix::celix_pubsub_admin_zmq Celix::celix_pubsub_protocol_wire_v1)
add_celix_interceptors_test_for_psa_and_wire(test_pubsub_interceptors_zmq_and_wire_v2_integration Celix::celix_pubsub_admin_zmq Celix::celix_pubsub_protocol_wire_v2)
endif ()
endif ()