diff --git a/doc/website/release-notes/iceoryx-unreleased.md b/doc/website/release-notes/iceoryx-unreleased.md index a2f1257836..2212f5896e 100644 --- a/doc/website/release-notes/iceoryx-unreleased.md +++ b/doc/website/release-notes/iceoryx-unreleased.md @@ -156,6 +156,7 @@ - Fix windows performance issue [#2377](https://github.com/eclipse-iceoryx/iceoryx/issues/2377) - Max Client and Server cannot be configured independently of Max Publisher and Subscriber [#2394](https://github.com/eclipse-iceoryx/iceoryx/issues/2394) - Fix call to non-existing `getService` in channel.inl [#2426](https://github.com/eclipse-iceoryx/iceoryx/issues/2426) +- Fix Bazel build with `--incompatible_disallow_empty_glob` [#2433](https://github.com/eclipse-iceoryx/iceoryx/issues/2433) **Refactoring:** diff --git a/iceoryx_binding_c/test/BUILD.bazel b/iceoryx_binding_c/test/BUILD.bazel index 4ee5525c4a..771323f8da 100644 --- a/iceoryx_binding_c/test/BUILD.bazel +++ b/iceoryx_binding_c/test/BUILD.bazel @@ -14,21 +14,31 @@ # # SPDX-License-Identifier: Apache-2.0 -load("@rules_cc//cc:defs.bzl", "cc_test") +load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") + +cc_library( + name = "test", + testonly = True, + hdrs = ["test.hpp"], + includes = ["."], + deps = ["@googletest//:gtest"], +) + +cc_library( + name = "mocks", + testonly = True, + hdrs = ["mocks/wait_set_mock.hpp"], + includes = ["mocks"], + deps = [ + "//iceoryx_binding_c", + "//iceoryx_posh", + ], +) cc_test( name = "binding_c_moduletests", - srcs = glob([ - "moduletests/*.cpp", - "moduletests/*.hpp", - "mocks/*.hpp", - "*.hpp", - ]), - includes = [ - ".", - "mocks", - "moduletests", - ], + srcs = glob(["moduletests/*"]), + includes = ["moduletests"], linkopts = select({ "//iceoryx_platform:linux": ["-ldl"], "//iceoryx_platform:mac": ["-ldl"], @@ -38,8 +48,9 @@ cc_test( "//conditions:default": ["-ldl"], }), tags = ["exclusive"], - visibility = ["//visibility:private"], deps = [ + ":mocks", + ":test", "//iceoryx_binding_c", "//iceoryx_hoofs:iceoryx_hoofs_testing", "//iceoryx_posh", @@ -50,17 +61,7 @@ cc_test( cc_test( name = "binding_c_integrationtests", - srcs = glob([ - "integrationtests/*.cpp", - "integrationtests/*.hpp", - "mocks/*.hpp", - "*.hpp", - ]), - includes = [ - ".", - "integrationtests", - "mocks", - ], + srcs = ["integrationtests/main_test_binding_c_integration.cpp"], linkopts = select({ "//iceoryx_platform:linux": ["-ldl"], "//iceoryx_platform:mac": ["-ldl"], @@ -70,8 +71,8 @@ cc_test( "//conditions:default": ["-ldl"], }), tags = ["exclusive"], - visibility = ["//visibility:private"], deps = [ + ":test", "//iceoryx_binding_c", "//iceoryx_hoofs:iceoryx_hoofs_testing", "//iceoryx_posh", diff --git a/iceoryx_hoofs/BUILD.bazel b/iceoryx_hoofs/BUILD.bazel index 0c3c0708c0..1729d650f2 100644 --- a/iceoryx_hoofs/BUILD.bazel +++ b/iceoryx_hoofs/BUILD.bazel @@ -31,30 +31,14 @@ configure_file( cc_library( name = "iceoryx_hoofs", - srcs = glob([ - "cli/source/*.cpp", - "concurrent/buffer/source/*.cpp", - "concurrent/sync/source/*.cpp", - "design/source/*.cpp", - "filesystem/source/*.cpp", - "memory/source/*.cpp", - "posix/auth/source/*.cpp", - "posix/design/source/*.cpp", - "posix/filesystem/source/*.cpp", - "posix/ipc/source/*.cpp", - "posix/sync/source/*.cpp", - "posix/time/source/*.cpp", - "posix/utility/source/*.cpp", - "posix/vocabulary/source/*.cpp", - "primitives/source/*.cpp", - "reporting/source/*.cpp", - "time/source/*.cpp", - "utility/source/*.cpp", - "vocabulary/source/**/*.cpp", - ]), - hdrs = glob(["buffer/**"]) + glob(["cli/**"]) + glob(["concurrent/**"]) + glob(["container/**"]) + glob(["design/**"]) + glob(["filesystem/**"]) + glob(["functional/**"]) + glob(["legacy/**"]) + glob(["memory/**"]) + glob(["posix/**"]) + glob(["primitives/**"]) + glob(["reporting/**"]) + glob(["time/**"]) + glob(["utility/**"]) + glob(["vocabulary/**"]) + [ - ":iceoryx_hoofs_deployment_hpp", - ], + srcs = glob( + [ + "**/*.cpp", + "**/*.inl", + ], + exclude = ["testing/**/*"], + ), + hdrs = glob(["**/*.hpp"]) + [":iceoryx_hoofs_deployment_hpp"], includes = [ "buffer/include/", "cli/include/", diff --git a/iceoryx_hoofs/test/BUILD.bazel b/iceoryx_hoofs/test/BUILD.bazel index d73e5831b8..59fcb23496 100644 --- a/iceoryx_hoofs/test/BUILD.bazel +++ b/iceoryx_hoofs/test/BUILD.bazel @@ -14,19 +14,19 @@ # # SPDX-License-Identifier: Apache-2.0 -load("@rules_cc//cc:defs.bzl", "cc_test") +load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") + +cc_library( + name = "test", + testonly = True, + hdrs = ["test.hpp"], + includes = ["."], + deps = ["@googletest//:gtest"], +) cc_test( name = "hoofs_moduletests", - srcs = glob([ - "moduletests/*.cpp", - "moduletests/*.hpp", - "*.hpp", - ]), - includes = [ - ".", - "moduletests", - ], + srcs = glob(["moduletests/**/*"]), linkopts = select({ "//iceoryx_platform:linux": ["-ldl"], "//iceoryx_platform:mac": [], @@ -39,21 +39,15 @@ cc_test( "exclusive", "requires-fakeroot", ], - visibility = ["//visibility:private"], - deps = ["//iceoryx_hoofs:iceoryx_hoofs_testing"], + deps = [ + ":test", + "//iceoryx_hoofs:iceoryx_hoofs_testing", + ], ) cc_test( name = "hoofs_integrationtests", - srcs = glob([ - "integrationtests/*.cpp", - "integrationtests/*.hpp", - "*.hpp", - ]), - includes = [ - ".", - "integrationtests", - ], + srcs = ["integrationtests/main_test_hoofs_integration.cpp"], linkopts = select({ "//iceoryx_platform:linux": ["-ldl"], "//iceoryx_platform:mac": [], @@ -63,6 +57,8 @@ cc_test( "//conditions:default": ["-ldl"], }), tags = ["exclusive"], - visibility = ["//visibility:private"], - deps = ["//iceoryx_hoofs:iceoryx_hoofs_testing"], + deps = [ + ":test", + "//iceoryx_hoofs:iceoryx_hoofs_testing", + ], ) diff --git a/iceoryx_hoofs/test/stresstests/BUILD.bazel b/iceoryx_hoofs/test/stresstests/BUILD.bazel index 3fe7007327..8940916a19 100644 --- a/iceoryx_hoofs/test/stresstests/BUILD.bazel +++ b/iceoryx_hoofs/test/stresstests/BUILD.bazel @@ -40,20 +40,12 @@ cc_test( "//conditions:default": ["-ldl"], }), tags = ["exclusive"], - visibility = ["//visibility:private"], deps = ["//iceoryx_hoofs:iceoryx_hoofs_testing"], ) cc_test( name = "hoofs_stresstests", - srcs = glob([ - "*.cpp", - "*.hpp", - ]), - includes = [ - ".", - "stresstests", - ], + srcs = glob(["*.cpp"]), linkopts = select({ "//iceoryx_platform:linux": ["-ldl"], "//iceoryx_platform:mac": [], @@ -63,6 +55,5 @@ cc_test( "//conditions:default": ["-ldl"], }), tags = ["exclusive"], - visibility = ["//visibility:private"], deps = ["//iceoryx_hoofs:iceoryx_hoofs_testing"], ) diff --git a/iceoryx_platform/test/BUILD.bazel b/iceoryx_platform/test/BUILD.bazel index 2de5902c4b..65b3ad3086 100644 --- a/iceoryx_platform/test/BUILD.bazel +++ b/iceoryx_platform/test/BUILD.bazel @@ -14,20 +14,19 @@ # # SPDX-License-Identifier: Apache-2.0 -load("@rules_cc//cc:defs.bzl", "cc_test") +load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") + +cc_library( + name = "test", + testonly = True, + hdrs = ["test.hpp"], + includes = ["."], + deps = ["@googletest//:gtest"], +) cc_test( name = "platform_moduletests", - srcs = glob([ - "moduletests/*.cpp", - "moduletests/*.hpp", - "*.hpp", - ]), - data = glob(["input/**"]), - includes = [ - ".", - "moduletests", - ], + srcs = glob(["moduletests/*.cpp"]), linkopts = select({ "//iceoryx_platform:linux": ["-ldl"], "//iceoryx_platform:mac": [], @@ -37,37 +36,25 @@ cc_test( "//conditions:default": ["-ldl"], }), tags = ["exclusive"], - visibility = ["//visibility:private"], deps = [ + ":test", "//iceoryx_platform", - "@googletest//:gtest", ], ) cc_test( name = "platform_integrationtests", - srcs = glob([ - "integrationtests/*.cpp", - "integrationtests/*.hpp", - "*.hpp", - ]), - data = glob(["input/**"]), - includes = [ - ".", - "integrationtests", - ], + srcs = ["integrationtests/main_test_platform_integration.cpp"], linkopts = select({ "//iceoryx_platform:linux": ["-ldl"], - "//iceoryx_platform:mac": [], "//iceoryx_platform:qnx": [], "//iceoryx_platform:unix": [], "//iceoryx_platform:win": [], "//conditions:default": ["-ldl"], }), tags = ["exclusive"], - visibility = ["//visibility:private"], deps = [ + ":test", "//iceoryx_platform", - "@googletest//:gtest", ], ) diff --git a/iceoryx_posh/BUILD.bazel b/iceoryx_posh/BUILD.bazel index 93e144d8c6..4305fef4da 100644 --- a/iceoryx_posh/BUILD.bazel +++ b/iceoryx_posh/BUILD.bazel @@ -117,9 +117,7 @@ cc_library( name = "iceoryx_posh", srcs = glob( [ - "source/log/**", "source/capro/**", - "source/error_handling/**", "source/mepoo/**", "source/popo/**", "source/version/**", diff --git a/iceoryx_posh/test/BUILD.bazel b/iceoryx_posh/test/BUILD.bazel index 1cf21cba51..e6111ef3c8 100644 --- a/iceoryx_posh/test/BUILD.bazel +++ b/iceoryx_posh/test/BUILD.bazel @@ -14,7 +14,15 @@ # # SPDX-License-Identifier: Apache-2.0 -load("@rules_cc//cc:defs.bzl", "cc_test") +load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") + +cc_library( + name = "test", + testonly = True, + hdrs = ["test.hpp"], + includes = ["."], + deps = ["@googletest//:gtest"], +) cc_test( name = "posh_moduletests", @@ -25,13 +33,6 @@ cc_test( "stubs/*.hpp", "*.hpp", ]), - data = glob(["input/**"]), - includes = [ - ".", - "mocks", - "moduletests", - "stubs", - ], linkopts = select({ "//iceoryx_platform:linux": ["-ldl"], "//iceoryx_platform:mac": [], @@ -41,8 +42,8 @@ cc_test( "//conditions:default": ["-ldl"], }), tags = ["exclusive"], - visibility = ["//visibility:private"], deps = [ + ":test", "//iceoryx_hoofs:iceoryx_hoofs_testing", "//iceoryx_posh", "//iceoryx_posh:iceoryx_posh_config", @@ -55,15 +56,7 @@ cc_test( cc_test( name = "posh_integrationtests", timeout = "long", - srcs = glob([ - "integrationtests/*.cpp", - "integrationtests/*.hpp", - "*.hpp", - ]), - includes = [ - ".", - "integrationtests", - ], + srcs = glob(["integrationtests/*"]), linkopts = select({ "//iceoryx_platform:linux": ["-ldl"], "//iceoryx_platform:mac": [], @@ -73,8 +66,8 @@ cc_test( "//conditions:default": ["-ldl"], }), tags = ["exclusive"], - visibility = ["//visibility:private"], deps = [ + ":test", "//iceoryx_hoofs:iceoryx_hoofs_testing", "//iceoryx_posh", "//iceoryx_posh:iceoryx_posh_gateway",