| # Copyright 2019 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/go/go_library.gni") |
| import("//build/go/go_test.gni") |
| import("//build/testing/host_test_data.gni") |
| |
| go_library("elflib") { |
| sources = [ |
| "elflib.go", |
| "elflib_test.go", |
| "pe.go", |
| "pe_test.go", |
| "sources.go", |
| "sources_test.go", |
| ] |
| } |
| |
| if (is_host) { |
| _testdata_path = "$target_gen_dir/testdata" |
| |
| go_test("elflib_tests") { |
| gopackages = [ "go.fuchsia.dev/fuchsia/tools/debug/elflib" ] |
| args = [ |
| "--test_data_dir", |
| rebase_path(_testdata_path, root_build_dir), |
| ] |
| deps = [ ":elflib" ] |
| non_go_deps = [ ":testdata" ] |
| } |
| |
| host_test_data("testdata") { |
| sources = [ |
| "testdata/cycle.elf", |
| "testdata/libc.elf.section-only", |
| "testdata/libc.elf.stripped", |
| "testdata/libc.yaml", |
| "testdata/libc.yaml.section-only", |
| "testdata/pe-x64.efi", |
| "testdata/pe-x64.yaml", |
| ] |
| outputs = [ "${_testdata_path}/{{source_file_part}}" ] |
| } |
| } |