blob: df19bd86e18a77d61501d235592d42ebc783aac0 [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/package.gni")
import("//build/rust/rustc_binary.gni")
import("//build/rust/rustc_test.gni")
import("//build/test/test_package.gni")
import("//build/testing/environments.gni")
rustc_binary("bin") {
name = "fake_factory_items"
edition = "2018"
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",
]
}
package("fake_factory_items") {
deps = [ ":bin" ]
binaries = [
{
name = "fake_factory_items"
},
]
meta = [
{
path = rebase_path("meta/fake_factory_items.cmx")
dest = "fake_factory_items.cmx"
},
]
}
rustc_test("fake_factory_items_test") {
edition = "2018"
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" ]
}
test_package("fake_factory_items_tests") {
deps = [
":bin",
":fake_factory_items_test",
]
binaries = [
{
name = "fake_factory_items"
},
]
meta = [
{
path = rebase_path("meta/fake_factory_items.cmx")
dest = "fake_factory_items.cmx"
},
]
resources = [
{
path = rebase_path("testdata/empty")
dest = "empty"
},
{
path = rebase_path("testdata/random1")
dest = "random1"
},
{
path = rebase_path("testdata/random2")
dest = "random2"
},
{
path = rebase_path("testdata/fake_factory_items.json")
dest = "fake_factory_items.json"
},
]
tests = [
{
name = "fake_factory_items_test"
},
]
}