blob: f8cf16a16d7a60f9b4639c19350a9b958360794a [file] [edit]
# 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.
import("//build/components/fuchsia_unittest_package.gni")
import("//build/cpp/library_headers.gni")
import("//build/test.gni")
library_headers("headers") {
headers = [ "lib/captive-thread/captive-thread.h" ]
public_deps = [
"//sdk/lib/fit",
"//zircon/system/ulib/zx",
]
}
static_library("captive-thread") {
public_deps = [ ":headers" ]
sources = [ "captive-thread.cc" ]
deps = [ "//sdk/lib/stdcompat" ]
if (current_cpu == "riscv64") {
deps += [ ":fake-step" ]
}
}
source_set("fake-step") {
visibility = [ ":*" ]
public = [ "fake-step.h" ]
public_deps = [
":headers",
"//sdk/lib/stdcompat",
]
if (current_cpu == "riscv64") {
sources = [ "fake-step.cc" ]
deps = [
"//zircon/system/ulib/hwreg",
"//zircon/system/ulib/zx",
]
}
}
group("tests") {
testonly = true
deps = [ ":captive-thread-tests" ]
}
test("captive-thread-unittests") {
sources = [ "captive-thread-tests.cc" ]
deps = [
".",
"testing",
"//src/lib/elfldltl",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gmock",
]
}
fuchsia_unittest_package("captive-thread-tests") {
deps = [ ":captive-thread-unittests" ]
}