blob: b89bac3d14fc5e67ca25881ef2bdef74426cb320 [file] [log] [blame]
# 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("//build/test/test_package.gni")
import("//build/testing/environments.gni")
import("//zircon/system/ulib/devmgr-integration-test/isolated_devmgr.gni")
group("tests") {
testonly = true
deps = [ ":driver-host-tests" ]
}
executable("driver_host") {
sources = [ "main.cc" ]
deps = [
":common",
":driver",
]
}
source_set("common") {
sources = [
"api.cc",
"composite_device.cc",
"connection_destroyer.cc",
"core.cc",
"devfs_vnode.cc",
"device_controller_connection.cc",
"driver_host.cc",
"driver_host_context.cc",
"env.cc",
"inspect.cc",
"proxy_iostate.cc",
"scheduler_profile.cc",
"tracing.cc",
"zx_device.cc",
]
public_deps = [
"//sdk/banjo/ddk.protocol.composite",
"//sdk/fidl/fuchsia.device:fuchsia.device_llcpp",
"//sdk/fidl/fuchsia.device.manager:fuchsia.device.manager_c",
"//sdk/fidl/fuchsia.device.manager:fuchsia.device.manager_llcpp",
"//sdk/fidl/fuchsia.io:fuchsia.io_c",
"//sdk/fidl/fuchsia.scheduler:fuchsia.scheduler_c",
"//sdk/lib/fdio",
"//src/devices/lib/log",
"//src/lib/ddk",
# TODO(fxb/38132): Migrate to the new bind rules and delete the below
"//src/lib/ddk:ddk-deprecated-binding-headers",
"//src/lib/ddktl",
"//src/storage/deprecated-fs-fidl-handler",
"//zircon/public/lib/fbl",
"//zircon/public/lib/fidl",
"//zircon/public/lib/sync",
"//zircon/public/lib/zircon-internal",
"//zircon/public/lib/zx",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/fidl-async",
"//zircon/system/ulib/fs",
"//zircon/system/ulib/inspect",
"//zircon/system/ulib/trace",
"//zircon/system/ulib/trace-provider:trace-provider-with-fdio",
"//zircon/system/ulib/zxio",
]
configs += [
"//build/config:all_source",
"//build/config/fuchsia:static_cpp_standard_library",
]
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
shared_library("driver") {
sources = []
deps = [ ":common" ]
}
driver_module("driver-host-test-driver") {
configs += [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
]
configs -= [ "//build/config/fuchsia:no_cpp_standard_library" ]
configs += [
"//build/config/fuchsia:static_cpp_standard_library",
"//build/unification/config:zircon-migrated",
]
sources = [ "test-driver.cc" ]
deps = [
"//sdk/lib/fdio",
"//src/devices/lib/driver",
"//src/lib/ddk",
"//src/lib/ddktl",
# TODO(fxb/38132): Migrate to the new bind rules and delete the below
"//src/lib/ddk:ddk-deprecated-binding-headers",
]
}
driver_module("driver-host-test-child-driver") {
configs += [ "//build/config:all_source" ]
configs -= [ "//build/config/fuchsia:no_cpp_standard_library" ]
configs += [
"//build/config/fuchsia:static_cpp_standard_library",
"//build/unification/config:zircon-migrated",
]
sources = [ "test-driver-child.cc" ]
deps = [
"//sdk/lib/fdio",
"//src/devices/lib/driver",
"//src/lib/ddk",
"//src/lib/ddktl",
# TODO(fxb/38132): Migrate to the new bind rules and delete the below
"//src/lib/ddk:ddk-deprecated-binding-headers",
]
}
test("driver_host_test") {
sources = [
"core_test.cc",
"device_api_test.cc",
"device_controller_connection_test.cc",
"device_controller_integration_test.cc",
"driver_host_test.cc",
"inspect_test.cc",
"proxy_iostate_test.cc",
]
deps = [
":common",
"//sdk/fidl/fuchsia.device.test:fuchsia.device.test_llcpp",
"//src/lib/testing/loop_fixture",
"//zircon/public/lib/zxtest",
"//zircon/system/ulib/devmgr-integration-test",
"//zircon/system/ulib/driver-integration-test",
"//zircon/system/ulib/fidl-async:fidl-async-cpp",
]
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
isolated_devmgr_unittest_package("driver-host-tests") {
executable_path = "test/driver_host_test"
deps = [
":driver-host-test-child-driver",
":driver-host-test-driver",
":driver_host_test",
"//src/devices/board/drivers/integration-test",
"//src/devices/bus/drivers/platform",
"//src/devices/misc/drivers/test",
"//src/devices/tests/sysdev",
"//src/devices/tests/unit-test-test:unit-test-fail",
"//src/devices/tests/unit-test-test:unit-test-pass",
]
}