| # 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/config/fuchsia/rules.gni") |
| import("//build/test.gni") |
| import("//zircon/system/ulib/devmgr-integration-test/isolated_devmgr.gni") |
| |
| # The output of the test code below is made up of several binaries |
| # pci-unit-test: A binary to run the unit tests defiend in test/ |
| # pci-driver-test: A binary to run the driver tests |
| # pci_fake.so: A fake bus driver loaded by pci-driver-test to provide a bind |
| # point for pci_test.so |
| # pci_fake.proxy.so: The corresponding proxy driver that binds to pci_fake.so |
| # and loads pci_test.so |
| # pci_test.so: A zxtest driver to test the PCI protocol |
| test("pci-unit") { |
| output_name = "pci-unit-test" |
| sources = [ |
| "unit/allocation_tests.cc", |
| "unit/bus_tests.cc", |
| "unit/config_tests.cc", |
| "unit/device_tests.cc", |
| "unit/fake_pciroot_tests.cc", |
| "unit/main.cc", |
| ] |
| deps = [ |
| "//sdk/lib/inspect/testing/cpp:zxtest", |
| "//src/devices/bus/drivers/pci:user_pci", |
| "//src/devices/testing/fake-bti", |
| "//src/devices/testing/fake-msi", |
| "//src/devices/testing/fake-resource", |
| "//src/devices/testing/fake_ddk", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/inspect", |
| ] |
| } |
| |
| test("pci-driver") { |
| output_name = "pci-driver-test" |
| |
| sources = [ "driver/driver_tests.cc" ] |
| deps = [ |
| "//sdk/fidl/fuchsia.device.test:fuchsia.device.test_c", |
| "//sdk/lib/fdio", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/devmgr-integration-test", |
| "//zircon/system/ulib/driver-integration-test", |
| ] |
| } |
| |
| # These drivers are not 'test' drivers because at the moment having other |
| # drivers in test/ breaks ddkltl integration tests. |
| driver_module("pci_fake") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| testonly = true |
| sources = [ "driver/fake_bus_driver.cc" ] |
| public_deps = [ |
| "driver:fake_pci_bus_driver_bind", |
| "//src/devices/bus/drivers/pci:user_pci", |
| "//src/devices/lib/driver", |
| "//src/devices/testing/fake-bti", |
| "//src/devices/testing/fake-msi", |
| "//src/devices/testing/fake-resource", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/pretty", |
| "//zircon/public/lib/zxtest", |
| ] |
| } |
| |
| driver_module("pci_fake.proxy") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| deps = [ "//src/devices/bus/drivers/pci:pci.proxy" ] |
| } |
| |
| driver_module("pci_protocol_test_driver") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| sources = [ "driver/protocol_test_driver.cc" ] |
| deps = [ |
| "driver:pci_protocol_test_driver_bind", |
| "//sdk/fidl/fuchsia.device.test:fuchsia.device.test_c", |
| "//src/devices/bus/drivers/pci:user_pci", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/zxtest", |
| ] |
| } |
| |
| fuchsia_unittest_package("pci-unit-test") { |
| deps = [ ":pci-unit" ] |
| } |
| |
| isolated_devmgr_unittest_package("pci-driver-test") { |
| executable_path = "test/pci-driver-test" |
| deps = [ |
| ":pci-driver", |
| ":pci_fake", |
| ":pci_fake.proxy", |
| ":pci_protocol_test_driver", |
| "//src/devices/board/drivers/integration-test", |
| "//src/devices/bus/drivers/pci", |
| "//src/devices/bus/drivers/platform", |
| ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |