blob: e7558c6f95ba42aa0bc012892c6daa80cd24632a [file] [log] [blame]
# Copyright 2021 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.gni")
import("//build/cpp/cpp_fuzzer.gni")
import("//build/test.gni")
import("//build/zircon/migrated_targets.gni")
zx_library("elfldltl") {
host = true
kernel = true
static = true
sdk = "source"
sdk_headers = [
"lib/elfldltl/constants.h",
"lib/elfldltl/field.h",
"lib/elfldltl/layout.h",
"lib/elfldltl/note.h",
]
sources = []
public_deps = [ "//sdk/lib/stdcompat" ]
if (is_kernel) {
deps = [
"//zircon/kernel/lib/ktl",
"//zircon/kernel/lib/libc",
]
}
}
test("elfldltl-unittests") {
deps = [ ":unittests" ]
}
# These pure unit tests can be included in a standalone ZBI test binary too.
source_set("unittests") {
sources = [
"field-tests.cc",
"layout-tests.cc",
"note-tests.cc",
]
deps = [
".",
"//sdk/lib/stdcompat",
"//zircon/system/ulib/zxtest",
]
}
fuchsia_unittest_package("elfldltl-tests") {
deps = [ ":elfldltl-unittests" ]
}
cpp_fuzzer("note-fuzzer") {
sources = [ "note-fuzzer.cc" ]
deps = [ "." ]
}
fuzzer_package("elfldltl-fuzzers") {
fuzz_host = true
cpp_fuzzers = [ ":note-fuzzer" ]
}
group("tests") {
testonly = true
deps = [
":elfldltl-fuzzers",
":elfldltl-tests",
":elfldltl-unittests($host_toolchain)",
]
}