blob: 1d69c5b5fd7d1be87c8ed97c736211c657ba6899 [file] [log] [blame]
# Copyright 2019 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")
import("//build/rust/rustc_test.gni")
import("//build/testing/environments.gni")
rustc_binary("bin") {
name = "fake_factory_items"
edition = "2021"
deps = [
"//sdk/fidl/fuchsia.boot:fuchsia.boot-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:structopt",
"//third_party/rust_crates:thiserror",
]
sources = [
"src/config.rs",
"src/fake_factory_items_server.rs",
"src/main.rs",
]
}
fuchsia_component("fake_factory_items_comp") {
component_name = "fake_factory_items"
manifest = "meta/fake_factory_items.cmx"
deps = [ ":bin" ]
}
fuchsia_package("fake_factory_items") {
deps = [ ":fake_factory_items_comp" ]
}
rustc_test("fake_factory_items_test") {
edition = "2021"
source_root = "tests/fake_factory_items_test.rs"
deps = [
"//sdk/fidl/fuchsia.boot:fuchsia.boot-rustc",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:thiserror",
]
sources = [ "tests/fake_factory_items_test.rs" ]
}
resource("testdata") {
testonly = true
sources = [
"testdata/empty",
"testdata/fake_factory_items.json",
"testdata/random1",
"testdata/random2",
]
outputs = [ "data/{{source_file_part}}" ]
}
fuchsia_test_component("fake_factory_items_test_comp") {
component_name = "fake_factory_items_test"
manifest = "meta/fake_factory_items_test.cmx"
deps = [ ":fake_factory_items_test" ]
}
fuchsia_test_package("fake_factory_items_tests") {
test_components = [ ":fake_factory_items_test_comp" ]
deps = [
":fake_factory_items_comp",
":testdata",
]
}