| # Copyright 2020 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("//src/sys/build/fuchsia_unittest_package.gni") |
| |
| bind_rules("network-device_bind") { |
| rules = "network_device.bind" |
| output = "network_device_bind.h" |
| tests = "bind-tests.json" |
| deps = [ "//src/devices/bind/fuchsia.network" ] |
| } |
| |
| source_set("src") { |
| sources = [ |
| "network_device.cc", |
| "network_device.h", |
| ] |
| public_deps = [ |
| ":network-device_bind", |
| "device:device_ddk", |
| "mac:mac_ddk", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| ] |
| } |
| |
| driver_module("network-device") { |
| configs += [ "//build/config/fuchsia:enable_zircon_asserts" ] |
| |
| deps = [ |
| ":src", |
| "//src/devices/lib/driver", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ |
| ":network-device-test", |
| ":network-device_bind_test", |
| "device:tests", |
| "mac:tests", |
| ] |
| } |
| |
| executable("driver-test") { |
| testonly = true |
| output_name = "network-device-test" |
| sources = [ |
| "device/test_util.cc", |
| "device/test_util.h", |
| "mac/test_util.cc", |
| "mac/test_util.h", |
| "network_device_test.cc", |
| ] |
| deps = [ |
| ":src", |
| "//src/devices/testing/fake-bti", |
| "//src/devices/testing/fake_ddk", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxtest", |
| ] |
| } |
| |
| fuchsia_unittest_package("network-device-test") { |
| deps = [ ":driver-test" ] |
| executable_path = "bin/network-device-test" |
| } |