blob: 48dd2f8d5a97bcb4d3db5decb731c9cbe44daa0e [file] [log] [blame]
# 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/cpp/sdk_executable.gni")
import("//build/host.gni")
import("//build/package.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")
source_set("e2e_test_headers") {
public = [ "main_e2e_test.h" ]
}
# ZXDB currently only compiles for the host.
if (is_host) {
sdk_executable("zxdb") {
category = "partner"
sources = [ "main_host.cc" ]
deps = [
"//src/developer/debug/ipc:client",
"//src/developer/debug/zxdb/client",
"//src/developer/debug/zxdb/console",
]
}
test("zxdb_e2e_tests") {
sources = [ "main_e2e_test.cc" ]
deps = [
":e2e_test_headers",
"//src/developer/debug/zxdb/console:e2e_tests",
"//src/lib/fxl/test:test_settings",
"//third_party/googletest:gtest",
]
}
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/expr:tests",
"//src/developer/debug/zxdb/symbols:tests",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gtest",
]
}
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}}",
]
}
}
test("zxdb_perftests") {
sources = [ "zxdb_perftests.cc" ]
deps = [
"//src/developer/debug/zxdb/common:perf_test",
"//src/developer/debug/zxdb/symbols:perf_tests",
"//third_party/googletest:gtest",
"//zircon/public/lib/cmdline",
]
}
}
install_host_tools("zxdb_host") {
deps = [ ":zxdb" ]
outputs = [ "zxdb" ]
}
# 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_fuzzers",
]
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",
":zxdb_e2e_tests($host_toolchain)",
":zxdb_perftests($host_toolchain)",
]
}