blob: 81b450bf400b32fcfbcf7be454db4a70428b3564 [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/cc:fx_cc_library.bzl", "fx_cc_library")
load("//build/bazel/rules/cc:fx_cc_test_binary.bzl", "fx_cc_test_binary")
load("//build/bazel/rules/testing:fx_unittest_package.bzl", "fx_unittest_package")
package(default_applicable_licenses = ["//:license"])
fx_cc_library(
name = "background_loop",
srcs = ["background_loop.cc"],
hdrs = ["background_loop.h"],
implementation_deps = [
"//sdk/lib/async:async-cpp",
"//sdk/lib/async-default",
"//sdk/lib/zircon-assert",
"//zircon/system/ulib/zx",
],
target_compatible_with = ["@platforms//os:fuchsia"],
visibility = ["//src/storage:__subpackages__"],
deps = [
"//sdk/lib/async",
"//sdk/lib/async-loop",
"//sdk/lib/async-loop:async-loop-cpp",
],
alwayslink = True,
)
fx_cc_test_binary(
name = "background_loop_test",
srcs = ["background_loop_test.cc"],
aspect_hints = ["//src/sys/test_runners/gtest:death_test"],
target_compatible_with = ["@platforms//os:fuchsia"],
deps = [
":background_loop",
"//sdk/lib/async:async-cpp",
"//sdk/lib/async-default",
"//src/lib/fxl/test:gtest_main",
"//zircon/system/ulib/sync:sync-cpp",
"//zircon/system/ulib/zx",
"@com_google_googletest//:gtest",
],
)
fx_unittest_package(
name = "background-loop-tests",
unit_tests = [":background_loop_test"],
visibility = ["//src/storage:__pkg__"],
)