blob: 7e4a9799d1acf02678bb5ca13599a388d1768618 [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/cpp/library_headers.gni")
import("//build/cpp/sdk_shared_library.gni")
import("//build/test.gni")
group("tests") {
testonly = true
deps = [
":driver_runtime_death_tests",
":driver_runtime_scheduler_role_tests",
":driver_runtime_sdk_tests",
":driver_runtime_shutdown_process_tests",
":driver_runtime_tests",
"microbenchmarks:driver_runtime_microbenchmarks",
]
}
config("include") {
include_dirs = [ "include" ]
}
source_set("driver_runtime_impl") {
sources = [
"api.cc",
"arena.cc",
"channel.cc",
"dispatcher.cc",
"dispatcher_dump.cc",
"driver_context.cc",
"handle.cc",
"message_packet.cc",
"token_manager.cc",
]
public_configs = [ ":include" ]
public_deps = [
"//sdk/lib/driver/runtime:driver_runtime",
"//zircon/system/ulib/async-loop:async-loop-cpp",
]
deps = [
"//sdk/fidl/fuchsia.scheduler:fuchsia.scheduler_cpp",
"//sdk/lib/component/incoming/cpp",
"//sdk/lib/driver/runtime:driver_runtime_env",
"//sdk/lib/driver/runtime:driver_runtime_internal",
"//sdk/lib/driver/runtime:driver_runtime_testing",
"//sdk/lib/fidl/cpp/wire",
"//src/devices/lib/log",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/trace",
]
}
sdk_shared_library("driver_runtime") {
category = "partner"
libcxx_linkage = "static"
no_headers = true
sdk_name = "driver_runtime_shared_lib"
symbols_api = "driver_runtime.ifs"
sources = []
deps = [ ":driver_runtime_impl" ]
runtime_deps = [
"//sdk/lib/fdio:fdio_sdk",
"//sdk/lib/svc:svc_sdk",
"//zircon/system/ulib/syslog:syslog_sdk",
"//zircon/system/ulib/trace-engine:trace-engine_sdk",
]
}
test("driver_runtime_test") {
sources = [
"arena_test.cc",
"channel_test.cc",
"dispatcher_dump_test.cc",
"dispatcher_test.cc",
"driver_context_test.cc",
"handle_test.cc",
"runtime_test_case.cc",
"token_test.cc",
]
deps = [
":driver_runtime_impl",
"//sdk/lib/driver/component/cpp",
"//sdk/lib/driver/runtime:driver_runtime",
"//sdk/lib/driver/runtime:driver_runtime_cpp",
"//sdk/lib/driver/runtime:driver_runtime_env_cpp",
"//sdk/lib/driver/runtime:driver_runtime_internal",
"//sdk/lib/driver/runtime:driver_runtime_testing",
"//sdk/lib/driver/runtime/testing/cpp",
"//sdk/lib/driver/testing/cpp:cpp",
"//sdk/lib/fidl/cpp/wire",
"//sdk/lib/fidl_driver:fidl_driver_transport",
"//zircon/system/ulib/async:async-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/sync:sync-cpp",
"//zircon/system/ulib/zx",
"//zircon/system/ulib/zxtest",
]
}
test("driver_runtime_scheduler_role_test") {
sources = [ "scheduler_role_test.cc" ]
deps = [
":driver_runtime_impl",
"//sdk/lib/driver/runtime:driver_runtime",
"//sdk/lib/driver/runtime:driver_runtime_cpp",
"//sdk/lib/driver/runtime:driver_runtime_env_cpp",
"//sdk/lib/driver/runtime:driver_runtime_testing",
"//sdk/lib/driver/testing/cpp:cpp",
"//zircon/system/ulib/async:async-cpp",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/sync:sync-cpp",
"//zircon/system/ulib/zx",
"//zircon/system/ulib/zxtest",
]
}
test("driver_runtime_death_test") {
sources = [ "channel_death_test.cc" ]
deps = [
":driver_runtime_impl",
"//sdk/lib/driver/runtime:driver_runtime",
"//sdk/lib/driver/runtime:driver_runtime_cpp",
"//sdk/lib/fidl/cpp/wire",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/sync:sync-cpp",
"//zircon/system/ulib/zx",
"//zircon/system/ulib/zxtest",
]
}
test("driver_runtime_shutdown_process_test") {
sources = [ "shutdown_process_test.cc" ]
deps = [
":driver_runtime_impl",
"//sdk/lib/driver/runtime:driver_runtime",
"//sdk/lib/driver/runtime:driver_runtime_cpp",
"//sdk/lib/driver/runtime:driver_runtime_testing",
"//sdk/lib/driver/testing/cpp:cpp",
"//sdk/lib/fidl/cpp/wire",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/sync:sync-cpp",
"//zircon/system/ulib/zx",
"//zircon/system/ulib/zxtest",
]
}
test("fixture_test") {
sources = [ "fixture_test.cc" ]
deps = [
"//sdk/lib/driver/testing/cpp",
"//src/devices/lib/driver:driver_runtime",
"//src/lib/fxl/test:gtest_main",
]
}
fuchsia_unittest_package("driver_runtime_sdk_tests") {
deps = [ ":fixture_test" ]
}
fuchsia_unittest_package("driver_runtime_tests") {
deps = [ ":driver_runtime_test" ]
}
fuchsia_unittest_package("driver_runtime_scheduler_role_tests") {
manifest = "meta/driver_runtime_scheduler_role_test.cml"
deps = [ ":driver_runtime_scheduler_role_test" ]
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
test_type = "system"
}
fuchsia_unittest_package("driver_runtime_death_tests") {
deps = [ ":driver_runtime_death_test" ]
}
fuchsia_unittest_package("driver_runtime_shutdown_process_tests") {
deps = [ ":driver_runtime_shutdown_process_test" ]
}