blob: e0f79713cbc7d27a22761c588d9d61203c8163ea [file]
# Copyright 2026 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
load("//build/bazel/rules/cc:fx_cc_binary.bzl", "fx_cc_binary")
load("//build/bazel/rules/cc:fx_cc_library.bzl", "fx_cc_library")
load(
"//build/bazel/rules/components:fx_component.bzl",
"fx_component",
"fx_component_manifest",
)
load(
"//build/bazel/rules/packages:fx_packaged_binary.bzl",
"fx_packaged_binary",
)
package(default_applicable_licenses = ["//:license"])
fx_cc_library(
name = "lib",
srcs = ["reverser.cc"],
hdrs = ["reverser.h"],
deps = [
"//examples/diagnostics/inspect/codelab/fidl:fuchsia.examples.inspect_hlcpp",
"//sdk/lib/inspect/component/cpp",
],
alwayslink = True,
)
fx_cc_binary(
name = "bin",
srcs = ["main.cc"],
gn_output_name = "inspect_cpp_codelab_part_3",
deps = [
":lib",
"//sdk/lib/async-loop:async-loop-cpp",
"//sdk/lib/async-loop:async-loop-default",
"//sdk/lib/sys/cpp",
"//sdk/lib/syslog/cpp",
],
)
fx_packaged_binary(
name = "bin_packaged",
binary = ":bin",
binary_name = "inspect_cpp_codelab_part_3",
)
fx_component_manifest(
name = "part_3_manifest",
component_name = "part_3",
includes = [
"//sdk/lib/inspect:client.shard",
"//sdk/lib/syslog:client.shard",
],
manifest = "meta/part_3.cml",
)
fx_component(
name = "part_3",
compiled_manifest = ":part_3_manifest",
deps = [":bin_packaged"],
)
fx_cc_binary(
name = "unittests",
testonly = True,
srcs = ["reverser_unittests.cc"],
gn_output_name = "inspect_cpp_codelab_part_3_unittests",
deps = [
":lib",
"//sdk/lib/sys/cpp",
"//src/lib/fxl/test:gtest_main",
"//src/lib/testing/loop_fixture",
# CODELAB: Add the testing library.
],
)
fx_cc_binary(
name = "integration_test",
testonly = True,
srcs = ["tests/integration_test.cc"],
# Workspace-root angled include for examples/diagnostics/inspect/codelab/cpp/testing/integration_test.h.
# @bazel2gn:skip
copts = ["-I."],
gn_output_name = "inspect_cpp_codelab_part_3_integration_test",
deps = [
"//examples/diagnostics/inspect/codelab/cpp/testing:inspect-cpp-codelab-testing",
"//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics_hlcpp",
"//sdk/lib/sys/cpp",
"//src/lib/fxl/test:gtest_main",
"//src/lib/testing/loop_fixture",
],
)