| # Copyright 2025 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/bazel/bazel_test_suite.gni") | |
| bazel_test_suite("bazel_tests") { | |
| target_tests = | |
| [ "//src/starnix/kernel/syscall_loop:starnix_syscall_loop_tests" ] | |
| } | |
| group("tests") { | |
| testonly = true | |
| deps = [ ":starnix_syscall_loop_tests-package" ] | |
| # TODO(https://fxbug.dev/42059075): Re-enable starnix in these environments. | |
| # The GN copy's test binary is excluded from asan/hwasan variants with | |
| # exclude_toolchain_tags, which Bazel ignores. | |
| if (!is_asan) { | |
| deps += [ ":bazel_tests" ] | |
| } | |
| } | |
| ## BAZEL2GN SENTINEL - DO NOT EDIT BELOW THIS LINE ## | |
| # | |
| # ________ _________ ________ ________ | |
| # |\ ____\|\___ ___\\ __ \|\ __ \ | |
| # \ \ \___|\|___ \ \_\ \ \|\ \ \ \|\ \ | |
| # \ \_____ \ \ \ \ \ \ \\\ \ \ ____\ | |
| # \|____|\ \ \ \ \ \ \ \\\ \ \ \___| | |
| # ____\_\ \ \ \__\ \ \_______\ \__\ | |
| # |\_________\ \|__| \|_______|\|__| | |
| # \|_________| | |
| # | |
| # | |
| # AUTO-GENERATED - DO NOT EDIT | |
| # | |
| # The targets below are auto-generated based on the targets defined in the | |
| # BUILD.bazel file from the same directory. If you made changes to targets in | |
| # Bazel, instead of editing this file manually, run: | |
| # | |
| # > fx bazel2gn | |
| # | |
| # Please do NOT edit this file directly. Instead, edit the BUILD.bazel file and | |
| # rerun bazel2gn. | |
| import("//build/tools/bazel2gn/bazel_migration.gni") | |
| static_library("restricted_trampoline") { | |
| if (current_cpu == "arm64") { | |
| sources = [ "src/trampoline_arm64.S" ] | |
| } else if (current_cpu == "riscv64") { | |
| sources = [ "src/trampoline_riscv64.S" ] | |
| } else if (current_cpu == "x64") { | |
| sources = [ "src/trampoline_x64.S" ] | |
| } | |
| deps = [ "//src/starnix/lib/asm_utils" ] | |
| } | |
| static_library("module_changes_breakpoint") { | |
| if (current_cpu == "arm64") { | |
| sources = [ "src/breakpoint_arm64.S" ] | |
| } else if (current_cpu == "riscv64") { | |
| sources = [ "src/breakpoint_riscv64.S" ] | |
| } else if (current_cpu == "x64") { | |
| sources = [ "src/breakpoint_x64.S" ] | |
| } | |
| deps = [ "//src/starnix/lib/asm_utils" ] | |
| visibility = [ | |
| ":*", | |
| "//src/starnix/kernel/core:*", | |
| ] | |
| } | |
| rustc_library("starnix_syscall_loop") { | |
| sources = [ | |
| "src/lib.rs", | |
| "src/table.rs", | |
| ] | |
| edition = "2024" | |
| link_deps = [ | |
| ":module_changes_breakpoint", | |
| ":restricted_trampoline", | |
| ] | |
| lint_config = "//src/starnix/build:kernel_library_config" | |
| proc_macro_deps = [ "//third_party/rust_crates:paste" ] | |
| visibility = [ | |
| ":*", | |
| "//src/starnix/kernel/runner:*", | |
| ] | |
| deps = [ | |
| "//sdk/rust/zx", | |
| "//src/lib/debug/rust", | |
| "//src/lib/trace/rust:trace", | |
| "//src/starnix/kernel/core", | |
| "//src/starnix/lib/extended_pstate:lib", | |
| "//src/starnix/lib/starnix_logging", | |
| "//src/starnix/lib/starnix_registers", | |
| "//src/starnix/lib/starnix_syscalls", | |
| "//src/starnix/lib/starnix_uapi", | |
| "//src/starnix/modules/inotify", | |
| "//src/starnix/modules/iouring", | |
| "//src/starnix/modules/syscalls", | |
| "//src/starnix/modules/userfaultfd", | |
| "//third_party/rust_crates:anyhow", | |
| "//third_party/rust_crates:zerocopy", | |
| ] | |
| } | |
| rustc_test("starnix_syscall_loop_test") { | |
| sources = [ | |
| "src/lib.rs", | |
| "src/table.rs", | |
| ] | |
| edition = "2024" | |
| link_deps = [ | |
| ":module_changes_breakpoint", | |
| ":restricted_trampoline", | |
| ] | |
| proc_macro_deps = [ "//third_party/rust_crates:paste" ] | |
| deps = [ | |
| "//sdk/rust/zx", | |
| "//src/lib/debug/rust", | |
| "//src/lib/trace/rust:trace", | |
| "//src/starnix/kernel/core", | |
| "//src/starnix/lib/extended_pstate:lib", | |
| "//src/starnix/lib/starnix_logging", | |
| "//src/starnix/lib/starnix_registers", | |
| "//src/starnix/lib/starnix_syscalls", | |
| "//src/starnix/lib/starnix_uapi", | |
| "//src/starnix/modules/inotify", | |
| "//src/starnix/modules/iouring", | |
| "//src/starnix/modules/syscalls", | |
| "//src/starnix/modules/userfaultfd", | |
| "//third_party/rust_crates:anyhow", | |
| "//third_party/rust_crates:zerocopy", | |
| ] | |
| output_name = "starnix_syscall_loop_lib_test" | |
| lint_config = "//src/starnix/build:kernel_library_config" | |
| exclude_toolchain_tags = [ | |
| "asan", | |
| "hwasan", | |
| ] | |
| } | |
| fuchsia_component_manifest("starnix_syscall_loop_tests-manifest") { | |
| testonly = true | |
| component_name = "starnix_syscall_loop_tests" | |
| manifest = "meta/starnix_syscall_loop_tests.cml" | |
| } | |
| fuchsia_test_component("starnix_syscall_loop_tests-component") { | |
| cm_label = ":starnix_syscall_loop_tests-manifest" | |
| test_type = "starnix" | |
| deps = [ | |
| ":starnix_syscall_loop_test", | |
| "//src/starnix/kernel/vdso", | |
| ] | |
| } | |
| fuchsia_test_package("starnix_syscall_loop_tests-package") { | |
| package_name = "starnix_syscall_loop_tests-gn" | |
| test_components = [ ":starnix_syscall_loop_tests-component" ] | |
| } |