| # 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", |
| "//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", |
| "//zircon/system/ulib/service:service-llcpp", |
| ] |
| |
| # 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" ] |
| } |
| |
| 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" ] |
| } |