| # Copyright 2024 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") | |
| import("//build/components.gni") | |
| import("//build/dist/resource.gni") | |
| bazel_test_suite("bazel_tests") { | |
| target_tests = [ "//src/starnix/modules/loop:starnix-loop-tests" ] | |
| } | |
| group("tests") { | |
| testonly = true | |
| deps = [ ":starnix-loop-tests" ] | |
| # TODO(https://fxbug.dev/42059075): Re-enable starnix in these environments. | |
| if (!is_asan) { | |
| deps += [ ":bazel_tests" ] | |
| } | |
| } | |
| # LINT.IfChange | |
| resource("test_files") { | |
| sources = [ | |
| "test_data/testfile.txt", | |
| "test_data/testfile2.txt", | |
| ] | |
| outputs = [ "data/{{source_file_part}}" ] | |
| } | |
| # LINT.ThenChange(BUILD.bazel) | |
| # GN copy of the Bazel `starnix-loop-tests` package, written by hand because | |
| # bazel2gn does not support `create_no_exception_channel` on `fx_test`. | |
| fuchsia_unittest_package("starnix-loop-tests") { | |
| package_name = "starnix-loop-tests-gn" | |
| component_name = "starnix-loop-tests" | |
| manifest = "meta/starnix_loop_tests.cml" | |
| deps = [ | |
| ":starnix_modules_loop_lib_test", | |
| ":test_files", | |
| ] | |
| test_type = "starnix" | |
| test_specs = { | |
| create_no_exception_channel = true | |
| } | |
| } | |
| ## 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") | |
| rustc_library("loop") { | |
| sources = [ "lib.rs" ] | |
| crate_name = "starnix_modules_loop" | |
| source_root = "lib.rs" | |
| edition = "2024" | |
| lint_config = "//src/starnix/build:kernel_library_config" | |
| visibility = [ | |
| ":*", | |
| "//src/starnix/modules/*", | |
| ] | |
| deps = [ | |
| "//sdk/rust/zx", | |
| "//src/starnix/kernel/core", | |
| "//src/starnix/lib/starnix_ext", | |
| "//src/starnix/lib/starnix_logging", | |
| "//src/starnix/lib/starnix_sync", | |
| "//src/starnix/lib/starnix_syscalls", | |
| "//src/starnix/lib/starnix_types", | |
| "//src/starnix/lib/starnix_uapi", | |
| "//third_party/rust_crates:bitflags", | |
| ] | |
| if (is_lto_variant || optimize == "size_lto" || optimize == "size_thinlto") { | |
| _concurrent_jobs = concurrent_jobs.link_highmem | |
| configs += _concurrent_jobs.configs | |
| forward_variables_from(_concurrent_jobs.vars, "*") | |
| } | |
| } | |
| rustc_test("starnix_modules_loop_lib_test") { | |
| sources = [ "lib.rs" ] | |
| source_root = "lib.rs" | |
| edition = "2024" | |
| deps = [ | |
| "//sdk/rust/zx", | |
| "//src/starnix/kernel/core", | |
| "//src/starnix/lib/starnix_ext", | |
| "//src/starnix/lib/starnix_logging", | |
| "//src/starnix/lib/starnix_sync", | |
| "//src/starnix/lib/starnix_syscalls", | |
| "//src/starnix/lib/starnix_types", | |
| "//src/starnix/lib/starnix_uapi", | |
| "//third_party/rust_crates:bitflags", | |
| ] + | |
| [ | |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", | |
| "//src/lib/fidl/rust/fidl", | |
| "//src/lib/fuchsia", | |
| "//src/lib/fuchsia-fs", | |
| ] | |
| lint_config = "//src/starnix/config:starnix_clippy_lints_test" | |
| exclude_toolchain_tags = [ | |
| "asan", | |
| "hwasan", | |
| ] | |
| } |