blob: ab2b26eafc70e04f32a227eeeed636e8182848f4 [file] [log] [blame]
# 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")
fidl("echo") {
testonly = true
name = "fidl.examples.echo"
sources = [ "echo.test.fidl" ]
contains_drivers = true
}
test("test") {
output_name = "fidl-service-test"
sources = [ "fidl-service-test.cc" ]
deps = [
":echo_cpp",
"//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-service-test") {
deps = [
":child",
":parent",
":test",
"//src/devices/misc/drivers/test-parent",
]
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
}
driver_bind_rules("parent-driver-bind") {
testonly = true
rules = "parent-driver.bind"
deps = [ "//src/devices/bind/fuchsia.test" ]
}
fuchsia_driver("parent-driver") {
testonly = true
output_name = "fidl-service-parent"
sources = [ "parent-driver.cc" ]
deps = [
":echo_cpp",
":parent-driver-bind",
"//sdk/fidl/fuchsia.io:fuchsia.io_cpp",
"//sdk/lib/component/outgoing/cpp",
"//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/fbl",
]
}
fuchsia_driver_component("parent") {
testonly = true
component_name = "parent"
manifest = "meta/parent.cml"
deps = [ ":parent-driver" ]
info = "parent-info.json"
}
driver_bind_rules("child-driver-bind") {
testonly = true
rules = "child-driver.bind"
deps = [ ":echo_bindlib" ]
}
fuchsia_driver("child-driver") {
testonly = true
output_name = "fidl-service-child"
sources = [ "child-driver.cc" ]
deps = [
":child-driver-bind",
":echo_cpp",
"//src/devices/lib/driver",
"//src/devices/lib/driver:driver_runtime",
"//src/lib/ddk",
"//src/lib/ddktl",
]
}
fuchsia_driver_component("child") {
testonly = true
component_name = "child"
manifest = "meta/child.cml"
deps = [ ":child-driver" ]
info = "child-info.json"
}
group("tests") {
testonly = true
deps = [ ":fidl-service-test" ]
}