blob: 36e2e27f370068445643ad5ba6359cf7735db303 [file] [log] [blame]
# Copyright 2019 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/fidl/fidl.gni")
static_library("lib") {
friend = [ ":tests" ]
public = [
"library_loader.h",
"memory_helpers.h",
"message_decoder.h",
"wire_object.h",
"wire_parser.h",
"wire_types.h",
]
sources = [
"library_loader.cc",
"message_decoder.cc",
"wire_object.cc",
"wire_parser.cc",
"wire_types.cc",
]
deps = [
"//src/lib/fxl",
"//third_party/rapidjson",
"//zircon/public/lib/fidl_base",
]
}
if (current_toolchain == host_toolchain) {
static_library("host_lib") {
public = [
"interception_workflow.h",
"zx_channel_params.h",
]
sources = [
"interception_workflow.cc",
"zx_channel_params.cc",
]
deps = [
"//src/developer/debug/ipc:client",
"//src/developer/debug/zxdb/client",
"//src/developer/debug/zxdb/common",
"//src/developer/debug/zxdb/console",
"//src/lib/fxl",
"//zircon/public/lib/fit",
]
}
source_set("host_tests") {
testonly = true
sources = [
"interception_workflow_test.cc",
]
deps = [
":host_lib",
"//src/developer/debug/ipc:client",
"//src/developer/debug/zxdb/client:test_support",
"//third_party/googletest:gtest",
"//zircon/system/public",
]
}
}
source_set("tests") {
testonly = true
sources = [
"library_loader_test.cc",
"wire_parser_test.cc",
]
deps = [
":fidl",
":json_for_test",
":lib",
"//sdk/fidl/fuchsia.sys",
"//sdk/lib/fidl/cpp:test_support",
"//sdk/lib/fidl/cpp/test",
"//third_party/googletest:gtest",
"//third_party/googletest:gtest_main",
"//third_party/rapidjson",
"//zircon/public/lib/async-loop-cpp",
]
}
action("json_for_test") {
deps = [
":fidl($fidl_toolchain)",
":fidl-sys($fidl_toolchain)",
"//sdk/fidl/fuchsia.sys",
"//sdk/lib/fidl/cpp/test:frobinator",
"//zircon/public/fidl/fuchsia-io",
]
outputs = [
"$target_gen_dir/library_loader_test_data.h",
]
script = "generate_test_includes.sh"
args = [
rebase_path(target_gen_dir, root_build_dir) + "/library_loader_test_data.h",
rebase_path(root_build_dir) +
"/fidling/gen/sdk/lib/fidl/cpp/test/frobinator.fidl.json",
rebase_path(root_build_dir) +
"/fidling/gen/zircon/public/fidl/fuchsia-io/fuchsia-io.fidl.json",
rebase_path(root_build_dir) +
"/fidling/gen/tools/fidlcat/lib/fidl.fidl.json",
rebase_path(root_build_dir) +
"/fidling/gen/tools/fidlcat/lib/fidl-sys.fidl.json",
]
}
fidl("fidl") {
name = "test.fidlcat.examples"
sources = [
"testdata/empty.test.fidl",
"testdata/types.test.fidl",
]
}
fidl("fidl-sys") {
name = "test.fidlcat.sys"
sources = [
"testdata/sys.test.fidl",
]
}