blob: 6d7a8103f02dac5a245e010815f090486e157386 [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("tests") {
testonly = true
deps = [ ":echo-rust-unittests" ]
}
rustc_binary("echo_example_rust") {
edition = "2021"
# 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/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("rust-component") {
component_name = "echo_rust"
manifest = "meta/echo.cml"
deps = [ ":echo_example_rust" ]
}
# [START unittest]
fuchsia_unittest_package("echo-rust-unittests") {
deps = [ ":echo_example_rust_test" ]
}
# [END unittest]