| # Copyright 2023 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/library_headers.gni") |
| |
| group("testing") { |
| testonly = true |
| public_deps = [ ":ld-testing" ] |
| } |
| |
| library_headers("headers") { |
| testonly = true |
| |
| headers = [ |
| "lib/ld/testing/interp.h", |
| "lib/ld/testing/test-elf-object.h", |
| ] |
| public_deps = [ |
| ":abi-headers", |
| "//src/lib/elfldltl:headers", |
| "//src/lib/elfldltl/testing:headers", |
| ] |
| if (is_fuchsia) { |
| headers += [ |
| "lib/ld/testing/get-test-vmo.h", |
| "lib/ld/testing/mock-debugdata.h", |
| "lib/ld/testing/mock-loader-service.h", |
| "lib/ld/testing/test-processargs.h", |
| "lib/ld/testing/vdso.h", |
| ] |
| public_deps += [ |
| "//sdk/fidl/fuchsia.debugdata:fuchsia.debugdata_cpp", |
| "//sdk/fidl/fuchsia.ldsvc:fuchsia.ldsvc_cpp", |
| "//sdk/lib/async-loop:async-loop-cpp", |
| "//sdk/lib/async-loop:async-loop-default", |
| "//third_party/googletest:gmock", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| } |
| |
| static_library("ld-testing") { |
| testonly = true |
| |
| public_deps = [ |
| ":headers", |
| ":ld-abi-testing", |
| ] |
| |
| sources = [ |
| "interp.cc", |
| "test-elf-object.cc", |
| ] |
| deps = [ "//src/lib/elfldltl/testing" ] |
| if (is_fuchsia) { |
| sources += [ |
| "get-test-vmo.cc", |
| "mock-debugdata.cc", |
| "mock-loader-service.cc", |
| "test-processargs.cc", |
| "vdso.cc", |
| ] |
| deps += [ |
| "//sdk/lib/async", |
| "//sdk/lib/async:async-cpp", |
| "//sdk/lib/async-loop", |
| "//sdk/lib/async-loop:async-loop-cpp", |
| "//sdk/lib/async-loop:async-loop-default", |
| "//sdk/lib/fdio", |
| "//src/lib/elfldltl/testing", |
| "//src/storage/lib/vfs/cpp", |
| "//third_party/googletest:gtest", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| } |
| |
| # This is implicit in :headers and :ld-testing, but it's separate for use in |
| # contexts that don't want all the rest of the deps :ld-testing brings in. |
| library_headers("abi-headers") { |
| testonly = true |
| headers = [ "lib/ld/testing/startup-ld-abi.h" ] |
| public_deps = [ "..:abi-headers" ] |
| } |
| |
| static_library("ld-abi-testing") { |
| testonly = true |
| |
| public_deps = [ ":abi-headers" ] |
| |
| sources = [ "startup-ld-abi.cc" ] |
| deps = [ "..:headers" ] |
| } |