| # Copyright 2023 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/components.gni") |
| import("//build/rust/rustc_library.gni") |
| |
| rustc_library("elf_runner") { |
| name = "elf_runner" |
| with_unit_tests = true |
| edition = "2021" |
| |
| visibility = [ |
| "//src/sys/component_manager/*", |
| "//src/sys/lib/elf_runner/*", |
| ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.component:fuchsia.component_rust", |
| "//sdk/fidl/fuchsia.component.runner:fuchsia.component.runner_rust", |
| "//sdk/fidl/fuchsia.data:fuchsia.data_rust", |
| "//sdk/fidl/fuchsia.diagnostics.types:fuchsia.diagnostics.types_rust", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_rust", |
| "//sdk/fidl/fuchsia.memory.attribution:fuchsia.memory.attribution_rust", |
| "//sdk/fidl/fuchsia.process:fuchsia.process_rust", |
| "//sdk/fidl/fuchsia.process.lifecycle:fuchsia.process.lifecycle_rust", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust", |
| "//src/lib/error/clonable_error", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/fuchsia-sync", |
| "//src/lib/process_builder", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/performance/memory/attribution", |
| "//src/storage/lib/vfs/rust:vfs", |
| "//src/sys/component_manager/lib/logger", |
| "//src/sys/lib/cm_types", |
| "//src/sys/lib/fidl-connector", |
| "//src/sys/lib/moniker", |
| "//src/sys/lib/namespace", |
| "//src/sys/lib/routing", |
| "//src/sys/lib/runner", |
| "//src/sys/lib/socket_parsing", |
| "//src/sys/lib/task-exceptions", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:chrono", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:lazy_static", |
| "//third_party/rust_crates:once_cell", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ |
| "src/component.rs", |
| "src/component_set.rs", |
| "src/config.rs", |
| "src/crash_handler.rs", |
| "src/crash_info.rs", |
| "src/error.rs", |
| "src/lib.rs", |
| "src/memory/mod.rs", |
| "src/memory/reporter.rs", |
| "src/process_launcher.rs", |
| "src/runtime_dir.rs", |
| "src/stdout.rs", |
| "src/vdso_vmo.rs", |
| ] |
| |
| test_deps = [ |
| "//src/lib/diagnostics/log/message/rust", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-fs", |
| "//src/lib/scoped_task", |
| "//src/sys/lib/cm_config", |
| "//src/sys/lib/library_loader", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:rand", |
| "//third_party/rust_crates:test-case", |
| ] |
| } |
| |
| fuchsia_test_component("elf_runner_tests_cmp") { |
| deps = [ ":elf_runner_test" ] |
| component_name = "elf_runner_tests" |
| manifest = "meta/elf_runner_tests.cml" |
| test_type = "system" |
| } |
| |
| fuchsia_test_package("elf_runner_tests") { |
| # One test case causes an error log |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| test_components = [ ":elf_runner_tests_cmp" ] |
| deps = [ |
| ":elf_runner_tests_cmp", |
| "tests/lifecycle:immediate_escrow_component", |
| "tests/lifecycle:run-indefinitely", |
| "//examples/hello_world/rust:hello-world-rust-component", |
| "//src/sys/component_manager/testing/lifecycle", |
| "//src/sys/component_manager/tests/crash_introspect:panic_on_start", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ |
| ":elf_runner_tests", |
| "tests", |
| ] |
| } |