blob: d1a3151e5174bea82ec1cefb20223cf99dda15fd [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/test.gni")
# A collection of utilities useful to debuggers and similar programs.
static_library("elflib") {
sources = [
"elflib.cc",
]
deps = [
"//zircon/system/public",
]
public_deps = [
"//zircon/public/lib/fbl",
]
}
# An example stripped binary. Originally copied from out/x64/cowsay
copy("copy_example_elf") {
sources = [
"test_data/stripped_example.elf",
"test_data/unstripped_example.elf",
]
outputs = [
"$root_out_dir/test_data/elflib/{{source_file_part}}",
]
metadata = {
test_runtime_deps = [
"$root_out_dir/test_data/elflib/stripped_example.elf",
"$root_out_dir/test_data/elflib/unstripped_example.elf",
]
}
}
# TODO(IN-819): Delete once zxdb_tests is no longer being run out of
# $root_build_dir/host_tests/.
if (current_toolchain == default_toolchain) {
copy("copy_example_elf_deprecated") {
sources = [
"test_data/stripped_example.elf",
"test_data/unstripped_example.elf",
]
outputs = [
"$root_build_dir/host_tests/test_data/elflib/{{source_file_part}}",
]
}
}
test("elflib_tests") {
sources = [
"elflib_unittest.cc",
]
deps = [
":elflib",
"//third_party/googletest:gtest",
"//third_party/googletest:gtest_main",
]
data_deps = [
":copy_example_elf",
":copy_example_elf_deprecated($default_toolchain)",
]
}