blob: 3703301aa48cc05bcc6d42e9ad67799c0911f38a [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/package/component.gni")
import("//build/rust/rustc_binary.gni")
import("//build/test/test_package.gni")
rustc_binary("hub_integration_test_bin") {
name = "hub_integration_test"
edition = "2018"
source_root = "hub_integration_test.rs"
deps = [
"//examples/components/routing/fidl:echo-rustc",
"//garnet/lib/rust/cm_fidl_translator",
"//garnet/lib/rust/cm_rust",
"//garnet/lib/rust/io_util",
"//garnet/public/lib/fidl/rust/fidl",
"//garnet/public/rust/fdio",
"//garnet/public/rust/fuchsia-async",
"//garnet/public/rust/fuchsia-component",
"//garnet/public/rust/fuchsia-runtime",
"//garnet/public/rust/fuchsia-vfs/pseudo-fs",
"//garnet/public/rust/fuchsia-zircon",
"//sdk/fidl/fuchsia.data:fuchsia.data-rustc",
"//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc",
"//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc",
"//src/sys/component_manager:lib",
"//third_party/rust_crates:failure",
"//third_party/rust_crates:futures-preview",
"//third_party/rust_crates:log",
"//third_party/rust_crates:url",
"//zircon/public/fidl/fuchsia-io:fuchsia-io-rustc",
]
non_rust_deps = [
"//zircon/public/lib/async",
"//zircon/public/lib/async-default",
"//zircon/public/lib/async-loop",
"//zircon/public/lib/sync",
"//zircon/public/lib/memfs",
]
}
test_package("hub_integration_test") {
deps = [
":hub_integration_test_bin",
":mock_pkg_resolver_bin",
"//examples/components/routing/echo_client",
"//examples/components/routing/echo_server",
]
meta = [
{
path = rebase_path("meta/mock_pkg_resolver_for_hub_integration_test.cmx")
dest = "mock_pkg_resolver.cmx"
},
{
path = rebase_path("//examples/components/routing/meta/echo_server.cml")
dest = "echo_server.cm"
},
{
path = rebase_path("//examples/components/routing/meta/echo_client.cml")
dest = "echo_client.cm"
},
{
path = rebase_path("meta/echo_realm_for_hub_integration.cml")
dest = "echo_realm.cm"
},
]
binaries = [
{
name = "mock_pkg_resolver"
},
{
name = "echo_server"
},
{
name = "echo_client"
},
]
tests = [
{
name = "hub_integration_test"
},
]
}
rustc_binary("routing_integration_test_bin") {
name = "routing_integration_test"
edition = "2018"
source_root = "routing_integration_test.rs"
deps = [
"//garnet/lib/rust/cm_fidl_translator",
"//garnet/public/rust/fdio",
"//garnet/public/rust/fuchsia-async",
"//garnet/public/rust/fuchsia-component",
"//garnet/public/rust/fuchsia-runtime",
"//garnet/public/rust/fuchsia-zircon",
"//sdk/fidl/fuchsia.data:fuchsia.data-rustc",
"//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc",
"//third_party/rust_crates:failure",
]
}
rustc_binary("mock_pkg_resolver_bin") {
name = "mock_pkg_resolver"
edition = "2018"
source_root = "mock_pkg_resolver.rs"
deps = [
"//garnet/public/lib/fidl/rust/fidl",
"//garnet/public/rust/fdio",
"//garnet/public/rust/fuchsia-async",
"//garnet/public/rust/fuchsia-component",
"//garnet/public/rust/fuchsia-syslog",
"//garnet/public/rust/fuchsia-zircon",
"//sdk/fidl/fuchsia.pkg:fuchsia.pkg-rustc",
"//src/sys/lib/fuchsia_url:fuchsia_url",
"//third_party/rust_crates:failure",
"//third_party/rust_crates:futures-preview",
"//third_party/rust_crates:lazy_static",
"//zircon/public/fidl/fuchsia-io:fuchsia-io-rustc",
]
}
test_package("routing_integration_test") {
deps = [
":mock_pkg_resolver_bin",
":routing_integration_test_bin",
"//examples/components/routing/echo_client",
"//examples/components/routing/echo_server",
]
components =
[ "//src/sys/component_manager:component_manager_as_v1_component" ]
meta = [
{
path =
rebase_path("meta/mock_pkg_resolver_for_routing_integration_test.cmx")
dest = "mock_pkg_resolver.cmx"
},
{
path = rebase_path("//examples/components/routing/meta/echo_server.cml")
dest = "echo_server.cm"
},
{
path = rebase_path("//examples/components/routing/meta/echo_client.cml")
dest = "echo_client.cm"
},
{
path = rebase_path("meta/echo_realm.cml")
dest = "echo_realm.cm"
},
]
binaries = [
{
name = "mock_pkg_resolver"
},
{
name = "echo_server"
},
{
name = "echo_client"
},
]
tests = [
{
name = "routing_integration_test"
},
]
}
rustc_binary("elf_runner_test_bin") {
name = "elf_runner_test"
edition = "2018"
source_root = "elf_runner_test.rs"
deps = [
"//garnet/lib/rust/cm_fidl_translator",
"//garnet/public/rust/fdio",
"//garnet/public/rust/fuchsia-async",
"//garnet/public/rust/fuchsia-component",
"//garnet/public/rust/fuchsia-runtime",
"//garnet/public/rust/fuchsia-zircon",
"//sdk/fidl/fuchsia.data:fuchsia.data-rustc",
"//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc",
"//third_party/rust_crates:failure",
]
}
test_package("elf_runner_test") {
deps = [
":elf_runner_test_bin",
":mock_pkg_resolver_bin",
"//examples/components/basic:echo_args_bin",
]
components =
[ "//src/sys/component_manager:component_manager_as_v1_component" ]
meta = [
{
path = rebase_path("meta/mock_pkg_resolver_for_elf_runner_test.cmx")
dest = "mock_pkg_resolver.cmx"
},
{
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 = "mock_pkg_resolver"
},
{
name = "echo_args"
},
]
tests = [
{
name = "elf_runner_test"
},
]
}
rustc_binary("no_pkg_resolver_test_bin") {
name = "no_pkg_resolver_test"
edition = "2018"
source_root = "no_pkg_resolver_test.rs"
deps = [
"//garnet/public/rust/fuchsia-async",
"//src/sys/component_manager:lib",
]
non_rust_deps = [
"//zircon/public/lib/async",
"//zircon/public/lib/async-default",
"//zircon/public/lib/async-loop",
"//zircon/public/lib/sync",
"//zircon/public/lib/memfs",
]
}
test_package("no_pkg_resolver_test") {
deps = [
":no_pkg_resolver_test_bin",
]
tests = [
{
name = "no_pkg_resolver_test"
},
]
}