| # 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/bazel/export_fuchsia_package_to_bazel.gni") | |
| import("//build/components.gni") | |
| import("//build/packages/sdk_fuchsia_package.gni") | |
| import("//build/testing/cc_test_executable.gni") | |
| group("testing") { | |
| testonly = true | |
| deps = [ ":fake-build-info" ] | |
| } | |
| executable("bin") { | |
| output_name = "fake_build_info" | |
| sources = [ | |
| "build_info.cc", | |
| "build_info.h", | |
| "main.cc", | |
| ] | |
| deps = [ | |
| "//sdk/fidl/fuchsia.buildinfo.test:fuchsia.buildinfo.test_cpp", | |
| "//sdk/lib/async-loop:async-loop-cpp", | |
| "//sdk/lib/async-loop:async-loop-default", | |
| "//sdk/lib/component/outgoing/cpp", | |
| "//src/lib/fsl", | |
| ] | |
| } | |
| fuchsia_component("fake-build-info-component") { | |
| component_name = "fake_build_info" | |
| manifest = "meta/build_info.cml" | |
| deps = [ ":bin" ] | |
| } | |
| fuchsia_package("fake-build-info") { | |
| deps = [ ":fake-build-info-component" ] | |
| } | |
| if (current_toolchain == default_toolchain) { | |
| sdk_fuchsia_package("fake-build-info-sdk") { | |
| distribution_name = "fake-build-info" | |
| package_label = ":fake-build-info" | |
| category = "partner" | |
| expected_files_exact = [ "meta/fake_build_info.cm" ] | |
| api_level_added = 25 | |
| } | |
| } | |
| export_fuchsia_package_to_bazel("fake-build-info.bazel_input") { | |
| testonly = true | |
| package = ":fake-build-info" | |
| } | |
| cc_test_executable("test-bin") { | |
| testonly = true | |
| output_name = "fake_build_info_integration_test" | |
| sources = [ | |
| "build_info.h", | |
| "build_info_test.cc", | |
| ] | |
| deps = [ | |
| "//sdk/fidl/fuchsia.buildinfo:fuchsia.buildinfo_cpp", | |
| "//sdk/fidl/fuchsia.buildinfo.test:fuchsia.buildinfo.test_cpp", | |
| "//sdk/fidl/fuchsia.component:fuchsia.component_cpp", | |
| "//sdk/lib/sys/component/cpp/testing:cpp", | |
| "//src/lib/fxl/test:gtest_main", | |
| "//src/lib/testing/loop_fixture", | |
| ] | |
| } | |
| fuchsia_component("fake-build-info-test-component") { | |
| testonly = true | |
| component_name = "fake_build_info_test" | |
| manifest = "meta/build_info_integration.cml" | |
| deps = [ ":test-bin" ] | |
| } | |
| fuchsia_test_package("fake-build-info-test") { | |
| package_name = "fake_build_info_test" | |
| test_components = [ ":fake-build-info-test-component" ] | |
| deps = [ ":fake-build-info-component" ] | |
| } | |
| group("tests") { | |
| testonly = true | |
| deps = [ ":fake-build-info-test" ] | |
| } |