blob: e564d25da3370cdf69106c77c10e97e7a7fc7986 [file] [log] [blame]
# Copyright 2021 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/rust/rustc_binary.gni")
group("echo") {
testonly = true
deps = [
":echo-example",
":tests",
]
}
group("tests") {
testonly = true
deps = [ ":echo-unittests" ]
}
rustc_binary("echo_example") {
# Generates a GN target for unit-tests with the label `bin_test`,
# and a binary named `echo_bin_test`.
with_unit_tests = true
deps = [
"//src/lib/diagnostics/inspect/runtime/rust",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:tracing",
]
sources = [ "src/main.rs" ]
}
fuchsia_component("echo_example_component") {
component_name = "echo"
manifest = "meta/echo.cml"
deps = [ ":echo_example" ]
}
fuchsia_package("echo-example") {
deps = [ ":echo_example_component" ]
}
# [START unittest]
fuchsia_unittest_package("echo-unittests") {
deps = [ ":echo_example_test" ]
}
# [END unittest]