blob: 6363f31e495833daf3918747c46e53b18bb4e90b [file] [log] [blame]
# 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/components.gni")
import("//build/drivers.gni")
import("//build/rust/rustc_test.gni")
group("tests") {
testonly = true
deps = [
":interop_leaf_bind_test",
":interop_test",
":interop_v1_bind_test",
]
}
fidl("fuchsia.interop.test") {
testonly = true
sources = [ "interop.test.fidl" ]
}
driver_bind_rules("root_bind") {
disable_autobind = true
bind_output = "root.bindbc"
}
fuchsia_driver("root_driver") {
testonly = true
output_name = "interop_root"
sources = [ "root_driver.cc" ]
deps = [
":root_bind",
"//sdk/lib/driver/compat/cpp",
"//sdk/lib/driver/compat/cpp:symbols",
"//sdk/lib/driver/component/cpp:cpp",
"//src/devices/bind/fuchsia.test:fuchsia.test_cpp",
"//src/devices/lib/driver:driver_runtime",
"//src/lib/ddk",
]
# TODO(https://fxbug.dev/42176699): This target uses mutable tables which are deprecated,
# rather than builders.
configs += [ "//build/cpp:fidl-wire-deprecated-mutable-tables" ]
}
fuchsia_driver_component("root") {
testonly = true
manifest = "meta/root.cml"
deps = [ ":root_driver" ]
info = "root-info.json"
}
driver_bind_rules("interop_v1_bind") {
rules = "v1.bind"
bind_output = "v1.bindbc"
tests = "v1.bind_tests.json"
deps = [ "//src/devices/bind/fuchsia.test" ]
}
fuchsia_driver("v1_driver") {
testonly = true
output_name = "interop_v1"
sources = [ "v1_driver.cc" ]
deps = [
":interop_v1_bind",
"//src/devices/bind/fuchsia.test:fuchsia.test_cpp",
"//src/devices/lib/driver",
"//src/lib/ddk",
]
}
fuchsia_driver_component("v1") {
testonly = true
deps = [
":v1_driver",
"//src/devices/misc/drivers/compat:driver",
]
info = "v1-info.json"
manifest = "meta/v1.cml"
}
driver_bind_rules("interop_leaf_bind") {
rules = "leaf.bind"
bind_output = "leaf.bindbc"
tests = "leaf.bind_tests.json"
deps = [ "//src/devices/bind/fuchsia.test" ]
}
fuchsia_driver("leaf_driver") {
testonly = true
output_name = "interop_leaf"
sources = [ "leaf_driver.cc" ]
deps = [
":fuchsia.interop.test_cpp",
":interop_leaf_bind",
"//sdk/lib/driver/component/cpp:cpp",
"//src/devices/lib/driver:driver_runtime",
]
}
fuchsia_driver_component("leaf") {
testonly = true
manifest = "meta/leaf.cml"
deps = [ ":leaf_driver" ]
info = "leaf-info.json"
}
rustc_test("bin") {
edition = "2021"
testonly = true
output_name = "interop_bin"
source_root = "test.rs"
sources = [ "test.rs" ]
deps = [
":fuchsia.interop.test_rust",
"//sdk/fidl/fuchsia.driver.test:fuchsia.driver.test_rust",
"//sdk/lib/device-watcher/rust",
"//sdk/lib/driver_test_realm/realm_builder/rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-component-test",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
]
}
fuchsia_unittest_package("interop_test") {
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
deps = [
":bin",
":leaf",
":root",
":v1",
"//sdk/lib/driver_test_realm:driver_test_realm_component",
"//src/devices/bin/driver_host:component",
]
}