blob: a44a31bf683231c6740d0397ff4ffdc8044200f3 [file]
# Copyright 2026 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.
load(
"//build/bazel/rules/components:fx_component.bzl",
"fx_component_manifest",
"fx_test_component",
)
load("//build/bazel/rules/packages:fx_package.bzl", "fx_package")
load(
"//build/bazel/rules/packages:fx_packaged_binary.bzl",
"fx_packaged_binary",
)
load("//build/bazel/rules/rust:rustc_library.bzl", "rustc_library")
load("//build/bazel/rules/rust:rustc_test.bzl", "rustc_test")
load("//build/bazel/rules/testing:fx_test.bzl", "fx_test")
package(default_applicable_licenses = ["//:license"])
rustc_library(
name = "functionfs",
srcs = ["lib.rs"],
crate_name = "starnix_modules_functionfs",
crate_root = "lib.rs",
edition = "2024",
lint_config = "//src/starnix/build:kernel_library_config",
visibility = ["//src/starnix/modules:__pkg__"],
deps = [
"//sdk/fidl/fuchsia.hardware.adb:fuchsia.hardware.adb_rust",
"//sdk/rust/zx",
"//src/lib/diagnostics/inspect/rust:fuchsia-inspect",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/starnix/kernel/core",
"//src/starnix/lib/starnix_logging",
"//src/starnix/lib/starnix_sync",
"//src/starnix/lib/starnix_types",
"//src/starnix/lib/starnix_uapi",
"//third_party/rust_crates/vendor:async-channel",
"//third_party/rust_crates/vendor:futures",
"//third_party/rust_crates/vendor:futures-util",
"//third_party/rust_crates/vendor:zerocopy",
],
)
rustc_test(
name = "functionfs_test",
crate = ":functionfs",
crate_name = "starnix_modules_functionfs_lib_test",
edition = "2024",
lint_config = "//src/starnix/config:starnix_clippy_lints_test",
# TODO(https://fxbug.dev/42059075): Re-enable starnix in these environments.
tags = [
"exclude_toolchain_tags=asan",
"exclude_toolchain_tags=hwasan",
],
deps = [
"//src/lib/diagnostics/testing/diagnostics-assertions/rust:diagnostics-assertions",
"//src/lib/fuchsia",
],
)
fx_packaged_binary(
name = "functionfs_test_packaged_bin",
testonly = True,
binary = ":functionfs_test",
binary_name = "starnix_modules_functionfs_lib_test",
)
fx_component_manifest(
name = "starnix-functionfs-tests-manifest",
testonly = True,
component_name = "starnix-functionfs-tests",
includes = [
"//sdk/lib/inspect:client.shard",
"//sdk/lib/syslog:client.shard",
"//src/sys/test_runners/starnix:unit_test.shard.cml",
],
manifest = "meta/starnix_functionfs_tests.cml",
)
fx_test_component(
name = "starnix-functionfs-tests-component",
compiled_manifest = ":starnix-functionfs-tests-manifest",
test_type = "starnix",
deps = [
":functionfs_test_packaged_bin",
# In GN, //src/starnix/kernel/vdso is a resource() propagated through
# //src/starnix/kernel/core's deps.
"//src/starnix/kernel/vdso",
],
)
fx_package(
name = "starnix-functionfs-tests-package",
package_name = "starnix-functionfs-tests",
test_components = [":starnix-functionfs-tests-component"],
)
fx_test(
name = "starnix-functionfs-tests",
max_log_severity = "ERROR",
package = ":starnix-functionfs-tests-package",
)