blob: a6ce2732ab445386f6eee6c3f996607365c095b4 [file] [log] [blame]
# 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(
"@fuchsia_sdk//fuchsia:defs.bzl",
"fuchsia_cc_test",
"fuchsia_component_manifest",
"fuchsia_test_component",
"fuchsia_test_package",
)
package(default_visibility = ["//visibility:public"])
# List to hold the list of tests.
iwlwifi_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.cc",
"sim-nvm-data.inc",
"sim-scan.cc",
"sim-time-event.cc",
"sim-trans.cc",
"single-ap-test.cc",
"tkip-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.h",
"sim-mcc-update.h",
"sim-mvm.h",
"sim-nvm.h",
"sim-scan.h",
"sim-time-event.h",
"sim-trans.h",
"single-ap-test.h",
"wlan-pkt-builder.h",
],
deps = [
"//third_party/driver-lib/fake-bti",
"//third_party/iwlwifi:core",
"//third_party/iwlwifi/cfg",
"//third_party/iwlwifi/fw:api",
"//third_party/iwlwifi/mvm",
"//third_party/iwlwifi/pcie",
"//third_party/iwlwifi/platform",
"//third_party/iwlwifi/platform:iwlwifi_device",
"//third_party/iwlwifi/platform:rcu_manager",
"@fuchsia_sdk//fidl/fuchsia.wlan.phyimpl:fuchsia.wlan.phyimpl_cpp_driver",
"@fuchsia_sdk//pkg/async-loop-cpp",
"@fuchsia_sdk//pkg/async-loop-default",
"@fuchsia_sdk//pkg/driver_runtime_shared_lib",
"@fuchsia_sdk//pkg/driver_testing_cpp",
"@fuchsia_sdk//pkg/sync_cpp",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "mock_function",
hdrs = ["mock-function.h"],
)
cc_library(
name = "stub_mvm",
srcs = ["stub-mvm.cc"],
)
fuchsia_cc_test(
name = "task_test",
size = "small",
srcs = ["task-test.cc"],
deps = [
":mock_function",
":stub_mvm",
"//third_party/iwlwifi/platform",
"@fuchsia_sdk//pkg/async-testing",
"@com_google_googletest//:gtest_main",
],
)
iwlwifi_tests += ["task_test"]
fuchsia_cc_test(
name = "rcu_manager_test",
size = "small",
srcs = ["rcu-manager-test.cc"],
deps = [
"//third_party/iwlwifi/platform:rcu_manager",
"@fuchsia_sdk//pkg/async",
"@fuchsia_sdk//pkg/async-testing",
"@fuchsia_sdk//pkg/sync",
"@com_google_googletest//:gtest_main",
],
)
iwlwifi_tests += ["rcu_manager_test"]
# Dummy code for developer to start a new test.
fuchsia_cc_test(
name = "dummy_test",
size = "small",
srcs = ["dummy-test.cc"],
deps = [
":sim_library",
"@com_google_googletest//:gtest_main",
],
)
iwlwifi_tests += ["dummy_test"]
fuchsia_cc_test(
name = "fw_test",
size = "small",
srcs = ["fw-test.cc"],
deps = [
":sim_library",
"//third_party/iwlwifi:core",
"//third_party/iwlwifi/mvm",
"@com_google_googletest//:gtest_main",
],
)
iwlwifi_tests += ["fw_test"]
fuchsia_cc_test(
name = "fw_dbg_test",
size = "small",
srcs = ["fw-dbg-test.cc"],
deps = [
":sim_library",
"//third_party/iwlwifi/fw",
"//third_party/iwlwifi/platform:driver_inspector",
"@fuchsia_sdk//pkg/inspect",
"@com_google_googletest//:gtest_main",
],
)
iwlwifi_tests += ["fw_dbg_test"]
fuchsia_cc_test(
name = "driver_inspector_test",
size = "small",
srcs = ["driver-inspector-test.cc"],
deps = [
":sim_library",
"//third_party/iwlwifi/platform:driver_inspector",
"@fuchsia_sdk//pkg/async-default",
"@fuchsia_sdk//pkg/inspect",
"@com_google_googletest//:gtest_main",
],
)
iwlwifi_tests += ["driver_inspector_test"]
fuchsia_cc_test(
name = "driver_lifecycle_test",
size = "small",
srcs = ["driver-lifecycle-test.cc"],
deps = [
":sim_library",
"@fuchsia_sdk//fidl/fuchsia.wlan.softmac:fuchsia.wlan.softmac_cpp_driver",
"@fuchsia_sdk//pkg/async",
"@fuchsia_sdk//pkg/async_patterns_testing_cpp",
"@fuchsia_sdk//pkg/driver_runtime",
"@com_google_googletest//:gtest_main",
],
)
iwlwifi_tests += ["driver_lifecycle_test"]
fuchsia_cc_test(
name = "utils_test",
size = "small",
srcs = ["utils-test.cc"],
deps = [
"//third_party/iwlwifi/mvm",
"@com_google_googletest//:gtest_main",
],
)
iwlwifi_tests += ["utils_test"]
fuchsia_cc_test(
name = "iwl_phy_db_test",
size = "small",
srcs = ["iwl-phy-db-test.cc"],
deps = [
":stub_mvm",
"//third_party/iwlwifi:core",
"@fuchsia_sdk//pkg/async-loop-cpp",
"@com_google_googletest//:gtest_main",
],
)
iwlwifi_tests += ["iwl_phy_db_test"]
fuchsia_cc_test(
name = "mac80211_test",
size = "small",
srcs = ["mac80211-test.cc"],
deps = [
":mock_function",
":sim_library",
"//third_party/iwlwifi/mvm",
"@com_google_googletest//:gtest_main",
],
)
iwlwifi_tests += ["mac80211_test"]
fuchsia_cc_test(
name = "mac_ctxt_test",
size = "small",
srcs = ["mac-ctxt-test.cc"],
deps = [
":sim_library",
"//third_party/iwlwifi/mvm",
"@com_google_googletest//:gtest_main",
],
)
iwlwifi_tests += ["mac_ctxt_test"]
fuchsia_cc_test(
name = "mvm_test",
size = "small",
srcs = ["mvm-test.cc"],
deps = [
":mock_function",
":sim_library",
"//third_party/iwlwifi/mvm",
"@com_google_googletest//:gtest_main",
],
)
iwlwifi_tests += ["mvm_test"]
fuchsia_cc_test(
name = "phy_ctxt_test",
size = "small",
srcs = ["phy-ctxt-test.cc"],
deps = [
":sim_library",
"//third_party/iwlwifi/mvm",
"@com_google_googletest//:gtest_main",
],
)
iwlwifi_tests += ["phy_ctxt_test"]
fuchsia_cc_test(
name = "platform_test",
size = "small",
srcs = ["platform-test.cc"],
deps = [
":stub_mvm",
"//third_party/iwlwifi/platform",
"@com_google_googletest//:gtest_main",
],
)
iwlwifi_tests += ["platform_test"]
fuchsia_cc_test(
name = "sta_test",
size = "small",
srcs = ["sta-test.cc"],
deps = [
":mock_function",
":sim_library",
"//third_party/iwlwifi/mvm",
"@com_google_googletest//:gtest_main",
],
)
iwlwifi_tests += ["sta_test"]
fuchsia_cc_test(
name = "wlan_softmac_device_test",
size = "small",
srcs = ["wlan-softmac-device-test.cc"],
deps = [
":mock_function",
":sim_library",
"//third_party/iwlwifi:core",
"//third_party/iwlwifi/mvm",
"//third_party/iwlwifi/platform:iwlwifi_device",
"@fuchsia_sdk//fidl/fuchsia.wlan.ieee80211:fuchsia.wlan.ieee80211_cpp_wire",
"@fuchsia_sdk//fidl/fuchsia.wlan.phyimpl:fuchsia.wlan.phyimpl_cpp_driver",
"@com_google_googletest//:gtest_main",
],
)
iwlwifi_tests += ["wlan_softmac_device_test"]
fuchsia_cc_test(
name = "wlan_phy_impl_device_test",
size = "small",
srcs = ["wlanphy-impl-device-test.cc"],
deps = [
":sim_library",
"//third_party/iwlwifi/mvm",
"//third_party/iwlwifi/platform:iwlwifi_device",
"@fuchsia_sdk//fidl/fuchsia.wlan.phyimpl:fuchsia.wlan.phyimpl_cpp_driver",
"@com_google_googletest//:gtest_main",
],
)
iwlwifi_tests += ["wlan_phy_impl_device_test"]
fuchsia_cc_test(
name = "notif_wait_test",
size = "small",
srcs = ["notif-wait-test.cc"],
deps = [
":stub_mvm",
"//third_party/iwlwifi/fw",
"@com_google_googletest//:gtest_main",
],
)
iwlwifi_tests += ["notif_wait_test"]
fuchsia_cc_test(
name = "nvm_test",
size = "small",
srcs = ["nvm-test.cc"],
deps = [
":sim_library",
"//third_party/iwlwifi:core",
"//third_party/iwlwifi/mvm",
"@com_google_googletest//:gtest_main",
],
)
iwlwifi_tests += ["nvm_test"]
fuchsia_cc_test(
name = "pcie_test",
size = "small",
srcs = ["pcie-test.cc"],
deps = [
":mock_function",
":sim_library",
"//third_party/iwlwifi:core",
"//third_party/iwlwifi/fw:api",
"//third_party/iwlwifi/pcie",
"//third_party/iwlwifi/platform:iwlwifi_device",
"@fuchsia_sdk//fidl/fuchsia.wlan.phyimpl:fuchsia.wlan.phyimpl_cpp_driver",
"@fuchsia_sdk//pkg/async-loop-cpp",
"@fuchsia_sdk//pkg/async-loop-default",
"@fuchsia_sdk//pkg/async-loop-testing",
"@fuchsia_sdk//pkg/sync",
"@com_google_googletest//:gtest_main",
],
)
iwlwifi_tests += ["pcie_test"]
[
fuchsia_component_manifest(
name = test + "_manifest",
src = "meta/" + test + ".cml",
includes = [
"@fuchsia_sdk//pkg/sys/testing:elf_test_runner",
"@fuchsia_sdk//pkg/syslog:client",
],
)
for test in iwlwifi_tests
]
[
fuchsia_test_component(
name = test + "_component",
manifest = test + "_manifest",
deps = [":" + test],
)
for test in iwlwifi_tests
]
fuchsia_test_package(
name = "iwlwifi_test_pkg",
package_name = "iwlwifi_test_pkg",
fuchsia_api_level = "15",
test_components = [
":dummy_test_component",
":fw_test_component",
":fw_dbg_test_component",
":utils_test_component",
":driver_inspector_test_component",
":driver_lifecycle_test_component",
":iwl_phy_db_test_component",
":mac80211_test_component",
":mac_ctxt_test_component",
":mvm_test_component",
":phy_ctxt_test_component",
":platform_test_component",
":sta_test_component",
":wlan_phy_impl_device_test_component",
":notif_wait_test_component",
":nvm_test_component",
":pcie_test_component",
":task_test_component",
":rcu_manager_test_component",
":wlan_softmac_device_test_component",
],
visibility = ["//visibility:public"],
)