blob: 9063eeff50ae77ad3549d4af911d116c7ebce4b0 [file] [log] [blame] [edit]
# Copyright 2023 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
group("base") {
public_deps = [ ":libdiagnostics_base" ]
if (use.test || use.fuzzer) {
public_deps += [ ":test_util" ]
}
}
config("libdiagnostics_base_config") {
use_test = use.test || use.fuzzer
defines = [ "USE_TEST=${use_test}" ]
}
# Provides basic utilities for all the executables under //diagnostics.
shared_library("libdiagnostics_base") {
sources = [
"file_utils.cc",
"mojo_utils.cc",
]
public_configs = [ ":libdiagnostics_base_config" ]
assert_no_deps = [
"//diagnostics/bindings/*",
"//diagnostics/constants/*",
"//diagnostics/cros_health_tool/*",
"//diagnostics/cros_healthd/*",
"//diagnostics/mojom/*",
"//diagnostics/wilco_dtc_supportd/*",
]
install_path = "lib"
pkg_deps = [
"libbrillo",
"libchrome",
]
public_pkg_deps = [ "libmojo" ]
}
pkg_config("test_pkg_deps") {
pkg_deps = [
"libchrome",
"libchrome-test",
"libmojo",
]
}
if (use.test || use.fuzzer) {
source_set("test_util") {
sources = [ "file_test_utils.cc" ]
configs += [ ":test_pkg_deps" ]
public_configs = [
":libdiagnostics_base_config",
"//common-mk:test",
]
}
}
pkg_config("healthd_testrunner_pkg_deps") {
pkg_deps = [
"libchrome",
"libmojo",
]
}
if (use.test) {
source_set("healthd_testrunner") {
sources = [ "healthd_testrunner.cc" ]
configs += [ ":healthd_testrunner_pkg_deps" ]
public_configs = [ "//common-mk:test" ]
public_deps = [ "//common-mk/testrunner:testrunner" ]
}
}
if (use.test) {
source_set("test") {
sources = [
"file_test_utils_test.cc",
"file_utils_test.cc",
"mojo_utils_test.cc",
]
configs += [ ":test_pkg_deps" ]
deps = [ ":libdiagnostics_base" ]
public_deps = [ ":healthd_testrunner" ]
}
}