| # 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("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: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("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", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| 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("metrics_unittest_exe") { |
| testonly = true |
| |
| sources = [ "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("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", |
| ] |
| } |
| |
| 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("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", |
| ] |
| } |
| |
| ############################################################################### |
| # COMPONENTS |
| ############################################################################### |
| fuchsia_component("annotation_manager_unittest") { |
| testonly = true |
| |
| manifest = "meta/annotation_manager_unittest.cml" |
| |
| deps = [ ":annotation_manager_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("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_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("metrics_unittest") { |
| deps = [ ":metrics_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("target_channel_provider_unittest") { |
| deps = [ ":target_channel_provider_unittest_exe" ] |
| } |
| |
| ############################################################################### |
| # PACKAGES |
| ############################################################################### |
| fuchsia_test_package("feedback-tests") { |
| test_components = [ |
| ":annotation_manager_unittest", |
| ":board_info_provider_unittest", |
| ":config_unittest", |
| ":target_channel_provider_unittest", |
| ":current_channel_provider_unittest", |
| ":data_register_unittest", |
| ":device_id_provider_unittest", |
| ":feedback_data_unittest", |
| ":fidl_provider_unittest", |
| ":last_reboot_unittest", |
| ":main_service_unittest", |
| ":metrics_unittest", |
| ":namespace_init_unittest", |
| ":product_info_provider_unittest", |
| ":redactor_factory_unittest", |
| ":startup_annotations_unittest", |
| ] |
| |
| test_specs = { |
| log_settings = { |
| max_severity = "FATAL" |
| } |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ ":feedback-tests" ] |
| } |