blob: ea1950d1d51224f2e81361ed93d3de16c0adc4c5 [file] [log] [blame]
# Copyright 2020 The Fuchsia Authors
#
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT
if (is_kernel) {
source_set("kernel-tests") {
# TODO(https://fxbug.dev/42145882): testonly = true
sources = [ "kernel-tests.cc" ]
deps = [
"//zircon/kernel/lib/boot-options",
"//zircon/kernel/lib/ktl",
"//zircon/kernel/lib/unittest",
"//zircon/system/ulib/fbl",
]
}
group("phys-tests") {
testonly = true
deps = [ ":kernel-tests" ]
}
} else {
import("//build/components.gni")
import("//build/cpp/cpp_fuzzer.gni")
import("//build/dist/resource.gni")
import("//build/fuzz.gni")
import("//build/test.gni")
group("tests") {
testonly = true
deps = [
":boot-options-fuzzers",
":boot-options-tests",
":boot-options-unittests($host_toolchain)",
]
}
test("boot-options-unittests") {
sources = [ "user-tests.cc" ]
deps = [
"//sdk/lib/fit",
"//zircon/kernel/lib/boot-options",
"//zircon/system/ulib/zxtest",
]
}
fuchsia_unittest_package("boot-options-tests") {
deps = [ ":boot-options-unittests" ]
manifest = "meta/boot-options-tests.cml"
}
fuchsia_fuzzer_component("boot-options-basic-fuzzer-component") {
manifest = "meta/boot-options-basic-fuzzer.cml"
deps = [
":boot-options-basic-fuzzer",
".:boot-options-basic-fuzzer-dictionary",
]
}
if (is_fuchsia) {
fuchsia_fuzzer_package("boot-options-fuzzers") {
cpp_fuzzer_components = [ ":boot-options-basic-fuzzer-component" ]
}
} else {
group("boot-options-fuzzers") {
testonly = true
deps = [ ":boot-options-basic-fuzzer" ]
}
}
resource("boot-options-basic-fuzzer-dictionary") {
sources = [ "fuzzer-dictionary.txt" ]
outputs = [ "data/{{source_file_part}}" ]
}
cpp_fuzzer("boot-options-basic-fuzzer") {
sources = [ "fuzzer.cc" ]
deps = [ "//zircon/kernel/lib/boot-options" ]
}
}