| # Copyright 2020 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. |
| |
| ########################################## |
| # Though under //zircon, this build file # |
| # is meant to be used in the Fuchsia GN # |
| # build. # |
| # See fxbug.dev/36548. # |
| ########################################## |
| |
| assert(!defined(zx) || zx != "/", |
| "This file can only be used in the Fuchsia GN build.") |
| |
| import("//build/test.gni") |
| import("//build/testing/bootfs_test.gni") |
| import("//build/unification/zx_library.gni") |
| import("//src/sys/build/components.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":watchdog-unittest" ] |
| } |
| |
| test("watchdog_unittest") { |
| testonly = true |
| sources = [ "watchdog_test.cc" ] |
| deps = [ |
| "//src/storage/lib/watchdog", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxc", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/fs", |
| "//zircon/system/ulib/syslog", |
| ] |
| |
| include_dirs = [ ".." ] |
| |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| bootfs_test("watchdog-unit-bootfs-test") { |
| name = "watchdog-unittest" |
| deps = [ ":watchdog-unittest" ] |
| } |
| |
| fuchsia_unittest_package("watchdog-unittest") { |
| executable_path = "test/watchdog_unittest" |
| deps = [ ":watchdog_unittest" ] |
| } |
| |
| zx_library("watchdog") { |
| sdk = "source" |
| sdk_headers = [ |
| "lib/watchdog/watchdog.h", |
| "lib/watchdog/operations.h", |
| ] |
| host = true |
| deps = [ |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/fit", |
| "//zircon/public/lib/zxc", |
| "//zircon/system/ulib/fs", |
| ] |
| |
| if (is_fuchsia) { |
| sources = [ "watchdog.cc" ] |
| public_deps = [ |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/fzl", |
| "//zircon/system/ulib/syslog", |
| ] |
| deps += [ |
| "//sdk/lib/fdio", |
| "//zircon/public/lib/fbl", |
| "//zircon/system/ulib/inspector", |
| ] |
| } else { |
| sources = [ "watchdog_host.cc" ] |
| } |
| } |