| # 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/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", |
| ] |
| } |
| |
| 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", |
| ] |
| } |
| |
| 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. |
| action("copy_e2e_test_symbols") { |
| hermetic_deps = false |
| script = "//build/copy_tree.py" |
| inputs = [ "//prebuilt/test_data/symbolizer/symbols" ] |
| outputs = [ |
| "$root_out_dir/test_data/symbolizer/symbols", |
| "$root_out_dir/test_data/symbolizer/symbols.stamp", |
| ] |
| args = rebase_path(inputs + outputs) |
| metadata = { |
| test_runtime_deps = outputs |
| } |
| } |
| |
| test("symbolizer_e2e_tests") { |
| sources = [ "e2e_test.cc" ] |
| deps = [ |
| ":copy_e2e_test_symbols", |
| ":e2e_test_cases", |
| ":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)" ] |
| } |