blob: 5d6397b25908ac5a092e9d1227b610491e408c26 [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/config.gni")
import("//build/rust/rustc_binary.gni")
import("//build/rust/rustc_test.gni")
import("//build/testing/environments.gni")
rustc_binary("bin") {
name = "fake_factory_store_provider"
edition = "2021"
deps = [
"//sdk/fidl/fuchsia.factory:fuchsia.factory_rust",
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-component",
"//src/storage/lib/vfs/rust:vfs",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:structopt",
"//third_party/rust_crates:tracing",
]
sources = [ "src/main.rs" ]
}
components = [
"fake_alpha",
"fake_cast",
"fake_misc",
"fake_playready",
"fake_weave",
"fake_widevine",
]
component_deps = []
foreach(comp, components) {
comp_target_name = "${comp}_comp"
component_deps += [ ":$comp_target_name" ]
fuchsia_component(comp_target_name) {
component_name = comp
manifest = "meta/${comp}.cml"
deps = [ ":bin" ]
}
}
fuchsia_package("fake_factory_store_providers") {
deps = component_deps
}
rustc_test("fake_factory_store_providers_test") {
edition = "2021"
source_root = "tests/fake_factory_store_providers_test.rs"
deps = [
"//sdk/fidl/fuchsia.factory:fuchsia.factory_rust",
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-fs",
"//third_party/rust_crates:anyhow",
]
sources = [ "tests/fake_factory_store_providers_test.rs" ]
}
fuchsia_unittest_package("fake_factory_store_providers_tests") {
manifest = "meta/fake_factory_store_providers_test.cml"
deps = component_deps + [
":fake_factory_store_providers_test",
":test_fake_factory_store_providers_config",
]
}
resource("test_fake_factory_store_providers_config") {
sources = [
"testdata/test_alpha.config",
"testdata/test_cast.config",
"testdata/test_misc.config",
"testdata/test_playready.config",
"testdata/test_weave.config",
"testdata/test_widevine.config",
]
outputs = [ "data/{{source_file_part}}" ]
}
group("tests") {
testonly = true
deps = [
":fake_factory_store_providers",
":fake_factory_store_providers_tests",
":test_fake_factory_store_providers_config",
]
}