blob: c8218158a828b6fc83d8fcc4b21bb3d4cc157313 [file] [edit]
# 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/zircon/migrated_targets.gni")
import("//build/zircon/zircon_cpu.gni")
import("//zircon/kernel/kernel_rust_mod.gni")
import("//zircon/kernel/params.gni")
# See //zircon/kernel/lib/BUILD.gn for the various *tests target names and uses.
# Each of those is provided here and in //zircon/kernel itself as well.
group("tests") {
testonly = true
}
group("phys-tests") {
testonly = true
deps = [
":common",
"//zircon/kernel/lib:phys-tests",
]
}
group("boot_tests") {
testonly = true
}
# This is the subset that's compatible with the kernel.phys environment.
source_set("common") {
visibility = [ ":*" ]
testonly = true
cflags = [ "-fno-builtin" ]
sources = [
"multi_file_tests.cc",
"popcount.cc",
"printf_tests.cc",
"relocation_tests.cc",
"string_file_tests.cc",
"string_view_tests.cc",
"unittest_tests.cc",
]
deps = [
":zbitl",
"//zircon/kernel/lib/ktl",
"//zircon/kernel/lib/libc",
"//zircon/kernel/lib/unittest",
"//zircon/system/ulib/fbl",
]
if (toolchain_environment == "kernel") {
deps += [ "//zircon/kernel/lib/console" ]
}
}
source_set("zbitl") {
testonly = true
sources = [ "zbitl_tests.cc" ]
deps = [
"//src/lib/zbitl",
"//zircon/kernel/lib/ktl",
"//zircon/kernel/lib/libc",
"//zircon/kernel/lib/unittest",
]
if (toolchain_environment == "kernel") {
deps += [ "//zircon/kernel/lib/console" ]
}
}
if (toolchain_environment == "kernel") {
# These are only for the kernel proper.
source_set("kernel-tests") {
testonly = true
cflags = [ "-fno-builtin" ]
sources = [
"abi_type_validator.cc",
"alloc_checker_tests.cc",
"arch_rs_tests.cc",
"benchmarks.cc",
"brwlock_tests.cc",
"cache_tests.cc",
"clock_tests.cc",
"cpu_search_tests.cc",
"cpu_tests.cc",
"dpc_tests.cc",
"event_tests.cc",
"fibo.cc",
"heap_tests.cc",
"interrupt_disable_tests.cc",
"job_tests.cc",
"kstack_tests.cc",
"ksync_tests.cc",
"lazy_owned_wait_queue_tests.cc",
"lock_dep_tests.cc",
"loop_limiter_tests.cc",
"mem_tests.cc",
"mmu_tests.cc",
"mp_hotplug_tests.cc",
"mp_tests.cc",
"mutex_spin_time_tests.cc",
"owned_wait_queue_topology.cc",
"pi_tests.cc",
"port_tests.cc",
"pow2_tests.cc",
"preempt_disable_tests.cc",
"range_check_tests.cc",
"relaxed_atomic_tests.cc",
"relocation_tests.cc",
"resource_tests.cc",
"scheduler_state_tests.cc",
"sleep_tests.cc",
"spinner.cc",
"string_tests.cc",
"sync_ipi_tests.cc",
"tests.cc",
"thread_dispatcher_tests.cc",
"timer_tests.cc",
"uart_tests.cc",
"variant_tests.cc",
"wait_queue_ordering_tests.cc",
]
deps = [
":arch_rs_tests",
":common",
":unused_rust",
"rustlang-support:kernel-tests",
"//src/lib/ksync:ksync_kernel_tests",
"//zircon/kernel/arch/$zircon_cpu:kernel-tests",
"//zircon/kernel/dev:kernel-tests",
"//zircon/kernel/hypervisor:kernel-tests",
"//zircon/kernel/kernel:kernel-tests",
"//zircon/kernel/lib:kernel-tests",
"//zircon/kernel/lib/arch",
"//zircon/kernel/lib/boot-options",
"//zircon/kernel/lib/console",
"//zircon/kernel/lib/crypto",
"//zircon/kernel/lib/debuglog",
"//zircon/kernel/lib/fbl",
"//zircon/kernel/lib/io",
"//zircon/kernel/lib/ktl",
"//zircon/kernel/lib/page",
"//zircon/kernel/lib/root_resource_filter",
"//zircon/kernel/lib/thread-stack",
"//zircon/kernel/lib/unittest",
"//zircon/kernel/object",
"//zircon/kernel/object:kernel-tests",
"//zircon/kernel/platform:kernel-tests",
"//zircon/kernel/vm:kernel-tests",
"//zircon/system/ulib/affine",
"//zircon/system/ulib/pretty",
]
if (!kernel_no_userabi) {
sources += [ "userboot_tests.cc" ]
deps += [ "//zircon/kernel/lib/userabi" ]
}
public_deps = [ "//zircon/system/ulib/zx:headers" ]
}
kernel_rust_mod("unused_rust") {
testonly = true
sources = []
deps = [
"//src/lib/ksync",
"//zircon/kernel/lib/counters:counters-rs",
"//zircon/kernel/lib/debug",
"//zircon/kernel/platform:platform-rs",
]
}
kernel_rust_mod("arch_rs_tests") {
testonly = true
sources = []
}
}