| # 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. |
| |
| load( |
| "@rules_fuchsia//fuchsia:defs.bzl", |
| "fuchsia_package", |
| "fuchsia_unittest_component", |
| ) |
| |
| package(default_visibility = ["//visibility:public"]) |
| |
| # List to hold the test binaries, for ease of component creation. |
| _tests = [] |
| |
| filegroup( |
| name = "common_libs", |
| srcs = [ |
| "@fuchsia_sdk//:arch/x64/sysroot/dist/lib/ld.so.1", |
| ], |
| visibility = ["//visibility:public"], |
| ) |
| |
| cc_library( |
| name = "sim_library", |
| srcs = [ |
| "fake-ucode-test.cc", |
| "inspect-host-cmd.cc", |
| "sim-mcc-update.cc", |
| "sim-mvm.cc", |
| "sim-nvm-data.inc", |
| "sim-nvm.cc", |
| "sim-time-event.cc", |
| "sim-trans.cc", |
| "single-ap-test.cc", |
| "tlv-fw-builder.cc", |
| "tlv-fw-builder.h", |
| "wlan-pkt-builder.cc", |
| ], |
| hdrs = [ |
| "fake-ucode-test.h", |
| "inspect-host-cmd.h", |
| "mock-trans.h", |
| "sim-mcc-update.h", |
| "sim-mvm.h", |
| "sim-nvm.h", |
| "sim-time-event.h", |
| "sim-trans.h", |
| "sim.h", |
| "single-ap-test.h", |
| "wlan-pkt-builder.h", |
| "test.h", |
| ], |
| |
| deps = [ |
| "//third_party/iwlwifi:core", |
| "//third_party/iwlwifi/fw:api", |
| "//third_party/iwlwifi/mvm", |
| "//third_party/iwlwifi/pcie", |
| "//third_party/iwlwifi/cfg", |
| "//third_party/iwlwifi/platform:fuchsia_device", |
| "//third_party/iwlwifi/platform:rcu_manager", |
| "//third_party/iwlwifi/platform:platform", |
| "@com_google_googletest//:gtest_main", |
| "@fuchsia_sdk//pkg/async-loop-cpp", |
| "@fuchsia_sdk//pkg/async-loop-default", |
| "@fuchsia_sdk//fidl/fuchsia.hardware.wlan.softmac:fuchsia.hardware.wlan.softmac_banjo_cc", |
| "@fuchsia_sdk//fidl/fuchsia.hardware.wlanphyimpl:fuchsia.hardware.wlanphyimpl_banjo_cc", |
| "@fuchsia_sdk//fidl/fuchsia.wlan.common:fuchsia.wlan.common_banjo_cc", |
| |
| # "//src/devices/testing/fake-bti", |
| # "//src/devices/pci/testing:pci-protocol-fake", |
| # "//src/devices/testing/mock-ddk", |
| # "//zircon/system/public", |
| ], |
| ) |
| |
| cc_library( |
| name = "stub_mvm", |
| srcs = ["stub-mvm.cc"], |
| ) |
| |
| # Test for the driver inspector. |
| cc_test( |
| name = "driver_inspector_test", |
| size = "small", |
| srcs = [ "driver-inspector-test.cc" ], |
| deps = [ |
| ":sim_library", |
| "@com_google_googletest//:gtest_main", |
| "@fuchsia_sdk//pkg/inspect", |
| "//third_party/iwlwifi/platform:driver_inspector", |
| ], |
| ) |
| _tests += [ "driver_inspector_test", ] |
| |
| # Dummy code for developer to start a new test. |
| cc_test( |
| name = "dummy_test", |
| size = "small", |
| srcs = [ "dummy-test.cc" ], |
| deps = [ |
| ":sim_library", |
| "@com_google_googletest//:gtest_main", |
| ], |
| ) |
| _tests += [ "dummy_test", ] |
| |
| # Create component for all the test binaries |
| [fuchsia_unittest_component( |
| name = tname + "_component", |
| test_name = tname, |
| deps = [ |
| ":common_libs", |
| ":" + tname, |
| "@fuchsia_clang//:dist", |
| "@fuchsia_sdk//pkg/fdio", |
| ], |
| ) for tname in _tests] |
| |
| fuchsia_package( |
| name = "iwlwifi_test_pkg", |
| package_name = "iwlwifi_test_pkg", |
| testonly = True, |
| visibility = ["//visibility:public"], |
| # How to auto genrate this dep list? |
| deps = [ |
| ":driver_inspector_test_component", |
| # ":dummy_test_component", # Requires mock and fake-ddk. |
| ], |
| ) |