| # 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/config.gni") |
| import("//build/rust/rustc_binary.gni") |
| |
| rustc_binary("example_bin") { |
| testonly = true |
| name = "rust_example_bin" |
| edition = "2021" |
| |
| deps = [ |
| "//src/lib/fake-clock/examples/fidl:fuchsia.fakeclock.test_rust", |
| "//src/lib/fake-clock/named-timer", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ "src/main.rs" ] |
| |
| non_rust_deps = [ "//src/lib/fake-clock/lib" ] |
| } |
| |
| rustc_test("test_bin") { |
| name = "integ_test_bin" |
| edition = "2021" |
| |
| sources = [ "test/test.rs" ] |
| |
| source_root = "test/test.rs" |
| |
| deps = [ |
| "//src/lib/fake-clock/examples/fidl:fuchsia.fakeclock.test_rust", |
| "//src/lib/fake-clock/fidl:fidl_rust", |
| "//src/lib/fake-clock/named-timer", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| ] |
| } |
| |
| fuchsia_component("rust_example") { |
| testonly = true |
| component_name = "rust_example" |
| manifest = "meta/example.cml" |
| deps = [ ":example_bin" ] |
| } |
| |
| fuchsia_component("rust_integ_test_driver") { |
| testonly = true |
| component_name = "rust_integ_test_driver" |
| manifest = "meta/test_driver.cml" |
| deps = [ ":test_bin" ] |
| } |
| |
| fuchsia_component("rust_integ_test") { |
| testonly = true |
| component_name = "rust_integ_test" |
| manifest = "meta/test.cml" |
| } |
| |
| fuchsia_test_package("fake-clock-rust") { |
| test_components = [ ":rust_integ_test" ] |
| deps = [ |
| ":rust_example", |
| ":rust_integ_test_driver", |
| "//src/lib/fake-clock/svc", |
| ] |
| } |
| |
| group("examples") { |
| deps = [ ":fake-clock-rust" ] |
| testonly = true |
| } |