blob: 8af6f9e084afd90a4cf7be0dad925b6231a71cfc [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/rust/rustc_binary.gni")
import("//build/rust/rustc_library.gni")
import("//build/rust/rustc_test.gni")
import("//build/test/test_package.gni")
group("tests") {
testonly = true
deps = [
":component_manager_panic_test",
":elf_runner_test",
":shutdown_integration_test",
"base_resolver_test",
"breakpoints_system:breakpoints_system_integration_test",
"collections:collections_integration_test",
"destruction:destruction_integration_test",
"hub:hub_integration_test",
"rights:tests",
"routing:tests",
"storage:storage_integration_test",
"work_scheduler:work_scheduler_integration_test",
]
}
rustc_library("breakpoint_system_client") {
name = "breakpoint_system_client"
edition = "2018"
source_root = "breakpoint_system_client.rs"
deps = [
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/sys/component_manager/tests/fidl:breakpoints-rustc",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
]
}
rustc_library("trigger_capability") {
name = "trigger_capability"
edition = "2018"
source_root = "trigger_capability.rs"
deps = [
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/sys/component_manager/tests:breakpoint_system_client",
"//src/sys/component_manager/tests/fidl:components-rustc",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
]
}
rustc_library("echo_capability") {
name = "echo_capability"
edition = "2018"
source_root = "echo_capability.rs"
deps = [
":breakpoint_system_client",
"//examples/components/routing/fidl:echo-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
]
}
rustc_library("test_utils") {
name = "test_utils"
edition = "2018"
source_root = "test_utils.rs"
deps = [
":breakpoint_system_client",
"//garnet/lib/rust/files_async",
"//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-runtime",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/sys/component_manager/tests/fidl:breakpoints-rustc",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:parking_lot",
"//third_party/rust_crates:rand",
"//zircon/system/fidl/fuchsia-io:fuchsia-io-rustc",
]
}
rustc_test("shutdown_integration_test_bin") {
name = "shutdown_integration_test"
edition = "2018"
source_root = "shutdown_integration.rs"
deps = [
":test_utils",
"//src/lib/fuchsia-async",
"//third_party/rust_crates:anyhow",
]
}
rustc_binary("system_controller_client") {
name = "system_controller_client"
edition = "2018"
source_root = "system_controller_client.rs"
deps = [
"//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/syslog/rust:syslog",
"//third_party/rust_crates:anyhow",
]
}
rustc_test("component_manager_panic_test_bin") {
name = "component_manager_panic_test"
edition = "2018"
source_root = "component_manager_panic.rs"
deps = [
":test_utils",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//third_party/rust_crates:anyhow",
]
}
test_package("shutdown_integration_test") {
deps = [
":shutdown_integration_test_bin",
":system_controller_client",
]
components =
[ "//src/sys/component_manager:component_manager_as_v1_component" ]
meta = [
{
path = rebase_path("meta/shutdown_integration_root.cml")
dest = "shutdown_integration_root.cm"
},
{
path = rebase_path("meta/system_controller_consumer.cml")
dest = "system_controller_consumer.cm"
},
]
binaries = [
{
name = "system_controller_client"
},
]
tests = [
{
name = "shutdown_integration_test"
},
]
}
test_package("component_manager_panic_test") {
deps = [ ":component_manager_panic_test_bin" ]
components =
[ "//src/sys/component_manager:component_manager_as_v1_component" ]
tests = [
{
name = "component_manager_panic_test"
},
]
}
rustc_test("elf_runner_test_bin") {
name = "elf_runner_test"
edition = "2018"
source_root = "elf_runner_test.rs"
deps = [
"//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc",
"//src/lib/fdio/rust:fdio",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-runtime",
]
}
test_package("elf_runner_test") {
deps = [
":elf_runner_test_bin",
"//examples/components/basic:echo_args_bin",
]
components =
[ "//src/sys/component_manager:component_manager_as_v1_component" ]
meta = [
{
path = rebase_path("meta/echo_no_args.cml")
dest = "echo_no_args.cm"
},
{
path = rebase_path("//examples/components/basic/meta/echo_args.cml")
dest = "echo_args.cm"
},
]
binaries = [
{
name = "echo_args"
},
]
tests = [
{
name = "elf_runner_test"
},
]
}