blob: 537b34178f53734ca82b27ce55c03a904c7db450 [file] [log] [blame]
# Copyright 2021 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")
###############################################################################
# EXECUTABLES
###############################################################################
executable("annotation_manager_unittest_exe") {
testonly = true
sources = [ "annotation_manager_unittest.cc" ]
deps = [
"//sdk/lib/syslog/cpp",
"//src/developer/forensics/feedback/annotations",
"//src/developer/forensics/testing:gmatchers",
"//src/developer/forensics/testing:unit_test_fixture",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("attachment_manager_unittest_exe") {
testonly = true
sources = [ "attachment_manager_unittest.cc" ]
deps = [
"//sdk/fidl/fuchsia.hwinfo",
"//sdk/fidl/fuchsia.intl",
"//sdk/lib/fit-promise",
"//src/developer/forensics/feedback/attachments",
"//src/developer/forensics/feedback_data:constants",
"//src/developer/forensics/testing:gmatchers",
"//src/developer/forensics/testing:gpretty_printers",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/testing:log_message",
"//src/developer/forensics/testing:unit_test_fixture",
"//src/developer/forensics/testing/stubs:channel_control",
"//src/developer/forensics/testing/stubs:cobalt",
"//src/developer/forensics/testing/stubs:device_id_provider",
"//src/developer/forensics/testing/stubs:diagnostics",
"//src/developer/forensics/testing/stubs:product_info_provider",
"//src/developer/forensics/utils:logs",
"//src/developer/forensics/utils:time",
"//src/developer/forensics/utils/cobalt",
"//src/lib/files",
"//src/lib/fxl",
"//src/lib/timekeeper:testing",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
"//zircon/system/ulib/async:async-cpp",
"//zircon/system/ulib/zx",
]
}
executable("annotation_metrics_unittest_exe") {
testonly = true
sources = [ "annotation_metrics_unittest.cc" ]
deps = [
"//src/developer/forensics/feedback/annotations",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/testing:unit_test_fixture",
"//src/developer/forensics/testing/stubs:cobalt",
"//src/lib/timekeeper:testing",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("attachment_metrics_unittest_exe") {
testonly = true
# "attachment_metrics_unittest_exe" is rather generic for the default_output_dir that is set
# to root_out_dir so instead we write the binary to target_out_dir.
output_dir = target_out_dir
sources = [ "attachment_metrics_unittest.cc" ]
deps = [
"//src/developer/forensics/feedback/attachments",
"//src/developer/forensics/feedback_data:constants",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/testing:unit_test_fixture",
"//src/developer/forensics/testing/stubs:cobalt",
"//src/lib/timekeeper:testing",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("board_info_provider_unittest_exe") {
testonly = true
sources = [ "board_info_provider_unittest.cc" ]
deps = [
"//sdk/fidl/fuchsia.hwinfo",
"//src/developer/forensics/feedback/annotations:board_info_provider",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("config_unittest_exe") {
testonly = true
sources = [ "config_unittest.cc" ]
deps = [
"//src/developer/forensics/feedback:config",
"//src/lib/files",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("current_channel_provider_unittest_exe") {
testonly = true
sources = [ "current_channel_provider_unittest.cc" ]
deps = [
"//sdk/fidl/fuchsia.hwinfo",
"//src/developer/forensics/feedback/annotations:current_channel_provider",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("data_register_unittest_exe") {
testonly = true
sources = [ "data_register_unittest.cc" ]
deps = [
"//sdk/fidl/fuchsia.feedback",
"//src/developer/forensics/feedback/annotations:data_register",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/testing:unit_test_fixture",
"//src/lib/files",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("device_id_provider_unittest_exe") {
testonly = true
# "device_id_provider_unittest" is used elsewhere in Forensics.
output_dir = target_out_dir
sources = [ "device_id_provider_unittest.cc" ]
deps = [
"//sdk/lib/fit-promise",
"//src/developer/forensics/feedback/annotations:device_id_provider",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/testing:unit_test_fixture",
"//src/developer/forensics/testing/stubs:device_id_provider",
"//src/developer/forensics/utils:errors",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("encode_unittest_exe") {
testonly = true
sources = [ "encode_unittest.cc" ]
deps = [
"//src/developer/forensics/feedback/annotations",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/testing:unit_test_fixture",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("feedback_data_unittest_exe") {
testonly = true
sources = [ "feedback_data_unittest.cc" ]
deps = [
"//src/developer/forensics/feedback:main_service",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/testing:unit_test_fixture",
"//src/developer/forensics/testing/stubs:cobalt",
"//src/developer/forensics/utils/cobalt",
"//src/lib/files",
"//src/lib/timekeeper:testing",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("fidl_provider_unittest_exe") {
testonly = true
sources = [ "fidl_provider_unittest.cc" ]
deps = [
"//sdk/fidl/fuchsia.update.channelcontrol",
"//src/developer/forensics/feedback/annotations:fidl_provider",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/testing:unit_test_fixture",
"//src/developer/forensics/testing/stubs:channel_control",
"//src/developer/forensics/testing/stubs:device_id_provider",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("inspect_unittest_exe") {
testonly = true
sources = [ "inspect_unittest.cc" ]
deps = [
"//sdk/lib/sys/cpp/testing:cpp",
"//src/developer/forensics/feedback/attachments",
"//src/developer/forensics/feedback/attachments:inspect",
"//src/developer/forensics/feedback_data:constants",
"//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:diagnostics",
"//src/developer/forensics/utils:errors",
"//src/lib/timekeeper:testing",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("kernel_log_integration_test_exe") {
testonly = true
sources = [ "kernel_log_integration_test.cc" ]
deps = [
"//sdk/fidl/fuchsia.boot:fuchsia.boot_c",
"//sdk/lib/sys/cpp/testing:integration_fixture",
"//src/developer/forensics/feedback/attachments",
"//src/developer/forensics/feedback/attachments:kernel_log",
"//src/developer/forensics/utils:errors",
"//src/lib/fxl",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
"//zircon/system/ulib/zx",
]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}
executable("last_reboot_unittest_exe") {
testonly = true
sources = [ "last_reboot_unittest.cc" ]
deps = [
"//sdk/fidl/fuchsia.feedback",
"//sdk/fidl/fuchsia.hardware.power.statecontrol",
"//src/developer/forensics/feedback:main_service",
"//src/developer/forensics/feedback/reboot_log",
"//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/testing/stubs:reboot_methods_watcher_register",
"//src/developer/forensics/utils/cobalt",
"//src/lib/timekeeper:testing",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("main_service_unittest_exe") {
testonly = true
# "main_service_unittest_exe" is used a bunch in Forensics.
output_dir = target_out_dir
sources = [ "main_service_unittest.cc" ]
deps = [
"//sdk/fidl/fuchsia.feedback",
"//src/developer/forensics/feedback:main_service",
"//src/developer/forensics/feedback/reboot_log",
"//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/testing/stubs:reboot_methods_watcher_register",
"//src/lib/timekeeper:testing",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("namespace_init_unittest_exe") {
testonly = true
# "namespace_init_unittest_exe" is also used by feedback-data.
output_dir = target_out_dir
sources = [ "namespace_init_unittest.cc" ]
deps = [
"//sdk/lib/syslog/cpp",
"//src/developer/forensics/feedback:namespace_init",
"//src/developer/forensics/feedback_data/system_log_recorder:reader",
"//src/developer/forensics/feedback_data/system_log_recorder/encoding:production",
"//src/developer/forensics/feedback_data/system_log_recorder/encoding:version",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/testing:log_message",
"//src/developer/forensics/testing:unit_test_fixture",
"//src/developer/forensics/utils:logs",
"//src/lib/files",
"//src/lib/timekeeper:testing",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
"//zircon/system/ulib/syslog",
]
}
executable("product_info_provider_unittest_exe") {
testonly = true
sources = [ "product_info_provider_unittest.cc" ]
deps = [
"//sdk/fidl/fuchsia.hwinfo",
"//src/developer/forensics/feedback/annotations:product_info_provider",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("redactor_factory_unittest_exe") {
testonly = true
sources = [ "redactor_factory_unittest.cc" ]
deps = [
"//src/developer/forensics/feedback:redactor_factory",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/testing:unit_test_fixture",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("startup_annotations_unittest_exe") {
testonly = true
sources = [ "startup_annotations_unittest.cc" ]
deps = [
"//sdk/lib/syslog/cpp",
"//src/developer/forensics/feedback:constants",
"//src/developer/forensics/feedback/annotations",
"//src/developer/forensics/feedback/reboot_log",
"//src/developer/forensics/feedback_data:constants",
"//src/developer/forensics/testing:gmatchers",
"//src/developer/forensics/testing:gpretty_printers",
"//src/developer/forensics/testing:scoped_memfs_manager",
"//src/lib/files",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("static_attachments_unittest_exe") {
testonly = true
sources = [ "static_attachments_unittest.cc" ]
deps = [
"//src/developer/forensics/feedback/attachments",
"//src/developer/forensics/feedback_data:constants",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/testing:scoped_memfs_manager",
"//src/lib/files",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("system_log_unittest_exe") {
testonly = true
sources = [ "system_log_unittest.cc" ]
deps = [
"//src/developer/forensics/feedback/attachments",
"//src/developer/forensics/feedback/attachments:system_log",
"//src/developer/forensics/feedback_data:constants",
"//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:diagnostics",
"//src/developer/forensics/utils:errors",
"//src/developer/forensics/utils/redact",
"//src/lib/timekeeper:testing",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("target_channel_provider_unittest_exe") {
testonly = true
sources = [ "target_channel_provider_unittest.cc" ]
deps = [
"//src/developer/forensics/feedback/annotations:target_channel_provider",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/testing:unit_test_fixture",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("time_provider_unittest_exe") {
testonly = true
sources = [ "time_provider_unittest.cc" ]
deps = [
"//src/developer/forensics/feedback/annotations:time_provider",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/testing:unit_test_fixture",
"//src/lib/timekeeper:testing",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("timezone_provider_unittest_exe") {
testonly = true
sources = [ "timezone_provider_unittest.cc" ]
deps = [
"//src/developer/forensics/feedback:constants",
"//src/developer/forensics/feedback/annotations:timezone_provider",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/testing:unit_test_fixture",
"//src/developer/forensics/testing/stubs:timezone_provider",
"//src/lib/timekeeper:testing",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
"//zircon/system/ulib/zx",
]
}
###############################################################################
# COMPONENTS
###############################################################################
fuchsia_component("annotation_manager_unittest") {
testonly = true
manifest = "meta/annotation_manager_unittest.cml"
deps = [ ":annotation_manager_unittest_exe" ]
}
fuchsia_component("attachment_manager_unittest") {
testonly = true
manifest = "meta/attachment_manager_unittest.cml"
deps = [ ":attachment_manager_unittest_exe" ]
}
fuchsia_unittest_component("annotation_metrics_unittest") {
deps = [ ":annotation_metrics_unittest_exe" ]
}
fuchsia_unittest_component("attachment_metrics_unittest") {
deps = [ ":attachment_metrics_unittest_exe" ]
}
fuchsia_unittest_component("board_info_provider_unittest") {
deps = [ ":board_info_provider_unittest_exe" ]
}
fuchsia_unittest_component("config_unittest") {
deps = [
":config_unittest_exe",
"//src/sys/test_runners:tmp_storage",
]
}
fuchsia_unittest_component("current_channel_provider_unittest") {
deps = [ ":current_channel_provider_unittest_exe" ]
}
fuchsia_unittest_component("data_register_unittest") {
deps = [
":data_register_unittest_exe",
"//src/sys/test_runners:tmp_storage",
]
}
fuchsia_unittest_component("device_id_provider_unittest") {
deps = [
":device_id_provider_unittest_exe",
"//src/sys/test_runners:tmp_storage",
]
}
fuchsia_unittest_component("encode_unittest") {
deps = [ ":encode_unittest_exe" ]
}
fuchsia_unittest_component("feedback_data_unittest") {
deps = [
":feedback_data_unittest_exe",
"//src/sys/test_runners:tmp_storage",
]
}
fuchsia_unittest_component("fidl_provider_unittest") {
deps = [ ":fidl_provider_unittest_exe" ]
}
fuchsia_component("inspect_unittest") {
testonly = true
manifest = "meta/inspect_unittest.cml"
deps = [ ":inspect_unittest_exe" ]
}
fuchsia_component("kernel_log_integration_test") {
testonly = true
manifest = "meta/kernel_log_integration_test.cml"
deps = [ ":kernel_log_integration_test_exe" ]
}
fuchsia_unittest_component("last_reboot_unittest") {
deps = [
":last_reboot_unittest_exe",
"//src/sys/test_runners:tmp_storage",
]
}
fuchsia_component("main_service_unittest") {
testonly = true
manifest = "meta/main_service_unittest.cml"
deps = [ ":main_service_unittest_exe" ]
}
fuchsia_unittest_component("namespace_init_unittest") {
deps = [
":namespace_init_unittest_exe",
"//src/sys/test_runners:tmp_storage",
]
}
fuchsia_unittest_component("product_info_provider_unittest") {
deps = [ ":product_info_provider_unittest_exe" ]
}
fuchsia_unittest_component("redactor_factory_unittest") {
deps = [
":redactor_factory_unittest_exe",
"//src/sys/test_runners:tmp_storage",
]
}
fuchsia_unittest_component("startup_annotations_unittest") {
deps = [ ":startup_annotations_unittest_exe" ]
}
fuchsia_unittest_component("static_attachments_unittest") {
deps = [ ":static_attachments_unittest_exe" ]
}
fuchsia_unittest_component("system_log_unittest") {
deps = [ ":system_log_unittest_exe" ]
}
fuchsia_unittest_component("target_channel_provider_unittest") {
deps = [ ":target_channel_provider_unittest_exe" ]
}
fuchsia_unittest_component("time_provider_unittest") {
deps = [ ":time_provider_unittest_exe" ]
}
fuchsia_unittest_component("timezone_provider_unittest") {
deps = [ ":timezone_provider_unittest_exe" ]
}
###############################################################################
# PACKAGES
###############################################################################
fuchsia_test_package("feedback-tests") {
test_components = [
":annotation_manager_unittest",
":attachment_manager_unittest",
":annotation_metrics_unittest",
":attachment_metrics_unittest",
":board_info_provider_unittest",
":config_unittest",
":current_channel_provider_unittest",
":data_register_unittest",
":device_id_provider_unittest",
":encode_unittest",
":feedback_data_unittest",
":fidl_provider_unittest",
":last_reboot_unittest",
":kernel_log_integration_test",
":inspect_unittest",
":main_service_unittest",
":namespace_init_unittest",
":product_info_provider_unittest",
":redactor_factory_unittest",
":startup_annotations_unittest",
":static_attachments_unittest",
":system_log_unittest",
":target_channel_provider_unittest",
":time_provider_unittest",
":timezone_provider_unittest",
]
test_specs = {
log_settings = {
max_severity = "FATAL"
}
}
}
group("tests") {
testonly = true
deps = [ ":feedback-tests" ]
}