| # 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_test.gni") |
| import("//src/sys/build/components.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":elf_runner_lifecycle_test" ] |
| } |
| |
| rustc_test("lifecycle") { |
| source_root = "lifecycle.rs" |
| name = "lifecycle_integration_test" |
| edition = "2018" |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.process.lifecycle:fuchsia.process.lifecycle-rustc", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/component_manager/testing:test_utils_lib", |
| "//third_party/rust_crates:futures-util", |
| "//third_party/rust_crates:regex", |
| ] |
| |
| sources = [ "lifecycle.rs" ] |
| } |
| |
| rustc_binary("immediate_exit") { |
| name = "immediate_exit" |
| edition = "2018" |
| source_root = "immediate_exit_component.rs" |
| |
| sources = [ "immediate_exit_component.rs" ] |
| } |
| |
| rustc_binary("run-indefinitely") { |
| name = "run_indefinitely" |
| edition = 2018 |
| source_root = "run_indefinitely.rs" |
| sources = [ "run_indefinitely.rs" ] |
| deps = [ |
| "//src/lib/fuchsia-async", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| ] |
| } |
| |
| rustc_binary("rendezvous_exit") { |
| name = "rendezvous_exit" |
| edition = "2018" |
| source_root = "rendezvous_exit_component.rs" |
| deps = [ |
| "//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:anyhow", |
| "//third_party/rust_crates:futures", |
| ] |
| |
| sources = [ "rendezvous_exit_component.rs" ] |
| } |
| |
| rustc_test("component_exit") { |
| source_root = "component_exit.rs" |
| name = "component_exit_integration_test" |
| edition = "2018" |
| |
| deps = [ |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/syslog/rust:syslog", |
| "//src/sys/component_manager/testing:test_utils_lib", |
| "//src/sys/component_manager/tests/fidl:components-rustc", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:futures-util", |
| ] |
| |
| sources = [ "component_exit.rs" ] |
| } |
| |
| rustc_test("lifecycle_timeout") { |
| source_root = "lifecycle_timeout.rs" |
| name = "lifecycle_timeout_integration_test" |
| edition = "2018" |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.process.lifecycle:fuchsia.process.lifecycle-rustc", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/component_manager/testing:test_utils_lib", |
| "//third_party/rust_crates:futures-util", |
| "//third_party/rust_crates:regex", |
| ] |
| |
| sources = [ "lifecycle_timeout.rs" ] |
| } |
| |
| rustc_test("lifecycle_timeout_unresponsive") { |
| source_root = "lifecycle_timeout_unresponsive.rs" |
| name = "lifecycle_timeout_unresponsive_integration_test" |
| edition = "2018" |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.process.lifecycle:fuchsia.process.lifecycle-rustc", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/component_manager/testing:test_utils_lib", |
| "//third_party/rust_crates:futures-util", |
| "//third_party/rust_crates:regex", |
| ] |
| |
| sources = [ "lifecycle_timeout_unresponsive.rs" ] |
| } |
| |
| rustc_binary("unresponsive_component") { |
| source_root = "unresponsive_component.rs" |
| name = "unresponsive_component" |
| edition = "2018" |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.process.lifecycle:fuchsia.process.lifecycle-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:futures-util", |
| ] |
| |
| sources = [ "unresponsive_component.rs" ] |
| } |
| |
| fuchsia_component("lifecycle_integration_test") { |
| testonly = true |
| deps = [ ":lifecycle" ] |
| manifest = "meta/lifecycle.cml" |
| } |
| |
| fuchsia_component("lifecycle_timeout_integration_test") { |
| testonly = true |
| deps = [ ":lifecycle_timeout" ] |
| manifest = "meta/lifecycle_timeout.cml" |
| } |
| |
| fuchsia_component("lifecycle_timeout_unresponsive_integration_test") { |
| testonly = true |
| deps = [ ":lifecycle_timeout_unresponsive" ] |
| manifest = "meta/lifecycle_timeout_unresponsive.cml" |
| } |
| |
| fuchsia_component("component_exit_integration_test") { |
| testonly = true |
| deps = [ ":component_exit" ] |
| manifest = "meta/component_exit.cml" |
| } |
| |
| fuchsia_component("lifecycle_timeout_unresponsive_root") { |
| testonly = true |
| manifest = "meta/lifecycle_timeout_unresponsive_root.cml" |
| } |
| |
| fuchsia_component("lifecycle_timeout_unresponsive_node") { |
| testonly = true |
| deps = [ ":unresponsive_component" ] |
| manifest = "meta/lifecycle_timeout_unresponsive_node.cml" |
| } |
| |
| fuchsia_component("lifecycle_timeout_root") { |
| testonly = true |
| manifest = "meta/lifecycle_timeout_root.cml" |
| } |
| |
| fuchsia_component("lifecycle_timeout_node") { |
| testonly = true |
| deps = [ "//examples/components/basic:lifecycle_full_bin" ] |
| manifest = "meta/lifecycle_timeout_node.cml" |
| } |
| |
| fuchsia_component("immediate_exit_component") { |
| testonly = true |
| deps = [ ":immediate_exit" ] |
| manifest = "meta/immediate_exit_component.cml" |
| } |
| |
| fuchsia_component("rendezvous_exit_component") { |
| testonly = true |
| deps = [ ":rendezvous_exit" ] |
| manifest = "meta/rendezvous_exit_component.cml" |
| } |
| |
| fuchsia_test_package("elf_runner_lifecycle_test") { |
| test_components = [ |
| ":lifecycle_integration_test", |
| ":lifecycle_timeout_integration_test", |
| ":lifecycle_timeout_unresponsive_integration_test", |
| ":component_exit_integration_test", |
| ] |
| deps = [ |
| ":immediate_exit_component", |
| ":lifecycle_timeout_node", |
| ":lifecycle_timeout_root", |
| ":lifecycle_timeout_unresponsive_node", |
| ":lifecycle_timeout_unresponsive_root", |
| ":rendezvous_exit_component", |
| "//examples/components/basic:lifecycle-full", |
| ] |
| test_specs = { |
| # `component_exit` fails when test cases are executed in parallel. |
| parallel = 1 |
| } |
| } |