Skip to content

Commit

Permalink
pw_bluetooth_sapphire: Configure Fuchsia backends
Browse files Browse the repository at this point in the history
Configure the Fuchsia backends and test them by adding the bt-host
common tests to the infra test target.

Bug: b/359242468
Change-Id: I4131bfd58557c92a7d1427091e2e9a6ab7ccd003
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/232035
Commit-Queue: Ben Lawson <[email protected]>
Presubmit-Verified: CQ Bot Account <[email protected]>
Reviewed-by: Darren Chan <[email protected]>
Reviewed-by: Ted Pudlik <[email protected]>
Lint: Lint 🤖 <[email protected]>
Reviewed-by: Faraaz Sareshwala <[email protected]>
  • Loading branch information
BenjaminLawson authored and CQ Bot Account committed Aug 27, 2024
1 parent 50a2a2f commit afe9da3
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 17 deletions.
4 changes: 3 additions & 1 deletion pw_assert_fuchsia/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ cc_library(
"public/pw_assert_fuchsia/check_backend.h",
],
includes = [
"public_overrides",
"assert_public_overrides",
"check_public_overrides",
"public",
],
target_compatible_with = ["@platforms//os:fuchsia"],
deps = [
Expand Down
1 change: 1 addition & 0 deletions pw_bluetooth_sapphire/fuchsia/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ license(

qemu_tests = [
"//pw_bluetooth_sapphire/fuchsia/bt_host:unittest_pkg",
"//pw_bluetooth_sapphire/fuchsia/host/common:test_pkg",
]

fuchsia_test_group(
Expand Down
12 changes: 4 additions & 8 deletions pw_bluetooth_sapphire/fuchsia/backends.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
common:fuchsia --@pigweed//pw_assert:backend=@pigweed//pw_assert_fuchsia
common:fuchsia --@pigweed//pw_assert:check_backend=@pigweed//pw_assert_fuchsia
common:fuchsia --@pigweed//pw_assert:check_backend_impl=@pigweed//pw_build:empty_cc_library

# TODO: https://pwbug.dev/360411906 - Port these remaining fuchsia backend
# configurations from fuchsia.git into @pigweed.
# common:fuchsia --@pigweed//pw_log:backend=@pigweed//pw_log_fuchsia
# common:fuchsia --@pigweed//pw_function:config_override=//third_party/pigweed/backends/pw_function:config
# common:fuchsia --@pigweed//pw_unit_test:backend=@pigweed//pw_unit_test:googletest
# common:fuchsia --@pigweed//pw_async:task_backend=//third_party/pigweed/backends/pw_async_fuchsia:task
# common:fuchsia --@pigweed//pw_async:fake_dispatcher_backend=//third_party/pigweed/backends/pw_async_fuchsia:fake_dispatcher
common:fuchsia --@pigweed//pw_log:backend=@pigweed//pw_log_fuchsia
common:fuchsia --@pigweed//pw_unit_test:backend=@pigweed//pw_unit_test:googletest
common:fuchsia --@pigweed//pw_async:task_backend=@pigweed//pw_async_fuchsia:task
common:fuchsia --@pigweed//pw_async:fake_dispatcher_backend=@pigweed//pw_async_fuchsia:fake_dispatcher
4 changes: 3 additions & 1 deletion pw_bluetooth_sapphire/fuchsia/inspect_testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ cc_library(
srcs = ["inspect.cc"],
hdrs = ["public/lib/inspect/testing/cpp/inspect.h"],
includes = ["public"],
deps = select({
deps = [
"//pw_bluetooth_sapphire:config",
] + select({
"@platforms//os:fuchsia": [
"@com_google_googletest//:gtest",
"@fuchsia_sdk//pkg/inspect",
Expand Down
1 change: 1 addition & 0 deletions pw_bluetooth_sapphire/host/common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,5 @@ cc_library(
"//pw_bluetooth_sapphire/host/testing:gtest_main",
"@pigweed//pw_async:fake_dispatcher_fixture",
],
alwayslink = 1,
)
38 changes: 31 additions & 7 deletions pw_bluetooth_sapphire/host/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ cc_library(
copts = [
"-Wno-unused-parameter",
],
target_compatible_with = ["//pw_unit_test:googletest_only"],
target_compatible_with = select({
"//pw_unit_test:googletest_only": [],
"@platforms//os:fuchsia": [],
"//conditions:default": ["@platforms//:incompatible"],
}),
deps = [
":fake_controller",
":mock_controller",
Expand All @@ -47,7 +51,11 @@ cc_library(
copts = [
"-Wno-unused-parameter",
],
target_compatible_with = ["//pw_unit_test:googletest_only"],
target_compatible_with = select({
"//pw_unit_test:googletest_only": [],
"@platforms//os:fuchsia": [],
"//conditions:default": ["@platforms//:incompatible"],
}),
# test_helpers.h is currently in bt-host:public, but its deps are here.
deps = [
"//pw_bluetooth_sapphire:public",
Expand All @@ -64,7 +72,11 @@ cc_library(
copts = [
"-Wno-unused-parameter",
],
target_compatible_with = ["//pw_unit_test:googletest_only"],
target_compatible_with = select({
"//pw_unit_test:googletest_only": [],
"@platforms//os:fuchsia": [],
"//conditions:default": ["@platforms//:incompatible"],
}),
deps = [
"//pw_bluetooth_sapphire:public",
"//pw_bluetooth_sapphire/host/common",
Expand All @@ -83,7 +95,11 @@ cc_library(
copts = [
"-Wno-unused-parameter",
],
target_compatible_with = ["//pw_unit_test:googletest_only"],
target_compatible_with = select({
"//pw_unit_test:googletest_only": [],
"@platforms//os:fuchsia": [],
"//conditions:default": ["@platforms//:incompatible"],
}),
deps = [
":controller_test_double_base",
":test_helpers",
Expand All @@ -110,7 +126,11 @@ cc_library(
copts = [
"-Wno-unused-parameter",
],
target_compatible_with = ["//pw_unit_test:googletest_only"],
target_compatible_with = select({
"//pw_unit_test:googletest_only": [],
"@platforms//os:fuchsia": [],
"//conditions:default": ["@platforms//:incompatible"],
}),
deps = [
":controller_test_double_base",
":test_helpers",
Expand Down Expand Up @@ -142,7 +162,11 @@ cc_library(
cc_library(
name = "loop_fixture",
testonly = True,
target_compatible_with = ["//pw_unit_test:googletest_only"],
target_compatible_with = select({
"//pw_unit_test:googletest_only": [],
"@platforms//os:fuchsia": [],
"//conditions:default": ["@platforms//:incompatible"],
}),
# header is in bt-host:public
deps = [
"//pw_bluetooth_sapphire:public",
Expand All @@ -152,7 +176,7 @@ cc_library(
)

cc_library(
name = "_test.lib",
name = "testing_test.lib",
testonly = True,
srcs = [
"fake_controller_test.cc",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include "pw_preprocessor/compiler.h"
PW_MODIFY_DIAGNOSTICS_PUSH();
PW_MODIFY_DIAGNOSTIC(ignored, "-Wswitch-enum");
#include <lib/inspect/cpp/hierarchy.h>
#include <lib/inspect/cpp/inspect.h>
#include <lib/inspect/cpp/reader.h>
PW_MODIFY_DIAGNOSTICS_POP();
#endif // NINSPECT
1 change: 1 addition & 0 deletions pw_function/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ alias(
(
"@platforms//os:android",
"@platforms//os:chromiumos",
"@platforms//os:fuchsia",
"@platforms//os:linux",
"@platforms//os:macos",
"@platforms//os:windows",
Expand Down

0 comments on commit afe9da3

Please sign in to comment.