blob: 6f97f856a79faf2366ebe5597d92c128db5ce6f3 [file] [log] [blame]
# Copyright 2019 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.gni")
import("//build/components/fuchsia_unittest_component.gni")
visibility = [ ":*" ]
###############################################################################
# EXECUTABLES
###############################################################################
executable("last_reboot_info_provider_unittest_exe") {
testonly = true
# "last_reboot_info_provider_unittest" is also used by feedback-data.
output_dir = target_out_dir
sources = [ "last_reboot_info_provider_unittest.cc" ]
deps = [
"//sdk/fidl/fuchsia.feedback",
"//src/developer/forensics/feedback/reboot_log",
"//src/developer/forensics/last_reboot:last_reboot_info_provider",
"//src/developer/forensics/testing:gpretty_printers",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("reboot_watcher_unittest_exe") {
testonly = true
sources = [ "reboot_watcher_unittest.cc" ]
deps = [
"//sdk/fidl/fuchsia.hardware.power.statecontrol",
"//src/developer/forensics/last_reboot:reboot_watcher",
"//src/developer/forensics/testing:gpretty_printers",
"//src/developer/forensics/testing:unit_test_fixture",
"//src/developer/forensics/testing/stubs:cobalt",
"//src/lib/files",
"//src/lib/fxl",
"//src/lib/fxl/test:gtest_main",
"//src/lib/timekeeper:testing",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("reporter_unittest_exe") {
testonly = true
sources = [ "reporter_unittest.cc" ]
deps = [
"//sdk/lib/fit-promise",
"//src/developer/forensics/last_reboot:reporter",
"//src/developer/forensics/testing:gpretty_printers",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/testing:unit_test_fixture",
"//src/developer/forensics/testing/stubs:cobalt",
"//src/developer/forensics/testing/stubs:crash_reporter",
"//src/developer/forensics/utils/cobalt",
"//src/lib/files",
"//src/lib/timekeeper:testing",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
"//zircon/system/ulib/async:async-cpp",
"//zircon/system/ulib/zx",
]
}
###############################################################################
# COMPONENTS
###############################################################################
fuchsia_unittest_component("last_reboot_info_provider_unittest") {
deps = [ ":last_reboot_info_provider_unittest_exe" ]
}
fuchsia_unittest_component("reboot_watcher_unittest") {
deps = [
":reboot_watcher_unittest_exe",
"//src/sys/test_runners:tmp_storage",
]
}
fuchsia_unittest_component("reporter_unittest") {
deps = [
":reporter_unittest_exe",
"//src/sys/test_runners:tmp_storage",
]
}
###############################################################################
# PACKAGES
###############################################################################
fuchsia_test_package("last-reboot-tests") {
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
test_components = [
":last_reboot_info_provider_unittest",
":reboot_watcher_unittest",
":reporter_unittest",
]
}
###############################################################################
# GROUPS
###############################################################################
group("tests") {
testonly = true
deps = [ ":last-reboot-tests" ]
visibility += [ "//src/developer/forensics:tests" ]
}