blob: 02b47702780493d622c56c70442ba7bd8d4ef8ae [file] [log] [blame]
# Copyright 2024 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/assembly/test_product_bundle.gni")
import("//build/components.gni")
import("//build/rust/rustc_binary.gni")
import("//build/testing/symbols_dir_test_data.gni")
import("//src/developer/ffx/lib/e2e_emu/ffx_e2e_test.gni")
assert(
has_board,
"This file must only be included in build configurations that have a board.")
if (is_host) {
ffx_e2e_test("ffx_symbolize_lib_e2e_test") {
edition = "2024"
source_root = "e2e_test.rs"
sources = [ source_root ]
deps = [
"//src/developer/ffx/config:lib",
"//src/developer/ffx/lib/e2e_emu",
"//src/developer/ffx/lib/symbolize",
"//src/developer/ffx/lib/symbolize/test-utils:symbolize_test_utils",
"//src/lib/diagnostics/log/rust_cpp_bridge",
"//src/lib/fuchsia",
"//third_party/rust_crates:log",
"//third_party/rust_crates:serde_json",
]
product_bundle = ":product_bundle($default_toolchain)"
}
group("host_tests") {
testonly = true
deps = [ ":ffx_symbolize_lib_e2e_test" ]
}
} else if (is_fuchsia) {
# A helper library that defines a memory area not covered by any symbol.
shared_library("no_symbol_area") {
sources = [ "no_symbol_area.c" ]
}
rustc_binary("print_fn_ptr_bin") {
edition = "2024"
source_root = "print_fn_ptr.rs"
sources = [ source_root ]
deps = [
":no_symbol_area",
"//sdk/rust/zx",
"//src/developer/ffx/lib/symbolize/test-utils:symbolize_test_utils",
"//third_party/rust_crates:libc",
"//third_party/rust_crates:serde_json",
]
}
fuchsia_component("print_fn_ptr") {
testonly = true
manifest = "meta/print_fn_ptr.cml"
deps = [ ":print_fn_ptr_bin($target_toolchain)" ]
}
fuchsia_package("package") {
testonly = true
package_name = "print_fn_ptr"
deps = [ ":print_fn_ptr" ]
}
# Don't let the assembly templates expand except on the default toolchain. Weirndess ensures if
# they're expanded on variant toolchains like for asan.
if (current_toolchain == default_toolchain) {
if (target_cpu == "arm64") {
_board_config_label = "//boards/arm64"
} else if (target_cpu == "x64") {
_board_config_label = "//boards/x64"
}
test_product_bundle("product_bundle") {
name = "ffx-symbolize-test"
board_config = _board_config_label
platform = {
build_type = "eng"
}
base_packages = [
{
package_target = ":package"
},
]
}
}
}