| # 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/rust/rustc_binary.gni") | |
| import("//build/rust/rustc_test.gni") | |
| import("//build/test/test_package.gni") | |
| rustc_binary("mock_services") { | |
| name = "shutdown_shim_mock_services" | |
| edition = "2018" | |
| source_root = "src/tests_and_mocks.rs" | |
| deps = [ | |
| "fidl:fuchsia.test.shutdownshim-rustc", | |
| "//sdk/fidl/fuchsia.device.manager:fuchsia.device.manager-rustc", | |
| "//sdk/fidl/fuchsia.hardware.power.statecontrol:fuchsia.hardware.power.statecontrol-rustc", | |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", | |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc", | |
| "//src/lib/fidl/rust/fidl", | |
| "//src/lib/fuchsia-async", | |
| "//src/lib/fuchsia-component", | |
| "//src/lib/syslog/rust:syslog", | |
| "//src/lib/zircon/rust:fuchsia-zircon", | |
| "//third_party/rust_crates:anyhow", | |
| "//third_party/rust_crates:futures", | |
| ] | |
| sources = [ "src/tests_and_mocks.rs" ] | |
| } | |
| rustc_test("test_driver") { | |
| name = "shutdown_shim_integration_test" | |
| edition = "2018" | |
| source_root = "src/main.rs" | |
| deps = [ | |
| "fidl:fuchsia.test.shutdownshim-rustc", | |
| "//src/lib/fuchsia-async", | |
| "//src/lib/fuchsia-component", | |
| "//src/lib/syslog/rust:syslog", | |
| "//third_party/rust_crates:anyhow", | |
| ] | |
| sources = [ "src/main.rs" ] | |
| } | |
| test_package("shutdown-shim-integration-test") { | |
| deps = [ | |
| ":mock_services", | |
| ":test_driver", | |
| "..:shutdown-shim", | |
| ] | |
| v2_tests = [ | |
| { | |
| name = "shutdown_shim_integration_test" | |
| environments = basic_envs | |
| }, | |
| ] | |
| binaries = [ | |
| { | |
| name = "shutdown-shim" | |
| }, | |
| { | |
| name = "shutdown_shim_mock_services" | |
| }, | |
| ] | |
| meta = [ | |
| { | |
| path = rebase_path("meta/shutdown-shim.cml") | |
| dest = "shutdown-shim.cm" | |
| }, | |
| { | |
| path = rebase_path("meta/test-driver.cml") | |
| dest = "test-driver.cm" | |
| }, | |
| ] | |
| } | |
| group("tests") { | |
| testonly = true | |
| deps = [ ":shutdown-shim-integration-test" ] | |
| } |