blob: bbdf0db5a44c614687e966abadea71db25279f49 [file] [log] [blame]
# Copyright 2019 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
import("//build/cpp/library_headers.gni")
import("//build/toolchain/toolchain_environment.gni")
library_headers("headers") {
headers = [
"lib/unittest/unittest.h",
"lib/unittest/user_memory.h",
]
public_deps = [
# <lib/unittest/unittest.h> has #include <lib/special-sections/special-sections.h>.
"//zircon/kernel/lib/special-sections:headers",
]
if (toolchain_environment == "kernel") {
public_deps += [
# <lib/unittest/user_memory.h> has #include <lib/crypto/prng.h>.
"//zircon/kernel/vm:headers",
# <lib/unittest/user_memory.h> has #include <lib/instrumentation/asan.h>.
"//zircon/kernel/lib/instrumentation:headers",
# <lib/unittest/user_memory.h> has #include <ktl/utility.h>.
"//zircon/kernel/lib/ktl:headers",
]
}
}
source_set("unittest") {
public_deps = [ ":headers" ]
sources = [ "unittest.cc" ]
deps = [ "//zircon/system/ulib/pretty" ]
if (toolchain_environment == "kernel") {
sources += [
"console.cc",
"user_memory.cc",
"user_memory_tests.cc",
]
deps += [ "//zircon/kernel/lib/console" ]
} else {
sources += [ "phys.cc" ]
deps += [
"//zircon/kernel/lib/ktl",
"//zircon/kernel/lib/libc",
]
}
}
group("tests") {
testonly = true
}
group("kernel-tests") {
# TODO: testonly = true
}
group("phys-tests") {
testonly = true
}
group("boot_tests") {
testonly = true
}