blob: 0fe71d32966231f772fa2b1304a788ea200af0fe [file] [log] [blame] [edit]
# 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.mem:fuchsia.mem_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/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-runtime",
"//src/lib/process_builder",
"//src/lib/storage/vfs/rust:vfs",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/sys/component_manager/lib/logger",
"//src/sys/component_manager/lib/runner",
"//src/sys/lib/moniker",
"//src/sys/lib/routing",
"//src/sys/lib/runner",
"//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/config.rs",
"src/crash_handler.rs",
"src/crash_info.rs",
"src/error.rs",
"src/launcher.rs",
"src/lib.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/library_loader",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:rand",
"//third_party/rust_crates:test-case",
]
}
fuchsia_component("elf_runner_tests_cmp") {
testonly = true
deps = [ ":elf_runner_test" ]
component_name = "elf_runner_tests"
manifest = "meta/elf_runner_tests.cml"
}
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: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",
]
}