blob: 12b1e5f4e6fc026002ffe1242521850f5d7cb13b [file] [log] [blame]
# Copyright 2016 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/package.gni")
import("//build/test/test_package.gni")
import("//build/testing/environments.gni")
# A framework for running subprocesses ("inferiors") under debugger-like
# control.
static_library("inferior_control") {
sources = [
"arch.h",
"breakpoint.cc",
"breakpoint.h",
"delegate.cc",
"delegate.h",
"exception_port.cc",
"exception_port.h",
"io_loop.cc",
"io_loop.h",
"memory_process.cc",
"memory_process.h",
"process.cc",
"process.h",
"registers.cc",
"registers.h",
"server.cc",
"server.h",
"thread.cc",
"thread.h",
]
if (current_cpu == "x64") {
sources += [
"arch_x64.cc",
"arch_x64.h",
"breakpoint_x64.cc",
"registers_x64.cc",
]
} else if (current_cpu == "arm64") {
sources += [
"arch_arm64.cc",
"breakpoint_arm64.cc",
"registers_arm64.cc",
]
}
deps = [
"//garnet/lib/debugger_utils",
"//garnet/public/lib/fsl",
"//src/lib/files",
"//src/lib/fxl",
"//zircon/public/lib/zx",
]
public_deps = [
"//garnet/lib/process",
"//zircon/public/lib/async-loop-cpp",
"//zircon/public/lib/fit",
]
include_dirs = [ ".." ]
}
executable("tests") {
testonly = true
output_name = "inferior_control_tests"
sources = [
"io_loop_unittest.cc",
"process_unittest.cc",
"test_helper.h",
"test_server.cc",
"test_server.h",
"thread_unittest.cc",
]
deps = [
":inferior_control",
"//garnet/lib/debugger_utils",
"//garnet/public/lib/fsl",
"//sdk/lib/sys/cpp",
"//src/lib/fxl",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gtest",
]
}
executable("test_helper") {
testonly = true
output_name = "inferior_control_test_helper"
sources = [
"test_helper.cc",
"test_helper.h",
]
deps = [
"//garnet/lib/debugger_utils",
]
libs = [ "zircon" ]
}
executable("run-inferior") {
testonly = true
output_name = "run-inferior"
sources = [
"run_inferior.cc",
]
deps = [
":inferior_control",
"//garnet/lib/debugger_utils",
"//src/lib/fxl",
]
libs = [ "zircon" ]
}
test_package("inferior_control_tests") {
deps = [
":run-inferior",
":test_helper",
":tests",
]
binaries = [
{
name = "inferior_control_test_helper"
dest = "test_helper"
},
{
name = "run-inferior"
shell = true
},
]
tests = [
{
name = "inferior_control_tests"
environments = basic_envs
},
]
meta = [
{
path = rebase_path("meta/run-inferior.cmx")
dest = "run-inferior.cmx"
},
]
}