blob: f2f5e7d46591d7f5e7f1674f02035d18e23ec2b8 [file] [log] [blame] [edit]
# 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 = "2018"
deps = [
"//src/lib/fake-clock/examples/fidl:fuchsia.fakeclock.test-rustc",
"//src/lib/fake-clock/named-timer",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-runtime",
"//src/lib/syslog/rust:syslog",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:log",
]
sources = [ "src/main.rs" ]
non_rust_deps = [ "//src/lib/fake-clock/lib" ]
}
rustc_test("test_bin") {
name = "integ_test_bin"
edition = "2018"
sources = [ "test/test.rs" ]
source_root = "test/test.rs"
deps = [
"//src/lib/fake-clock/examples/fidl:fuchsia.fakeclock.test-rustc",
"//src/lib/fake-clock/fidl:fidl-rustc",
"//src/lib/fake-clock/named-timer",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:futures",
]
}
# Components v1 setup
fuchsia_component("rust_example") {
testonly = true
component_name = "rust_example"
manifest = "meta/example.cmx"
deps = [ ":example_bin" ]
}
fuchsia_component("rust_integ_test") {
testonly = true
component_name = "rust_integ_test"
manifest = "meta/test.cmx"
deps = [ ":test_bin" ]
}
fuchsia_test_package("fake-clock-rust") {
test_components = [ ":rust_integ_test" ]
deps = [
":rust_example",
"//src/lib/fake-clock/svc",
]
}
# Components v2 setup
fuchsia_component("rust_example_v2") {
testonly = true
component_name = "rust_example_v2"
manifest = "meta/example.cml"
deps = [ ":example_bin" ]
}
fuchsia_component("rust_integ_test_v2_driver") {
testonly = true
component_name = "rust_integ_test_v2_driver"
manifest = "meta/test_driver.cml"
deps = [ ":test_bin" ]
}
fuchsia_component("rust_integ_test_v2") {
testonly = true
component_name = "rust_integ_test_v2"
manifest = "meta/test.cml"
}
fuchsia_test_package("fake-clock-rust-v2") {
test_components = [ ":rust_integ_test_v2" ]
deps = [
":rust_example_v2",
":rust_integ_test_v2_driver",
"//src/lib/fake-clock/svc:svc_v2",
]
}
group("examples") {
deps = [
":fake-clock-rust",
":fake-clock-rust-v2",
]
testonly = true
}