blob: b1aa8700e5f14da68d6881053bf6d2e933099ddd [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/component/config.gni")
import("//build/rust/rustc_binary.gni")
import("//build/rust/rustc_test.gni")
import("//src/sys/build/components.gni")
group("tests") {
testonly = true
deps = [ ":package" ]
}
rustc_binary("trigger_bin") {
output_name = "namespace_capabilities_trigger"
edition = "2018"
source_root = "trigger.rs"
deps = [
"//examples/components/routing/fidl:echo-rustc",
"//garnet/lib/rust/io_util",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/syslog/rust:syslog",
"//src/sys/component_manager/tests/fidl:components-rustc",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:log",
]
sources = [ "trigger.rs" ]
}
fuchsia_component("echo-server-v1") {
testonly = true
deps = [ "//examples/components/routing/echo_server" ]
manifest = "meta/echo_server.cmx"
}
fuchsia_component("trigger") {
testonly = true
deps = [ ":trigger_bin" ]
manifest = "meta/trigger.cml"
}
rustc_test("integration_test_bin") {
output_name = "namespace_capabilities_integration_test"
edition = "2018"
source_root = "integration_test.rs"
deps = [
"//src/lib/fuchsia-async",
"//src/sys/component_manager/testing:test_utils_lib",
]
sources = [ "integration_test.rs" ]
}
rustc_binary("integration_test_root_bin") {
testonly = true
output_name = "namespace_capabilities_integration_test_root"
edition = "2018"
source_root = "integration_test_root.rs"
deps = [
"//sdk/fidl/fuchsia.component:fuchsia.component-rustc",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/syslog/rust:syslog",
"//src/sys/component_manager/tests/fidl:components-rustc",
"//third_party/rust_crates:log",
]
sources = [ "integration_test_root.rs" ]
}
component_config("config") {
sources = [ "namespace_config.json" ]
}
resource("config_resource") {
sources = [ "$target_gen_dir/config" ]
# OpaqueTest uses this path to search for config file.
outputs = [ "data/component_manager_debug_config" ]
deps = [ ":config" ]
}
resource("testdata") {
sources = [ "testdata.txt" ]
outputs = [ "data/testdata" ]
}
fuchsia_component("component-manager") {
testonly = true
deps = [
":config_resource",
"//src/sys/component_manager:bin",
]
manifest = "meta/component_manager.cmx"
}
fuchsia_component("integration-test-root") {
testonly = true
deps = [ ":integration_test_root_bin" ]
manifest = "meta/integration_test_root.cml"
}
fuchsia_component("integration-test") {
testonly = true
deps = [ ":integration_test_bin" ]
manifest = "meta/integration_test.cmx"
}
fuchsia_test_package("package") {
package_name = "namespace-capabilities-integration-test"
test_components = [ ":integration-test" ]
deps = [
":component-manager",
":echo-server-v1",
":integration-test-root",
":testdata",
":trigger",
]
}