blob: 010fe58356e58d3ae36e5de2c65950e7550908a1 [file] [log] [blame] [edit]
# Copyright 2022 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/bind/bind.gni")
import("//build/components.gni")
import("//build/drivers.gni")
import("//build/test.gni")
test("test") {
output_name = "bindlib-to-fidl-codegen-test"
sources = [ "bindlib-to-fidl-codegen-test.cc" ]
deps = [
":bind.bindlib.to.fidl.testlib",
":bind.bindlibparent.to.fidl.testlib",
"//sdk/fidl/fuchsia.device:fuchsia.device_llcpp",
"//sdk/fidl/fuchsia.device.test:fuchsia.device.test_llcpp",
"//sdk/fidl/fuchsia.driver.development",
"//sdk/lib/device-watcher/cpp",
"//sdk/lib/driver_test_realm/simple",
"//sdk/lib/fdio",
"//sdk/lib/sys/cpp",
"//sdk/lib/sys/cpp",
"//src/lib/ddk",
"//src/lib/fxl",
"//src/lib/fxl/test:gtest_main",
]
}
fuchsia_unittest_package("bindlib-to-fidl-codegen-test") {
deps = [
":child-driver",
":parent-driver",
":test",
"//src/devices/misc/drivers/test-parent",
]
}
bind_library("bindlibparent.to.fidl.testlib") {
source = "testbindlib_parent.bind"
}
bind_library("bindlib.to.fidl.testlib") {
source = "testbindlib.bind"
public_deps = [
# TODO(fxb/95933): depend on bindlibparent when we start using it.
"//src/devices/bind/fuchsia.pci",
]
}
driver_bind_rules("parent-driver-bind") {
rules = "parent-driver.bind"
header_output = "parent-driver-bind.h"
deps = [ "//src/devices/bind/fuchsia.test" ]
}
fuchsia_driver("parent-driver-driver") {
output_name = "bindlib-to-fidl-codegen-parent"
configs += [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
]
sources = [ "parent-driver.cc" ]
deps = [
":bind.bindlib.to.fidl.testlib",
":bind.bindlibparent.to.fidl.testlib",
":parent-driver-bind",
"//src/devices/lib/driver",
"//src/lib/ddk",
]
}
fuchsia_driver_component("parent-driver") {
component_name = "bindlib-to-fidl-codegen-parent"
deps = [ ":parent-driver-driver" ]
info = "parent-driver-info.json"
colocate = true
}
driver_bind_rules("child-driver-bind") {
rules = "child-driver.bind"
header_output = "child-driver-bind.h"
deps = [
":bindlib.to.fidl.testlib",
":bindlibparent.to.fidl.testlib",
"//src/devices/bind/fuchsia.test",
]
}
fuchsia_driver("child-driver-driver") {
output_name = "bindlib-to-fidl-codegen-child"
configs += [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
]
sources = [ "child-driver.cc" ]
deps = [
":child-driver-bind",
"//src/devices/lib/driver",
"//src/lib/ddk",
]
}
fuchsia_driver_component("child-driver") {
component_name = "bindlib-to-fidl-codegen-child"
deps = [ ":child-driver-driver" ]
info = "child-driver-info.json"
colocate = true
}