blob: b9659f1213676fabc3dd5b962557ca33d5e074e5 [file] [edit]
# Copyright 2021 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.
import("//build/components.gni")
group("android") {
deps = [ ":android_system_image" ]
}
group("tests") {
testonly = true
if (target_cpu == "x64") {
deps = [ ":test_android_distro" ]
}
}
resource("android_system_image") {
sources = [ "//prebuilt/starnix/android-image-amd64/system.img" ]
outputs = [ "data/system.img" ]
}
fuchsia_component("init") {
manifest = "meta/init.cml"
}
fuchsia_component("sh") {
manifest = "meta/sh.cml"
}
fuchsia_component("sh_test") {
testonly = true
check_references = false
deps = [ ":android_system_image" ]
manifest = "meta/sh_test.cml"
}
fuchsia_component("boringssl_self_test64") {
testonly = true
check_references = false
deps = [ ":android_system_image" ]
manifest = "meta/boringssl_self_test64.cml"
}
resource("starnix_data_tmp_placeholder") {
sources = [ "placeholder" ]
outputs = [ "data/tmp/.placeholder" ]
}
template("starnix_test_component") {
test_name = target_name
resource("${test_name}_bin") {
sources = [ "//prebuilt/starnix/tests/syscalls/linux-amd64/${invoker.test_dir}/${test_name}" ]
outputs = [ "data/tests/${test_name}" ]
}
fuchsia_component(test_name) {
forward_variables_from(invoker, "*")
testonly = true
check_references = false
manifest = "meta/${test_name}.cml"
deps = [
":${test_name}_bin",
":android_system_image",
]
}
}
template("gvisor_test_component") {
# Without this gn gives an error: `You set the variable "invoker" here and it was unused before it
# went out of scope.`
not_needed([ "invoker" ])
test_dir = "linux"
starnix_test_component(target_name) {
}
}
template("wayland_test_component") {
# Without this gn gives an error: `You set the variable "invoker" here and it was unused before it
# went out of scope.`
not_needed([ "invoker" ])
test_dir = "wayland"
starnix_test_component(target_name) {
}
}
# Commented out tests exist as binaries in the tree but are not run (yet!).
gvisor_tests = [
# "accept_bind_stream_test",
# "accept_bind_test",
"access_test",
"bind_test",
"brk_test",
"chdir_test",
"chmod_test",
# "chown_test",
# "chroot_test",
"clock_getres_test",
"clock_gettime_test",
"creat_test",
"dev_test",
"dup_test",
"epoll_test",
"eventfd_test",
# "exec_binary_test",
# "exec_test",
"exit_test",
"fchdir_test",
# "flock_test",
"fork_test",
"getdents_test",
"getrandom_test",
# "getrusage_test",
# "ioctl_test",
"kill_test",
"link_test",
"lseek_test",
# "memfd_test",
"mkdir_test",
"mknod_test",
"mmap_test",
# "mremap_test",
"munmap_test",
"open_create_test",
"open_test",
"pipe_test",
# "poll_test",
# "ppoll_test",
# "prctl_test",
"pread64_test",
# "proc_test",
# "pselect_test",
# "pty_root_test",
# "pty_test",
"pwrite64_test",
"read_test",
"readv_socket_test",
"readv_test",
"rename_test",
# "rtsignal_test",
# "sched_test",
# "select_test",
"sigaction_test",
"sigprocmask_test",
"sigaltstack_test",
# "sigstop_test",
# "socket_abstract_test",
"socket_test",
# "socket_unix_stream_test",
"stat_test",
# "statfs_test",
"symlink_test",
# "tgkill_test",
# "time_test",
"timerfd_test",
"uidgid_test",
"unlink_test",
"wait_test",
]
foreach(test_name, gvisor_tests) {
gvisor_test_component(test_name) {
}
}
wayland_tests = [
"array-test",
# "client-test",
# "compositor-introspection-test",
# "connection-test",
# "display-test",
# "event-loop-test",
"fixed-test",
"headers-protocol-core-test",
"headers-protocol-test",
"interface-test",
"list-test",
"map-test",
"message-test",
"newsignal-test",
"os-wrappers-test",
# Disabled because it spawns a subprocess that page faults, which should have been a failure but wasn't when the test was added
# "protocol-logger-test",
# "queue-test",
# "resources-test",
# "sanity-test",
"signal-test",
# "socket-test",
# "wayland_demo",
]
foreach(test_name, wayland_tests) {
wayland_test_component(test_name) {
}
}
fuchsia_test_package("test_android_distro") {
deps = [
":android_system_image",
":init",
":sh",
":starnix_data_tmp_placeholder",
]
test_components = [
":boringssl_self_test64",
":sh_test",
]
foreach(test_name, gvisor_tests) {
test_components += [ ":${test_name}" ]
}
foreach(test_name, wayland_tests) {
test_components += [ ":${test_name}" ]
}
# This package intentionally contains many non-Fuchia ELF binaries that
# are not under /data/, and some of them are even unstripped, so disable
# theses checks to build successfully.
disable_elf_binaries_checks = true
}