blob: 86883b0917070a6d37351fde733302c2c19e5a6b [file] [log] [blame]
# Copyright 2020 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/security.gni")
group("tests") {
testonly = true
deps = [
":example",
":universe-resolver-unittests",
]
}
rustc_binary("bin") {
output_name = "universe_resolver"
# Generates a GN target for unit-tests with the label `bin_test`, and
# a binary named `universe_resolver_bin_test`.
with_unit_tests = true
deps = [
"//garnet/lib/rust/io_util",
"//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl-rustc",
"//sdk/fidl/fuchsia.data:fuchsia.data-rustc",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//sdk/fidl/fuchsia.mem:fuchsia.mem-rustc",
"//sdk/fidl/fuchsia.pkg:fuchsia.pkg-rustc",
"//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-url",
"//src/lib/syslog/rust:syslog",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:argh",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:log",
"//third_party/rust_crates:thiserror",
]
test_deps = [
"//sdk/fidl/fuchsia.component.config:fuchsia.component.config-rustc",
"//src/lib/fuchsia-component-test",
"//src/lib/storage/vfs/rust:vfs",
"//third_party/rust_crates:assert_matches",
]
sources = [ "src/main.rs" ]
}
fuchsia_component("component") {
component_name = "universe-resolver"
manifest = "meta/universe-resolver.cml"
deps = [ ":bin" ]
}
fuchsia_component("component-for-test") {
testonly = true
component_name = "universe-resolver-for-test"
manifest = "meta/universe-resolver-for-test.cml"
deps = [ ":bin" ]
}
fuchsia_component("component-base-only-for-test") {
testonly = true
manifest = "meta/universe-resolver-base-only-for-test.cml"
component_name = "universe-resolver-base-only-for-test"
deps = [ ":bin" ]
}
fuchsia_package("universe-resolver") {
deps = [ ":component" ]
}
fuchsia_component("example") {
manifest = "meta/example.cml"
}
fuchsia_component("unittests") {
manifest = "meta/universe-resolver-unittests.cml"
component_name = "universe-resolver-unittests"
deps = [ ":bin_test" ]
testonly = true
}
# Run with `fx test universe-resolver-unittests`.
fuchsia_unittest_package("universe-resolver-unittests") {
manifest = "meta/universe-resolver-unittests.cml"
deps = [
":bin_test",
":component-base-only-for-test",
":component-for-test",
]
}