| # 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("//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 = [ ":*" ] |
| |
| # TODO(https://fxbug.dev/42145882): testonly = true |
| testonly = toolchain_environment != "kernel" |
| |
| 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") { |
| # TODO(https://fxbug.dev/42145882): testonly = true |
| testonly = toolchain_environment != "kernel" |
| 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") { |
| # TODO(https://fxbug.dev/42145882): testonly = true |
| cflags = [ "-fno-builtin" ] |
| sources = [ |
| "abi_type_validator.cc", |
| "alloc_checker_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", |
| "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", |
| "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 = [ |
| ":common", |
| "//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/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" ] |
| } |
| } |