blob: aa49c5a60f88738fbda10342ff7ddf50023d3957 [file] [log] [blame] [edit]
# 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/bind/bind.gni")
import("//build/components.gni")
import("//build/drivers.gni")
import("//build/test.gni")
fidl("echo") {
name = "fidl.examples.echo"
sources = [ "echo.test.fidl" ]
}
test("test") {
output_name = "fidl-protocol-test"
sources = [ "fidl-protocol-test.cc" ]
deps = [
":echo_llcpp",
"//sdk/fidl/fuchsia.driver.test:fuchsia.driver.test_llcpp",
"//sdk/lib/device-watcher/cpp",
"//sdk/lib/fdio",
"//src/lib/ddk",
"//zircon/system/ulib/service:service-llcpp",
"//zircon/system/ulib/zxtest",
]
# TODO(fxbug.dev/94768): This target uses mutable tables which are deprecated,
# rather than builders.
configs += [ "//build/cpp:fidl-wire-deprecated-mutable-tables" ]
}
fuchsia_unittest_package("fidl-protocol-test") {
deps = [
":child",
":parent",
":test",
"//sdk/lib/driver_test_realm",
"//src/devices/misc/drivers/test-parent",
]
}
bind_library("fidl.examples.echo-bind") {
name = "fidl.examples.echo"
source = "fidl-examples-echo.bind"
}
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") {
output_name = "fidl-protocol-parent"
sources = [ "parent-driver.cc" ]
deps = [
":echo_llcpp",
":parent-driver-bind",
"//sdk/fidl/fuchsia.io:fuchsia.io_llcpp",
"//sdk/lib/driver_runtime:driver_runtime_cpp",
"//src/devices/lib/driver",
"//src/devices/lib/driver:driver_runtime",
"//src/lib/ddk",
"//src/lib/ddktl",
"//zircon/system/ulib/fidl:fidl-llcpp",
"//zircon/system/ulib/svc",
]
}
fuchsia_driver_component("parent") {
component_name = "parent"
deps = [ ":parent-driver" ]
info = "parent-info.json"
colocate = true
}
driver_bind_rules("child-driver-bind") {
rules = "child-driver.bind"
header_output = "child-driver-bind.h"
deps = [ ":fidl.examples.echo-bind" ]
}
fuchsia_driver("child-driver") {
output_name = "fidl-protocol-child"
sources = [ "child-driver.cc" ]
deps = [
":child-driver-bind",
":echo_llcpp",
"//src/devices/lib/driver",
"//src/devices/lib/driver:driver_runtime",
"//src/lib/ddk",
"//src/lib/ddktl",
"//zircon/system/ulib/fidl:fidl-llcpp",
]
}
fuchsia_driver_component("child") {
component_name = "child"
deps = [ ":child-driver" ]
info = "child-info.json"
colocate = true
}
group("tests") {
testonly = true
deps = [ ":fidl-protocol-test" ]
}