blob: f1e65fa549f9fb4b30c21f4dc9637ab675fdde66 [file] [log] [blame]
# Copyright 2021 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/bind/bind.gni")
import("//build/components.gni")
import("//build/drivers.gni")
import("//build/test.gni")
driver_bind_rules("nelson-brownout-protection-bind") {
rules = "nelson-brownout-protection.bind"
tests = "nelson-brownout-protection-bind-test.json"
deps = [
"//sdk/fidl/fuchsia.hardware.audio:fuchsia.hardware.audio_bindlib",
"//sdk/fidl/fuchsia.hardware.gpio:fuchsia.hardware.gpio_bindlib",
"//sdk/fidl/fuchsia.hardware.power.sensor:fuchsia.hardware.power.sensor_bindlib",
"//src/devices/bind/fuchsia.amlogic.platform.s905d3",
"//src/devices/bind/fuchsia.gpio",
"//src/devices/bind/fuchsia.ti.platform",
]
}
group("common") {
public_deps = [
":nelson-brownout-protection-bind",
"//sdk/banjo/fuchsia.hardware.audio:fuchsia.hardware.audio_banjo_cpp",
"//sdk/fidl/fuchsia.hardware.audio:fuchsia.hardware.audio_cpp",
"//sdk/fidl/fuchsia.hardware.gpio:fuchsia.hardware.gpio_cpp",
"//sdk/fidl/fuchsia.hardware.power.sensor:fuchsia.hardware.power.sensor_cpp",
"//src/devices/lib/driver",
"//src/lib/ddk",
"//src/lib/ddktl",
"//src/media/audio/lib/simple-codec",
"//zircon/system/ulib/trace",
"//zircon/system/ulib/zx",
]
}
fuchsia_driver("nelson-brownout-protection-driver") {
output_name = "nelson-brownout-protection"
configs += [ "//build/config:all_source" ]
sources = [ "nelson-brownout-protection.cc" ]
deps = [ ":common" ]
}
fuchsia_driver_component("nelson-brownout-protection") {
info = "nelson-brownout-protection-info.json"
component_name = "nelson-brownout-protection"
deps = [ ":nelson-brownout-protection-driver" ]
manifest = "meta/nelson-brownout-protection.cml"
}
fuchsia_driver_package("package") {
package_name = "nelson-brownout-protection"
driver_components = [ ":nelson-brownout-protection" ]
}
test("nelson-brownout-protection-test-bin") {
output_name = "nelson-brownout-protection-test"
configs += [ "//build/config:all_source" ]
sources = [
"nelson-brownout-protection-test.cc",
"nelson-brownout-protection.cc",
]
deps = [
":common",
"//sdk/lib/async_patterns/testing/cpp",
"//sdk/lib/component/outgoing/cpp",
"//src/devices/bus/lib/device-protocol-pdev",
"//src/devices/bus/testing/fake-pdev",
"//src/devices/gpio/testing/fake-gpio",
"//src/devices/testing/mock-ddk",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/zxtest",
]
}
fuchsia_unittest_package("nelson-brownout-protection-test") {
deps = [ ":nelson-brownout-protection-test-bin" ]
test_specs = {
environments = basic_envs
}
}
group("tests") {
testonly = true
deps = [
":nelson-brownout-protection-bind_test",
":nelson-brownout-protection-test",
]
}