blob: 41454d07d645726eb9f69972851ae31210af74ad [file] [log] [blame]
# Copyright 2020 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/copy_tree.gni")
import("//build/host.gni")
import("//build/sdk/sdk_host_tool.gni")
import("//build/test.gni")
import("//build/testing/environments.gni")
import("//build/testing/host_test_data.gni")
if (is_host) {
source_set("src") {
sources = [
"command_line_options.cc",
"log_parser.cc",
"symbolizer_impl.cc",
]
public_deps = [
"//src/developer/debug/zxdb/client",
"//src/developer/debug/zxdb/console",
"//src/developer/debug/zxdb/symbols",
"//src/lib/analytics/cpp/core_dev_tools",
"//src/lib/fxl",
"//third_party/rapidjson",
"//zircon/system/ulib/cmdline",
]
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
executable("symbolizer") {
sources = [ "main.cc" ]
deps = [
":src",
"//src/lib/fxl",
]
}
sdk_host_tool("sdk") {
category = "partner"
deps = [ ":symbolizer" ]
output_name = "symbolizer"
}
test("symbolizer_tests") {
sources = [
"command_line_options_test.cc",
"log_parser_test.cc",
"symbolizer_impl_test.cc",
]
deps = [
":src",
"//src/lib/files",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
host_test_data("e2e_test_cases") {
sources = [
"test_cases/cpp_crasher_klog.in",
"test_cases/cpp_crasher_klog.out",
"test_cases/cpp_crasher_syslog.in",
"test_cases/cpp_crasher_syslog.out",
"test_cases/kernel_panic.in",
"test_cases/kernel_panic.out",
"test_cases/kernel_panic_x64.in",
"test_cases/kernel_panic_x64.out",
"test_cases/multithread.in",
"test_cases/multithread.out",
"test_cases/rust_crasher_stdout.in",
"test_cases/rust_crasher_stdout.out",
"test_cases/rust_crasher_syslog.in",
"test_cases/rust_crasher_syslog.out",
"test_cases/userboot.in",
"test_cases/userboot.out",
]
outputs =
[ "$root_out_dir/test_data/symbolizer/test_cases/{{source_file_part}}" ]
}
# Manually copy the symbol directory since host_test_data does not support
# copying directory any more (fxbug.dev/73250). It's not a big issue for us
# since the symbol directory seldom changes, and when it changes, we usually
# only add new files to it which will change the directory's mtime.
e2e_test_symbols_out_dir = "$root_out_dir/test_data/symbolizer/symbols"
copy_tree("e2e_test_symbols_copy") {
src_dir = "//prebuilt/test_data/symbolizer/symbols"
dest_dir = e2e_test_symbols_out_dir
}
# Make the copied directory available at test runtime.
host_test_data("e2e_test_symbols") {
sources = [ e2e_test_symbols_out_dir ]
deps = [ ":e2e_test_symbols_copy" ]
}
test("symbolizer_e2e_tests") {
sources = [ "e2e_test.cc" ]
deps = [
":e2e_test_cases",
":e2e_test_symbols",
":src",
"//third_party/googletest:gtest",
]
environments = [
{
dimensions = host_env.dimensions
tags = [ "symbolizer-e2e" ]
},
]
}
}
group("tests") {
testonly = true
deps = [ ":symbolizer_tests($host_toolchain)" ]
}
group("e2e_tests") {
testonly = true
deps = [ ":symbolizer_e2e_tests($host_toolchain)" ]
}