| # 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/components.gni") |
| |
| # Common configuration for tests. |
| config("test_config") { |
| defines = [ "CONFIG_TEST_SIM=1" ] |
| } |
| |
| # Simulated transportation layer -- for unittest code. |
| source_set("sim_library") { |
| testonly = true |
| sources = [ |
| "fake-ucode-capa-test.cc", |
| "inspect-host-cmd.cc", |
| "inspect-host-cmd.h", |
| "sim-mvm.cc", |
| "sim-nvm-data.inc", |
| "sim-nvm.cc", |
| "sim-trans.cc", |
| "single-ap-test.cc", |
| "tlv-fw-builder.cc", |
| "tlv-fw-builder.h", |
| "wlan-pkt-builder.cc", |
| ] |
| public = [ |
| "fake-ucode-capa-test.h", |
| "mock-trans.h", |
| "sim-mvm.h", |
| "sim-nvm.h", |
| "sim-trans.h", |
| "sim.h", |
| "single-ap-test.h", |
| "wlan-pkt-builder.h", |
| ] |
| deps = [ |
| "//sdk/banjo/fuchsia.hardware.wlan.mac:fuchsia.hardware.wlan.mac_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.wlanphyimpl:fuchsia.hardware.wlanphyimpl_banjo_cpp", |
| "//sdk/fidl/fuchsia.wlan.common:fuchsia.wlan.common_banjo_cpp", |
| "//src/iwlwifi:core", |
| "//src/iwlwifi/fw:api", |
| "//src/iwlwifi/mvm", |
| "//src/iwlwifi/platform:fuchsia_device", |
| "//src/devices/testing/fake-bti", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fbl", |
| ] |
| public_deps = [ |
| "//src/connectivity/wlan/drivers/testing/lib/sim-device", |
| "//src/connectivity/wlan/drivers/testing/lib/sim-env", |
| "//src/connectivity/wlan/drivers/testing/lib/sim-fake-ap", |
| "//src/iwlwifi:core", |
| "//src/iwlwifi/platform", |
| "//src/devices/pci/testing:pci-protocol-fake", |
| "//src/devices/testing/mock-ddk", |
| "//zircon/system/public", |
| "//zircon/system/ulib/zxtest", |
| ] |
| public_configs = [ ":test_config" ] |
| |
| # TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| # Stub entrypoints for MVM. |
| source_set("stub_mvm") { |
| testonly = true |
| sources = [ "stub-mvm.cc" ] |
| deps = [ "//zircon/system/public" ] |
| public_configs = [ |
| "//src/iwlwifi:fuchsia_config", |
| ] |
| } |
| |
| # Test for the driver inspector. |
| executable("driver_inspector_test") { |
| output_name = "driver_inspector_test" |
| testonly = true |
| sources = [ "driver-inspector-test.cc" ] |
| deps = [ |
| "//src/iwlwifi/platform:driver_inspector", |
| "//zircon/system/ulib/inspect", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| # The dummy code for developer to start a new test. |
| executable("dummy_test") { |
| output_name = "dummy_test" |
| testonly = true |
| sources = [ "dummy-test.cc" ] |
| deps = [ |
| ":sim_library", |
| "//zircon/system/ulib/zxtest", |
| ] |
| |
| # TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| executable("fw_test") { |
| output_name = "fw_test" |
| testonly = true |
| sources = [ "fw-test.cc" ] |
| deps = [ |
| ":sim_library", |
| "//src/iwlwifi:core", |
| "//src/iwlwifi/mvm", |
| "//zircon/system/ulib/zxtest", |
| ] |
| |
| # TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| executable("fw_dbg_test") { |
| output_name = "fw_dbg_test" |
| testonly = true |
| sources = [ "fw-dbg-test.cc" ] |
| deps = [ |
| ":sim_library", |
| "//src/iwlwifi/fw", |
| "//src/iwlwifi/platform:driver_inspector", |
| "//zircon/system/ulib/inspect", |
| "//zircon/system/ulib/zxtest", |
| ] |
| |
| # TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| executable("iwl_phy_db_test") { |
| output_name = "iwl_phy_db_test" |
| testonly = true |
| sources = [ "iwl-phy-db-test.cc" ] |
| deps = [ |
| ":stub_mvm", |
| "//src/iwlwifi:core", |
| "//src/devices/testing/no_ddk", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| executable("mac80211_test") { |
| output_name = "mac80211_test" |
| testonly = true |
| sources = [ "mac80211-test.cc" ] |
| deps = [ |
| ":sim_library", |
| "//src/iwlwifi/mvm", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/mock-function", |
| "//zircon/system/ulib/zxtest", |
| ] |
| |
| # TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| executable("mac_ctxt_test") { |
| output_name = "mac_ctxt_test" |
| testonly = true |
| sources = [ "mac-ctxt-test.cc" ] |
| deps = [ |
| ":sim_library", |
| "//src/iwlwifi/mvm", |
| "//zircon/system/ulib/zircon-internal", |
| "//zircon/system/ulib/zxtest", |
| ] |
| |
| # TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| executable("mvm_mlme_test") { |
| output_name = "mvm_mlme_test" |
| testonly = true |
| sources = [ "mvm-mlme-test.cc" ] |
| deps = [ |
| ":sim_library", |
| "//sdk/fidl/fuchsia.wlan.common:fuchsia.wlan.common_banjo_cpp", |
| "//sdk/fidl/fuchsia.wlan.internal:fuchsia.wlan.internal_banjo_cpp", |
| "//src/iwlwifi/mvm", |
| "//src/iwlwifi/platform:fuchsia_device", |
| "//zircon/system/public", |
| "//zircon/system/ulib/mock-function", |
| "//zircon/system/ulib/zxtest", |
| ] |
| |
| # TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| # Test code for MVM features. |
| executable("mvm_test") { |
| output_name = "mvm_test" |
| testonly = true |
| sources = [ "mvm-test.cc" ] |
| deps = [ |
| ":sim_library", |
| "//src/iwlwifi/mvm", |
| "//src/devices/testing/fake-bti", |
| "//zircon/system/ulib/mock-function", |
| "//zircon/system/ulib/zircon-internal", |
| "//zircon/system/ulib/zxtest", |
| ] |
| |
| # TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| executable("notif_wait_test") { |
| output_name = "notif_wait_test" |
| testonly = true |
| sources = [ "notif-wait-test.cc" ] |
| deps = [ |
| ":stub_mvm", |
| "//src/iwlwifi/fw", |
| "//src/devices/testing/no_ddk", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| executable("nvm_test") { |
| output_name = "nvm_test" |
| testonly = true |
| sources = [ "nvm-test.cc" ] |
| deps = [ |
| ":sim_library", |
| "//src/iwlwifi:core", |
| "//src/iwlwifi/mvm", |
| "//zircon/system/ulib/zxtest", |
| ] |
| |
| # TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| executable("pcie_test") { |
| output_name = "pcie_test" |
| testonly = true |
| sources = [ "pcie-test.cc" ] |
| deps = [ |
| ":sim_library", |
| "//src/iwlwifi:core", |
| "//src/iwlwifi/fw:api", |
| "//src/iwlwifi/pcie", |
| "//src/iwlwifi/platform:fuchsia_device", |
| "//src/devices/pci/testing:pci-protocol-fake", |
| "//src/devices/testing/fake-bti", |
| "//src/devices/testing/mock-ddk", |
| "//zircon/system/public", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/mock-function", |
| "//zircon/system/ulib/sync", |
| "//zircon/system/ulib/zircon-internal", |
| "//zircon/system/ulib/zx", |
| "//zircon/system/ulib/zxtest", |
| ] |
| |
| # TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| executable("phy_ctxt_test") { |
| output_name = "phy_ctxt_test" |
| testonly = true |
| sources = [ "phy-ctxt-test.cc" ] |
| deps = [ |
| ":sim_library", |
| "//src/iwlwifi/mvm", |
| "//zircon/system/ulib/zircon-internal", |
| "//zircon/system/ulib/zxtest", |
| ] |
| |
| # TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| executable("platform_test") { |
| output_name = "platform_test" |
| testonly = true |
| sources = [ "platform-test.cc" ] |
| deps = [ |
| ":stub_mvm", |
| "//src/iwlwifi/platform", |
| "//src/devices/testing/no_ddk", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| executable("sta_test") { |
| output_name = "sta_test" |
| testonly = true |
| sources = [ "sta-test.cc" ] |
| deps = [ |
| ":sim_library", |
| "//src/iwlwifi/mvm", |
| "//zircon/system/ulib/mock-function", |
| "//zircon/system/ulib/zxtest", |
| ] |
| |
| # TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| executable("task_test") { |
| output_name = "task_test" |
| testonly = true |
| sources = [ "task-test.cc" ] |
| deps = [ |
| ":stub_mvm", |
| "//src/iwlwifi/platform", |
| "//src/devices/testing/no_ddk", |
| "//zircon/system/public", |
| "//zircon/system/ulib/async-testing", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| executable("utils_test") { |
| output_name = "utils_test" |
| testonly = true |
| sources = [ "utils-test.cc" ] |
| deps = [ |
| "//src/iwlwifi/mvm", |
| "//src/devices/testing/no_ddk", |
| "//zircon/system/ulib/zxtest", |
| ] |
| |
| # TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| _tests = [ |
| "driver_inspector_test", |
| "dummy_test", |
| "fw_test", |
| "fw_dbg_test", |
| "iwl_phy_db_test", |
| "mac80211_test", |
| "mac_ctxt_test", |
| "mvm_mlme_test", |
| "mvm_test", |
| "notif_wait_test", |
| "nvm_test", |
| "pcie_test", |
| "phy_ctxt_test", |
| "platform_test", |
| "sta_test", |
| "task_test", |
| "utils_test", |
| ] |
| |
| foreach(test_name, _tests) { |
| fuchsia_unittest_component("${test_name}_component") { |
| deps = [ ":${test_name}" ] |
| } |
| } |
| |
| fuchsia_test_package("iwlwifi_test") { |
| test_components = [] |
| foreach(test_name, _tests) { |
| test_components += [ ":${test_name}_component" ] |
| } |
| } |