blob: c9be66ad93452744ab3f45935ad08a46439166b0 [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/config/fuchsia/rules.gni")
import("//build/fidl/fidl.gni")
import("//build/test.gni")
import("//zircon/system/ulib/devmgr-integration-test/isolated_devmgr.gni")
fidl("fuchsia.device.power.test") {
sources = [ "test.fidl" ]
public_deps = [ "//sdk/fidl/fuchsia.device" ]
}
bind_rules("test-power-bind") {
rules = "test-power.bind"
output = "test-power-bind.h"
deps = [ "//src/devices/bind/test.platform" ]
}
driver_module("ddk-power-test") {
configs += [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
]
configs += [ "//build/unification/config:zircon-migrated" ]
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",
]
}
bind_rules("test-power-child-bind") {
rules = "test-power-child.bind"
output = "test-power-child-bind.h"
deps = [ "//src/devices/bind/fuchsia.test" ]
}
driver_module("ddk-power-test-child") {
configs += [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
]
configs += [ "//build/unification/config:zircon-migrated" ]
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",
]
}
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.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/fdio",
"//src/lib/ddk",
# TODO(fxb/38132): Migrate to the new bind rules and delete the below
"//src/lib/ddk:ddk-deprecated-binding-headers",
"//zircon/public/lib/fbl",
"//zircon/public/lib/zx",
"//zircon/public/lib/zxtest",
"//zircon/system/ulib/devmgr-integration-test",
"//zircon/system/ulib/devmgr-launcher",
"//zircon/system/ulib/driver-integration-test",
]
}
isolated_devmgr_unittest_package("ddk-power-test-package") {
package_name = "ddk-power-test"
executable_path = "test/ddk-power"
deps = [
":ddk-power",
":ddk-power-test",
":ddk-power-test-child",
"//src/devices/board/drivers/integration-test",
"//src/devices/bus/drivers/platform",
"//src/devices/tests/sysdev",
]
}
group("tests") {
testonly = true
deps = [ ":ddk-power-test-package" ]
}