# Copyright 2026 Open Source Robotics Foundation, Inc. # # Licensed 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. load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_test") load("@rules_shell//shell:sh_test.bzl", "sh_test") [ cc_test( name = name, timeout = "short", srcs = [name + ".c"], copts = [ "-Wno-unused-variable", "-Wno-missing-braces", ], tags = ["requires-network"], deps = ["@zenoh-c"], ) for name in [ "z_api_config_test", "z_api_constants", "z_api_double_drop_test", "z_api_drop_options", "z_api_encoding_test", "z_api_keyexpr_drop_test", "z_api_keyexpr_test", "z_api_liveliness", "z_api_null_drop_test", "z_api_payload_test", "z_api_session_test", "z_api_unitinialized_check", ] ] cc_test( name = "z_build_static", timeout = "short", srcs = ["z_build_static.c"], copts = [ "-Wno-unused-variable", "-Wno-missing-braces", ], linkstatic = True, tags = [ "exclusive", "requires-network", ], deps = ["@zenoh-c"], ) cc_test( name = "z_build_shared", timeout = "short", srcs = ["z_build_shared.c"], copts = [ "-Wno-unused-variable", "-Wno-missing-braces", ], linkstatic = False, local_defines = ["ZENOHC_DYN_LIB"], tags = [ "exclusive", "requires-network", ], deps = ["@zenoh-c"], ) [ cc_test( name = name, timeout = "short", srcs = [ "z_int_helpers.h", name + ".c", ], copts = [ "-Wno-unused-variable", "-Wno-missing-braces", ], tags = [ "exclusive", "requires-network", ], deps = ["@zenoh-c"], ) for name in [ "z_int_helpers_test", "z_int_pub_sub_attachment_test", "z_int_pub_sub_test", "z_int_queryable_attachment_test", "z_int_queryable_test", "z_int_advanced_pub_sub_test", "z_int_pub_cache_query_sub_test", ] ] # Leak test : z_leak_pub_sub_test (require valgrind) cc_binary( name = "z_leak_pub_sub_test_impl", srcs = ["z_leak_pub_sub_test.c"], copts = [ "-Wno-unused-variable", "-Wno-missing-braces", ], deps = ["@zenoh-c"], ) sh_test( name = "z_leak_pub_sub_test", timeout = "short", srcs = ["run_leak_check.sh"], args = ["$(location :z_leak_pub_sub_test_impl)"], data = [":z_leak_pub_sub_test_impl"], tags = [ "exclusive", "requires-network", ], ) # Leak test : z_leak_queryable_get_test (require valgrind) cc_binary( name = "z_leak_queryable_get_test_impl", srcs = ["z_leak_queryable_get_test.c"], copts = [ "-Wno-unused-variable", "-Wno-missing-braces", ], deps = ["@zenoh-c"], ) sh_test( name = "z_leak_queryable_get_test", timeout = "short", srcs = ["run_leak_check.sh"], args = ["$(location :z_leak_queryable_get_test_impl)"], data = [":z_leak_queryable_get_test_impl"], tags = [ "exclusive", "requires-network", ], )