| # 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/components/fuchsia_unittest_package.gni") |
| import("//build/test.gni") |
| |
| is_elf = current_os != "mac" && current_os != "win" |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":dl-tests", |
| ":dl-unittests($host_toolchain)", |
| ] |
| } |
| |
| test("dl-unittests") { |
| visibility = [ ":*" ] |
| |
| sources = [ "dl-tests.cc" ] |
| deps = [ |
| "..:diagnostics", |
| "..:error", |
| "..:stateful-error", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gmock", |
| ] |
| if (is_elf) { |
| sources += [ |
| "dl-impl-tests.cc", |
| "dl-impl-tests.h", |
| "dl-load-tests.cc", |
| "dl-system-tests.cc", |
| "dl-system-tests.h", |
| "dl-tests-base.h", |
| ] |
| deps += [ |
| "..:runtime", |
| "//src/lib/elfldltl/testing", |
| ] |
| |
| # Plumb in the switch to set cflags, such as the libprefix for test files. |
| deps += [ "//sdk/lib/ld/test:load-test-modules-info" ] |
| } |
| } |
| |
| fuchsia_unittest_package("dl-tests") { |
| deps = [ ":dl-unittests" ] |
| manifest = "meta/dl-tests.cml" |
| |
| # By default the packaging step will do checks that try to detect bugs in the |
| # build system by verifying that ELF files in a package match a bunch of |
| # hard-coded assumptions about the old dynamic linker and libc implementation |
| # that don't hold true for the test binaries here. |
| disable_elf_binaries_checks = true |
| } |