blob: 84dd5f1b0e1762f3ada6df56a49f2f9b6dea1607 [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_binary.gni")
import("//build/rust/rustc_test.gni")
rustc_binary("mock_services") {
name = "pwrbtn_monitor_mock_services"
edition = "2018"
source_root = "src/mock_services.rs"
deps = [
"fidl:fuchsia.test.pwrbtn-rustc",
"//sdk/fidl/fuchsia.hardware.input:fuchsia.hardware.input-rustc",
"//sdk/fidl/fuchsia.hardware.power.statecontrol:fuchsia.hardware.power.statecontrol-rustc",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/storage/vfs/rust:vfs",
"//src/lib/syslog/rust:syslog",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
]
sources = [ "src/mock_services.rs" ]
}
rustc_test("test_driver") {
name = "pwrbtn_monitor_integration_test"
edition = "2018"
source_root = "src/test.rs"
deps = [
"fidl:fuchsia.test.pwrbtn-rustc",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/syslog/rust:syslog",
"//third_party/rust_crates:anyhow",
]
sources = [ "src/test.rs" ]
}
fuchsia_component("pwrbtn_monitor_component") {
testonly = true
component_name = "pwrbtn-monitor"
manifest = "//src/bringup/bin/pwrbtn-monitor/meta/pwrbtn-monitor.cml"
deps = [ "//src/bringup/bin/pwrbtn-monitor" ]
}
fuchsia_component("test_driver_component") {
testonly = true
component_name = "test-driver"
manifest = "meta/test-driver.cml"
deps = [ ":test_driver" ]
}
fuchsia_test_component("mock_services_component") {
component_name = "mock_services"
manifest = "meta/pwrbtn_monitor_integration_test.cml"
deps = [ ":mock_services" ]
}
fuchsia_test_package("pwrbtn-monitor-integration-test") {
test_components = [ ":mock_services_component" ]
deps = [
":pwrbtn_monitor_component",
":test_driver_component",
]
}