blob: e57830b511f179991cae74a8f383d66c64c447a6 [file] [log] [blame]
# Copyright 2019 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/fidl/fidl.gni")
import("//build/test.gni")
fidl("fuchsia.device.power.test") {
sources = [ "test.fidl" ]
public_deps = [ "//sdk/fidl/fuchsia.device" ]
}
driver_bind_rules("test-power-bind") {
rules = "test-power.bind"
header_output = "test-power-bind.h"
deps = [ "//src/devices/bind/fuchsia.test.platform" ]
}
fuchsia_driver("ddk-power-test-driver") {
output_name = "ddk-power-test"
configs += [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
]
sources = [ "test-driver.cc" ]
deps = [
":fuchsia.device.power.test_llcpp",
":test-power-bind",
"//sdk/lib/fdio",
"//src/devices/lib/driver",
"//src/lib/ddk",
"//src/lib/ddktl",
"//zircon/system/ulib/fbl",
]
}
fuchsia_driver_component("ddk-power-test") {
component_name = "ddk-power-test"
deps = [ ":ddk-power-test-driver" ]
info = "ddk-power-test-info.json"
colocate = true
}
driver_bind_rules("test-power-child-bind") {
rules = "test-power-child.bind"
header_output = "test-power-child-bind.h"
deps = [ "//src/devices/bind/fuchsia.test" ]
}
fuchsia_driver("ddk-power-test-child-driver") {
output_name = "ddk-power-test-child"
configs += [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
]
sources = [ "test-driver-child.cc" ]
deps = [
":fuchsia.device.power.test_llcpp",
":test-power-child-bind",
"//sdk/fidl/fuchsia.device:fuchsia.device_c",
"//sdk/lib/fdio",
"//src/devices/lib/driver",
"//src/lib/ddk",
"//src/lib/ddktl",
"//zircon/system/ulib/fbl",
]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}
fuchsia_driver_component("ddk-power-test-child") {
component_name = "ddk-power-test-child"
deps = [ ":ddk-power-test-child-driver" ]
info = "ddk-power-test-child-info.json"
colocate = true
}
test("ddk-power") {
sources = [ "test.cc" ]
deps = [
":fuchsia.device.power.test_llcpp",
"//sdk/fidl/fuchsia.device:fuchsia.device_llcpp",
"//sdk/fidl/fuchsia.device.manager:fuchsia.device.manager_llcpp",
"//sdk/fidl/fuchsia.hardware.power.statecontrol:fuchsia.hardware.power.statecontrol_llcpp",
"//sdk/fidl/fuchsia.process.lifecycle:fuchsia.process.lifecycle_llcpp",
"//sdk/lib/device-watcher/cpp",
"//sdk/lib/fdio",
"//src/lib/ddk",
"//zircon/system/ulib/driver-integration-test",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/service:service-llcpp",
"//zircon/system/ulib/zx",
"//zircon/system/ulib/zxtest",
]
# TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated.
# Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>).
# See linked bug for details.
configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ]
}
fuchsia_unittest_package("ddk-power-test-package") {
deps = [
":ddk-power",
":ddk-power-test",
":ddk-power-test-child",
"//src/devices/board/drivers/integration-test",
"//src/devices/bus/drivers/platform",
]
}
group("tests") {
testonly = true
deps = [ ":ddk-power-test-package" ]
}