| # 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") |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":pkg" ] |
| } |
| |
| group("drivers") { |
| testonly = true |
| deps = [ |
| ":component", |
| "test-root:component", |
| ] |
| } |
| |
| fidl("fuchsia.composite.test") { |
| testonly = true |
| sources = [ "composite.test.fidl" ] |
| } |
| |
| driver_bind_rules("bind") { |
| rules = "composite_driver_v1.bind" |
| header_output = "composite_driver_v1-bind.h" |
| bind_output = "composite_driver_v1.bindbc" |
| deps = [ "//src/devices/bind/fuchsia.pci" ] |
| } |
| |
| fuchsia_driver("driver") { |
| testonly = true |
| output_name = "composite-driver-v1" |
| sources = [ "composite_driver_v1.cc" ] |
| deps = [ |
| ":bind", |
| ":fuchsia.composite.test_llcpp", |
| "//src/devices/lib/driver", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/inspect", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| fuchsia_driver_component("component") { |
| testonly = true |
| component_name = "composite-driver-v1" |
| deps = [ ":driver" ] |
| info = "component-info.json" |
| } |
| |
| test("composite-driver-v1-test") { |
| sources = [ "test.cc" ] |
| deps = [ |
| "//sdk/fidl/fuchsia.driver.test", |
| "//sdk/fidl/fuchsia.io", |
| "//sdk/lib/device-watcher/cpp", |
| "//sdk/lib/driver_test_realm/realm_builder/cpp", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| "//zircon/system/ulib/async-loop", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/service:service-llcpp", |
| ] |
| } |
| |
| fuchsia_unittest_package("pkg") { |
| package_name = "composite-driver-v1-test" |
| deps = [ |
| ":component", |
| ":composite-driver-v1-test", |
| "test-root:component", |
| "//src/devices/internal/drivers/fragment", |
| "//src/devices/misc/drivers/test-parent", |
| ] |
| } |