| # 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/components.gni") |
| import("//build/dist/resource.gni") |
| import("//build/rust/rustc_library.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":starnix-loop-tests" ] |
| } |
| |
| rustc_library("loop") { |
| name = "starnix-modules-loop" |
| edition = "2024" |
| version = "0.1.0" |
| source_root = "lib.rs" |
| with_unit_tests = true |
| |
| # TODO(https://fxbug.dev/42059075): Re-enable starnix in these environments. |
| exclude_toolchain_tags = [ |
| "asan", |
| "hwasan", |
| ] |
| |
| sources = [ "lib.rs" ] |
| |
| configs += [ "//src/starnix/build:kernel_library_config" ] |
| |
| 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", |
| ] |
| |
| test_deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-fs", |
| ] |
| |
| # LTO OOMs out on RBE default workers, so use bigger workers. |
| 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, "*") |
| } |
| } |
| |
| resource("test_files") { |
| sources = [ |
| "test_data/testfile.txt", |
| "test_data/testfile2.txt", |
| ] |
| outputs = [ "data/{{source_file_part}}" ] |
| } |
| |
| fuchsia_unittest_package("starnix-loop-tests") { |
| manifest = "meta/starnix_loop_tests.cml" |
| deps = [ |
| ":loop_test", |
| ":test_files", |
| ] |
| test_type = "starnix" |
| test_specs = { |
| create_no_exception_channel = true |
| } |
| } |