blob: 1b73397a9d0f6fd79577a579a668fd62c84efd9c [file] [log] [blame]
# Copyright 2019 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.
# Each subdirectory just provides an eponymous source_set().
core_tests = [
"bad-syscall",
"c11-condvar",
"c11-mutex",
"c11-thread",
"channel",
"clock",
"elf-tls",
"event-pair",
"fifo",
"futex",
"handle-close",
"handle-info",
"handle-transfer",
"handle-wait",
"job",
"memory-mapping",
"object-child",
"object-info",
"pager",
"port",
"process",
"pthread",
"pthread-barrier",
"pthread-tls",
"socket",
"stack",
"sync-completion",
"sync-condition",
"sync-mutex",
"threads",
"time",
"vmar",
"vmo",
]
# These tests need get_root_resource(), which is only available in the
# unified core-tests binary.
unified_only = [
"bti",
"interrupt",
"profile",
"resource",
"system-event",
]
group("core") {
testonly = true
# Note this doesn't include ":core-tests" because the standalone binary
# only works when run directly from userboot and so is never useful to
# have in a normal boot image full of tests to run. Instead, it's
# included directly in a standalone core-tests ZBI.
deps = []
foreach(test, core_tests) {
deps += [ ":$test" ] # And alone.
}
}
# First, build all of those into the standalone core-tests binary. This
# can be run directly from userboot with nothing else on the system.
# It's not a test() so that it won't be run by `runtests`, since that
# runs all the individual test() binaries created below.
executable("core-tests") {
testonly = true
deps = core_tests + unified_only
sources = [
"main.c",
]
deps += [
"$zx/system/ulib/unittest",
"$zx/system/ulib/zircon",
"$zx/system/ulib/zxtest",
]
}
# Next, build each into its own standalone test binary.
foreach(test_name, core_tests) {
test(test_name) {
test_group = "core"
deps = [
test_name,
]
}
}