| # Copyright 2022 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. |
| |
| import("//build/components.gni") |
| import("//build/test.gni") |
| import("//build/testing/cc_test_executable.gni") |
| |
| # Service tests (ie only FIDL) |
| cc_test_executable("inspect_service_llcpp_unittests_bin") { |
| testonly = true |
| sources = [ "service_unittests.cc" ] |
| deps = [ |
| "//sdk/fidl/fuchsia.component:fuchsia.component_cpp", |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_cpp", |
| "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics_hlcpp", |
| "//sdk/fidl/fuchsia.inspect:fuchsia.inspect_cpp", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_cpp", |
| "//sdk/lib/component/incoming/cpp", |
| "//sdk/lib/diagnostics/reader/cpp:archive_reader", |
| "//sdk/lib/inspect/component/cpp", |
| "//sdk/lib/inspect/testing/cpp", |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| "//third_party/googletest:gmock", |
| "//zircon/system/ulib/inspect", |
| ] |
| } |
| |
| executable("program_writing_inspect_bin") { |
| sources = [ "program.cc" ] |
| |
| deps = [ |
| ":config", |
| "//sdk/lib/async-loop:async-loop-cpp", |
| "//sdk/lib/async-loop:async-loop-default", |
| "//sdk/lib/inspect/component/cpp", |
| "//zircon/system/ulib/inspect", |
| ] |
| } |
| |
| fuchsia_component_manifest("program_writing_inspect_manifest") { |
| manifest = "meta/program.cml" |
| component_name = "program" |
| } |
| |
| fuchsia_component("program_writing_inspect") { |
| deps = [ ":program_writing_inspect_bin" ] |
| cm_label = ":program_writing_inspect_manifest" |
| } |
| |
| fuchsia_structured_config_values("publish_inspector_only_conf") { |
| cm_label = ":program_writing_inspect_manifest" |
| values = { |
| publish_inspector = true |
| publish_vmo = false |
| } |
| } |
| |
| fuchsia_structured_config_values("publish_vmo_only_conf") { |
| cm_label = ":program_writing_inspect_manifest" |
| values = { |
| publish_inspector = false |
| publish_vmo = true |
| } |
| } |
| |
| fuchsia_structured_config_cpp_elf_lib("config") { |
| cm_label = ":program_writing_inspect_manifest" |
| } |
| |
| fuchsia_test_component("service_tests") { |
| manifest = "meta/test.cml" |
| deps = [ ":inspect_service_llcpp_unittests_bin" ] |
| } |
| |
| fuchsia_package("publish_inspector_only_pkg") { |
| testonly = true |
| package_name = "publish_inspector_only" |
| deps = [ |
| ":program_writing_inspect", |
| ":publish_inspector_only_conf", |
| ] |
| } |
| |
| fuchsia_package("publish_vmo_only_pkg") { |
| testonly = true |
| package_name = "publish_vmo_only" |
| deps = [ |
| ":program_writing_inspect", |
| ":publish_vmo_only_conf", |
| ] |
| } |
| |
| fuchsia_test_package("inspect_service_llcpp_tests") { |
| test_components = [ ":service_tests" ] |
| subpackages = [ |
| ":publish_inspector_only_pkg", |
| ":publish_vmo_only_pkg", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":inspect_service_llcpp_tests" ] |
| } |