blob: 3a2a1288be8c25b973d939eca86b9b5252d00305 [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/fidl/fidl.gni")
import("//build/rust/rustc_binary.gni")
import("//build/rust/rustc_test.gni")
import("//build/test/test_package.gni")
rustc_test("fuchsia-component-v1-test") {
edition = "2018"
source_root = "components_v1/lib.rs"
deps = [
":fuchsia.component.test-rustc",
"//garnet/lib/rust/files_async",
"//garnet/lib/rust/io_util",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/storage/pseudo-fs",
"//src/lib/test_util",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:thiserror",
"//zircon/system/fidl/fuchsia-io:fuchsia-io-rustc",
]
}
# This test launches a v2 component in a separate instance of component
# manager, so it can use test events.
rustc_test("fuchsia-component-v2-test") {
edition = "2018"
source_root = "components_v2/lib.rs"
deps = [
"//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/syslog/rust:syslog",
"//src/sys/component_manager/tests:test_utils_lib",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:log",
]
}
rustc_binary("realm") {
edition = "2018"
source_root = "components_v2/realm.rs"
deps = [
"//examples/components/routing/fidl:echo-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/syslog/rust:syslog",
"//src/sys/component_manager/tests:test_utils_lib",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:log",
]
}
fidl("fuchsia.component.test") {
sources = [ "test.test.fidl" ]
}
test_package("fuchsia-component-tests") {
deps = [
":fuchsia-component-v1-test",
":fuchsia-component-v2-test",
":realm",
"//examples/components/routing/echo_server",
"//src/sys/component_manager:bin",
]
meta = [
{
path = rebase_path("meta/realm.cml")
dest = "realm.cm"
},
{
path = rebase_path("//examples/components/routing/meta/echo_server.cml")
dest = "echo_server.cm"
},
{
path =
rebase_path("//src/sys/component_manager/meta/component_manager.cmx")
dest = "component_manager.cmx"
},
]
binaries = [
{
name = "echo_server"
},
{
name = "realm"
},
{
name = "component_manager"
},
]
tests = [
{
name = "fuchsia_component_v1_test"
environments = basic_envs
},
{
name = "fuchsia_component_v2_test"
environments = basic_envs
},
]
}
group("tests") {
testonly = true
deps = [ ":fuchsia-component-tests" ]
}