| # 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") |
| |
| driver_bind_rules("test-bind") { |
| rules = "test-driver.bind" |
| header_output = "test-driver-bind.h" |
| |
| deps = [ "//src/devices/bind/fuchsia.test" ] |
| } |
| |
| fuchsia_driver("test-driver-driver") { |
| output_name = "test-driver" |
| sources = [ "test-driver.cc" ] |
| deps = [ |
| ":test-bind", |
| "//sdk/fidl/fuchsia.driver.test.logger:fuchsia.driver.test.logger_llcpp", |
| "//sdk/lib/fdio", |
| "//sdk/lib/syslog/cpp:backend_legacy", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//src/lib/files", |
| "//zircon/system/ulib/sync", |
| ] |
| } |
| |
| fuchsia_driver_component("test-driver") { |
| component_name = "test-driver" |
| deps = [ ":test-driver-driver" ] |
| info = "test-driver-info.json" |
| colocate = true |
| } |
| |
| test("test") { |
| output_name = "device-watcher-test" |
| sources = [ "test.cc" ] |
| deps = [ |
| "//sdk/fidl/fuchsia.device.manager:fuchsia.device.manager_llcpp", |
| "//sdk/lib/driver_test_realm/simple", |
| "//sdk/lib/fdio", |
| "//src/lib/ddk", |
| "//src/lib/fxl/test:gtest_main", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/service:service-llcpp", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| fuchsia_unittest_package("device-watcher-test") { |
| deps = [ |
| ":test", |
| ":test-driver", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":device-watcher-test" ] |
| } |