| # Copyright 2018 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") | |
| declare_args() { | |
| # Normally these tests are not built and run because they require large | |
| # amounts of optional data be downloaded. Set this to true to enable the build | |
| # for the zxdb_large_tests. See symbols/test_data/README.md for how to | |
| # download the data required for this test. | |
| include_zxdb_large_tests = false | |
| } | |
| import("//build/test.gni") | |
| # ZXDB currently only compiles for the host. | |
| if (is_host) { | |
| executable("zxdb") { | |
| sources = [ "main.cc" ] | |
| deps = [ | |
| "//src/developer/debug/ipc", | |
| "//src/developer/debug/zxdb/client", | |
| "//src/developer/debug/zxdb/console", | |
| "//src/developer/debug/zxdb/debug_adapter", | |
| ] | |
| if (is_linux && current_cpu == "x64") { | |
| # Support the local built-in debug agent on Linux. | |
| sources += [ | |
| "local_agent.cc", | |
| "local_agent.h", | |
| ] | |
| deps += [ "//src/developer/debug/debug_agent:lib" ] | |
| } | |
| } | |
| sdk_host_tool("zxdb_sdk") { | |
| category = "partner" | |
| output_name = "zxdb" | |
| deps = [ ":zxdb" ] | |
| } | |
| install_host_tools("zxdb_host_tool") { | |
| deps = [ ":zxdb" ] | |
| outputs = [ "zxdb" ] | |
| } | |
| test("zxdb_tests") { | |
| deps = [ | |
| "//src/developer/debug/ipc:tests", | |
| "//src/developer/debug/shared:tests", | |
| "//src/developer/debug/zxdb/client:tests", | |
| "//src/developer/debug/zxdb/common:tests", | |
| "//src/developer/debug/zxdb/console:tests", | |
| "//src/developer/debug/zxdb/debug_adapter:tests", | |
| "//src/developer/debug/zxdb/expr:tests", | |
| "//src/developer/debug/zxdb/format:tests", | |
| "//src/developer/debug/zxdb/symbols:tests", | |
| "//src/lib/fxl/test:gtest_main", | |
| ] | |
| } | |
| if (include_zxdb_large_tests) { | |
| # See symbols/test_data/README.md for how to download the data required for | |
| # this test. | |
| test("zxdb_large_tests") { | |
| sources = [ | |
| "symbols/index_largetest.cc", | |
| "symbols/module_symbols_impl_largetest.cc", | |
| ] | |
| deps = [ | |
| ":copy_large_test_data", | |
| "//src/developer/debug/zxdb/symbols:test_support", | |
| "//src/lib/fxl/test:gtest_main", | |
| "//third_party/googletest:gtest", | |
| ] | |
| } | |
| copy("copy_large_test_data") { | |
| # Each file must be individually listed here. | |
| sources = [ | |
| "//prebuilt/test_data/debug/large_test_data/debug_agent", | |
| "//prebuilt/test_data/debug/large_test_data/flutter_runner_tests", | |
| ] | |
| outputs = [ | |
| "$root_out_dir/test_data/zxdb/large_test_data/{{source_file_part}}", | |
| ] | |
| } | |
| } | |
| } | |
| group("zxdb_host") { | |
| deps = [ ":zxdb($host_toolchain)" ] | |
| } | |
| # This group of tests is run in CQ/CI. | |
| # [It is referenced by ../BUILD.gn's "tests".] | |
| group("tests") { | |
| testonly = true | |
| deps = [ | |
| ":zxdb_tests($host_toolchain)", | |
| "//src/developer/debug/zxdb/expr:expr_parser_fuzzer($host_toolchain)", | |
| ] | |
| if (include_zxdb_large_tests) { | |
| deps += [ ":zxdb_large_tests($host_toolchain)" ] | |
| } | |
| } | |
| # Utility rule to build all zxdb tests. | |
| group("all_tests") { | |
| testonly = true | |
| deps = [ ":tests" ] | |
| } |