| # 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/test.gni") |
| import("//src/sys/build/fuchsia_unittest_package.gni") |
| import("//zircon/system/ulib/devmgr-integration-test/isolated_devmgr.gni") |
| |
| bind_rules("ethernet_bind") { |
| rules = "ethernet.bind" |
| output = "ethernet-bind.h" |
| tests = "bind-tests.json" |
| deps = [ "//src/devices/bind/fuchsia.ethernet" ] |
| } |
| |
| driver_module("ethernet") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| sources = [ "ethernet.cc" ] |
| deps = [ |
| ":ethernet_bind", |
| "//sdk/banjo/fuchsia.hardware.ethernet", |
| "//sdk/fidl/fuchsia.hardware.ethernet:fuchsia.hardware.ethernet_c", |
| "//src/devices/lib/dev-operation", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/fidl", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/system/ulib/fidl-utils", |
| "//zircon/system/ulib/fzl", |
| ] |
| } |
| |
| test("ethernet-unittest") { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| output_name = "ethernet-unittest" |
| configs += [ "//build/config:all_source" ] |
| sources = [ |
| "ethernet-test.cc", |
| "ethernet.cc", |
| ] |
| deps = [ |
| ":ethernet_bind", |
| "//sdk/banjo/fuchsia.hardware.ethernet", |
| "//sdk/fidl/fuchsia.hardware.ethernet:fuchsia.hardware.ethernet_c", |
| "//src/devices/lib/dev-operation", |
| "//src/devices/testing/fake_ddk", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/fidl-utils", |
| "//zircon/system/ulib/fzl", |
| ] |
| } |
| |
| fuchsia_unittest_package("ethernet-unittest-package") { |
| package_name = "ethernet-unittest" |
| deps = [ ":ethernet-unittest" ] |
| } |
| |
| test("ethernet-integration") { |
| output_name = "ethernet-integration-test" |
| sources = [ "ethernet-integration-test.cc" ] |
| deps = [ |
| "//sdk/banjo/fuchsia.hardware.ethernet", |
| "//sdk/fidl/fuchsia.hardware.ethernet:fuchsia.hardware.ethernet_c", |
| "//sdk/fidl/fuchsia.hardware.ethertap:fuchsia.hardware.ethertap_c", |
| "//sdk/lib/fdio", |
| "//src/lib/ddk", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/fidl", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/devmgr-integration-test", |
| "//zircon/system/ulib/fzl", |
| ] |
| } |
| |
| isolated_devmgr_unittest_package("ethernet-integration-test") { |
| executable_path = "test/ethernet-integration-test" |
| deps = [ |
| ":ethernet", |
| ":ethernet-integration", |
| "//src/connectivity/ethernet/drivers/ethertap", |
| "//src/devices/misc/drivers/test", |
| "//src/devices/tests/sysdev", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":ethernet-integration-test", |
| ":ethernet-unittest-package", |
| ":ethernet_bind_test", |
| ] |
| } |