blob: 2f2b22219e2e82d99585663b3fa2b1dc5f278d27 [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/components.gni")
import("//build/rust/rustc_test.gni")
rustc_test("shutdown_shim_integration_test_bin") {
edition = "2021"
source_root = "src/main.rs"
deps = [
"//sdk/fidl/fuchsia.boot:fuchsia.boot_rust",
"//sdk/fidl/fuchsia.device.manager:fuchsia.device.manager_rust",
"//sdk/fidl/fuchsia.hardware.power.statecontrol:fuchsia.hardware.power.statecontrol_rust",
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//sdk/fidl/fuchsia.power.broker:fuchsia.power.broker_rust",
"//sdk/fidl/fuchsia.power.system:fuchsia.power.system_rust",
"//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-component-test",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/power/broker/client",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:test-case",
"//third_party/rust_crates:tracing",
]
sources = [
"src/main.rs",
"src/shutdown_mocks.rs",
]
}
fuchsia_component("shutdown_shim_integration_test_component") {
manifest = "meta/shutdown-shim-integration-test.cml"
component_name = "shutdown-shim-integration-tests"
deps = [ ":shutdown_shim_integration_test_bin" ]
testonly = true
}
# The shutdown shim runs from the ZBI in prod, so there isn't a
# fuchsia_component target that exists yet that we can depend on. Let's define
# one here so we can put the shim in our test package.
fuchsia_component("shutdown_shim_component") {
manifest = "meta/shutdown-shim.cml"
component_name = "shutdown-shim"
deps = [ "..:shutdown-shim" ]
testonly = true
}
fuchsia_test_package("shutdown-shim-integration-tests") {
deps = [
":shutdown_shim_component",
":shutdown_shim_integration_test_component",
"//src/power/broker:component",
]
test_components = [ ":shutdown_shim_integration_test_component" ]
}
group("tests") {
testonly = true
deps = [ ":shutdown-shim-integration-tests" ]
}