| # 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/test.gni") |
| |
| driver_bind_rules("metadata-test-bind") { |
| disable_autobind = true |
| header_output = "metadata-test-bind.h" |
| } |
| |
| fuchsia_driver("fuchsia_driver") { |
| output_name = "ddk-metadata-test-driver" |
| |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| sources = [ "metadata-test.cc" ] |
| deps = [ |
| ":metadata-test-bind", |
| "//sdk/lib/fdio", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| "//zircon/system/ulib/zx", |
| "//zircon/system/ulib/zxtest", |
| ] |
| |
| visibility = [ |
| ":*", |
| "//src/devices/bundles:drivers", |
| ] |
| } |
| |
| fuchsia_driver_component("driver") { |
| component_name = "ddk-metadata-test-driver" |
| deps = [ ":fuchsia_driver" ] |
| info = "driver-info.json" |
| colocate = true |
| } |
| |
| test("tests") { |
| output_name = "ddk-metadata-test" |
| |
| testonly = true |
| sources = [ "test.cc" ] |
| deps = [ |
| ":metadata-test-bind", |
| "//sdk/fidl/fuchsia.device:fuchsia.device_llcpp", |
| "//sdk/lib/fdio", |
| "//src/devices/testing/devmgr-integration-test-shim", |
| "//src/devices/testing/mock-ddk", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/zx", |
| "//zircon/system/ulib/zxtest", |
| ] |
| visibility = [ ":*" ] |
| |
| # 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-metadata-test") { |
| deps = [ |
| ":driver", |
| ":tests", |
| "//src/devices/misc/drivers/test", |
| "//src/devices/misc/drivers/test-parent", |
| ] |
| |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |