| # Copyright 2020 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. |
| |
| # This file was generated by the `fx create` command. The template |
| # is located at `//tools/create/templates/component-test/BUILD.gn.tmpl-rust`. |
| # If you find something broken, we are eager to review fixes. |
| |
| import("//build/components.gni") |
| import("//build/rust/rustc_test.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":package" ] |
| } |
| |
| rustc_test("bin") { |
| name = "my-component-test-rust" |
| edition = "2021" |
| |
| deps = [ |
| "//src/lib/fuchsia", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ "src/lib.rs" ] |
| } |
| |
| fuchsia_component("component") { |
| testonly = true |
| component_name = "my-component-test-rust" |
| manifest = "meta/my_component_test_rust.cml" |
| deps = [ ":bin" ] |
| } |
| |
| # Run with `fx test my-component-test-rust-tests`. |
| fuchsia_test_package("package") { |
| package_name = "my-component-test-rust-tests" |
| test_components = [ ":component" ] |
| } |