blob: 1dbc47298457c72dfe8ab26cd666558a7ce1aabb [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_cpp_wire",
"//sdk/fidl/fuchsia.driver.development:fuchsia.driver.development_hlcpp",
"//sdk/fidl/fuchsia.driver.test:fuchsia.driver.test_hlcpp",
"//sdk/lib/component/outgoing/cpp",
"//sdk/lib/device-watcher/cpp",
"//sdk/lib/driver_test_realm/realm_builder/cpp",
"//sdk/lib/fdio",
"//src/lib/ddk",
"//src/lib/fxl/test:gtest_main",
"//src/lib/testing/loop_fixture",
]
}
fuchsia_unittest_package("fidl-protocol-test") {
deps = [
":child",
":isolated-child",
":parent",
":test",
"//src/devices/misc/drivers/test-parent",
]
}
bind_library("fidl_protocol.testlib") {
source = "testbindlib.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_cpp_wire",
":parent-driver-bind",
"//sdk/fidl/fuchsia.io:fuchsia.io_cpp_wire",
"//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/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 = [ ":echo_bindlib" ]
}
fuchsia_driver("child-driver") {
output_name = "fidl-protocol-child"
sources = [ "child-driver.cc" ]
deps = [
":child-driver-bind",
":echo_cpp_wire",
":fidl_protocol.testlib_cpp",
"//src/devices/lib/driver",
"//src/devices/lib/driver:driver_runtime",
"//src/lib/ddk",
"//src/lib/ddktl",
]
}
fuchsia_driver_component("child") {
component_name = "child"
deps = [ ":child-driver" ]
info = "child-info.json"
colocate = false
}
driver_bind_rules("isolated-child-driver-bind") {
rules = "isolated-child-driver.bind"
header_output = "isolated-child-driver-bind.h"
deps = [ ":fidl_protocol.testlib" ]
}
fuchsia_driver("isolated-child-driver") {
output_name = "fidl-protocol-isolated-child"
sources = [ "isolated-child-driver.cc" ]
deps = [
":isolated-child-driver-bind",
"//src/devices/lib/driver",
"//src/devices/lib/driver:driver_runtime",
"//src/lib/ddk",
"//src/lib/ddktl",
]
}
fuchsia_driver_component("isolated-child") {
component_name = "isolated-child"
deps = [ ":isolated-child-driver" ]
info = "isolated-child-info.json"
# The FidlProtocolTest.ColocateFlagIsRespected test checks that this flag has its intended effect.
colocate = false
}
group("tests") {
testonly = true
deps = [ ":fidl-protocol-test" ]
}