| # Copyright 2018 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") |
| import("//build/testing/cc_test_executable.gni") |
| |
| visibility = [ ":*" ] |
| |
| ############################################################################### |
| # EXECUTABLES |
| ############################################################################### |
| cc_test_executable("annotation_map_unittest_exe") { |
| testonly = true |
| |
| sources = [ "annotation_map_unittest.cc" ] |
| |
| deps = [ |
| "//src/developer/forensics/crash_reports:annotation_map", |
| "//src/developer/forensics/testing:gtest_with_syslog_main", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| cc_test_executable("crash_register_unittest_exe") { |
| testonly = true |
| |
| sources = [ "crash_register_unittest.cc" ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.feedback:fuchsia.feedback_hlcpp", |
| "//sdk/lib/async:async-cpp", |
| "//sdk/lib/fit-promise", |
| "//src/developer/forensics/crash_reports:crash_register", |
| "//src/developer/forensics/crash_reports/info", |
| "//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:channel_control", |
| "//src/developer/forensics/testing/stubs:cobalt", |
| "//src/lib/files", |
| "//src/lib/timekeeper:testing", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| cc_test_executable("crash_reporter_unittest_exe") { |
| testonly = true |
| |
| sources = [ |
| "crash_reporter_unittest.cc", |
| "stub_crash_server.cc", |
| "stub_crash_server.h", |
| ] |
| |
| deps = [ |
| ":scoped_test_report_store", |
| "//sdk/fidl/fuchsia.feedback:fuchsia.feedback_hlcpp", |
| "//sdk/fidl/fuchsia.mem:fuchsia.mem_hlcpp", |
| "//sdk/fidl/fuchsia.settings:fuchsia.settings_hlcpp", |
| "//sdk/fidl/fuchsia.time:fuchsia.time_hlcpp", |
| "//sdk/lib/fit-promise", |
| "//sdk/lib/syslog/cpp", |
| "//src/developer/forensics/crash_reports:constants", |
| "//src/developer/forensics/crash_reports:crash_reporter", |
| "//src/developer/forensics/crash_reports/info", |
| "//src/developer/forensics/feedback/annotations", |
| "//src/developer/forensics/testing:gtest_with_syslog_main", |
| "//src/developer/forensics/testing:unit_test_fixture", |
| "//src/developer/forensics/testing/fakes:privacy_settings", |
| "//src/developer/forensics/testing/stubs:channel_control", |
| "//src/developer/forensics/testing/stubs:cobalt", |
| "//src/developer/forensics/testing/stubs:data_provider", |
| "//src/developer/forensics/testing/stubs:device_id_provider", |
| "//src/developer/forensics/utils/cobalt", |
| "//src/lib/fsl", |
| "//src/lib/timekeeper:testing", |
| "//third_party/crashpad/src/util", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| cc_test_executable("crash_server_unittest_exe") { |
| testonly = true |
| |
| # "crash_server_unittest" 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 = [ "crash_server_unittest.cc" ] |
| |
| deps = [ |
| "//sdk/lib/sys/cpp/testing:unit", |
| "//src/developer/forensics/crash_reports:constants", |
| "//src/developer/forensics/crash_reports:crash_server", |
| "//src/developer/forensics/testing:gtest_with_syslog_main", |
| "//src/developer/forensics/testing:unit_test_fixture", |
| "//src/developer/forensics/testing/stubs:data_provider", |
| "//src/developer/forensics/testing/stubs:loader", |
| "//src/lib/timekeeper:testing", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| cc_test_executable("dart_module_parser_unittest_exe") { |
| testonly = true |
| |
| sources = [ "dart_module_parser_unittest.cc" ] |
| |
| deps = [ |
| "//src/developer/forensics/crash_reports:report_util", |
| "//src/developer/forensics/testing:gtest_with_syslog_main", |
| "//src/lib/fxl", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| cc_test_executable("filing_result_unittest_exe") { |
| testonly = true |
| |
| sources = [ "filing_result_unittest.cc" ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.feedback:fuchsia.feedback_hlcpp", |
| "//src/developer/forensics/crash_reports:filing_result", |
| "//src/developer/forensics/testing:gtest_with_syslog_main", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| cc_test_executable("inspect_manager_unittest_exe") { |
| testonly = true |
| |
| # "inspect_manager_unittest" 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 = [ "inspect_manager_unittest.cc" ] |
| |
| deps = [ |
| "//sdk/lib/syslog/cpp", |
| "//src/developer/forensics/crash_reports:constants", |
| "//src/developer/forensics/crash_reports:errors", |
| "//src/developer/forensics/crash_reports/info:inspect_manager", |
| "//src/developer/forensics/feedback:config", |
| "//src/developer/forensics/testing:gtest_with_syslog_main", |
| "//src/developer/forensics/testing:unit_test_fixture", |
| "//src/lib/fxl", |
| "//src/lib/timekeeper:testing", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| cc_test_executable("product_quotas_unittest_exe") { |
| testonly = true |
| |
| sources = [ "product_quotas_unittest.cc" ] |
| |
| deps = [ |
| "//src/developer/forensics/crash_reports:crash_reporter", |
| "//src/developer/forensics/testing:gtest_with_syslog_main", |
| "//src/developer/forensics/testing:unit_test_fixture", |
| "//src/developer/forensics/testing/stubs:utc_clock_ready_watcher", |
| "//src/lib/files", |
| "//src/lib/timekeeper:testing", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| cc_test_executable("queue_unittest_exe") { |
| testonly = true |
| |
| sources = [ |
| "queue_unittest.cc", |
| "stub_crash_server.cc", |
| "stub_crash_server.h", |
| ] |
| |
| deps = [ |
| ":scoped_test_report_store", |
| "//src/developer/forensics/crash_reports:constants", |
| "//src/developer/forensics/crash_reports:queue", |
| "//src/developer/forensics/crash_reports/info", |
| "//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:data_provider", |
| "//src/lib/fsl", |
| "//src/lib/timekeeper:testing", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| cc_test_executable("reporting_policy_watcher_unittest_exe") { |
| testonly = true |
| |
| sources = [ "reporting_policy_watcher_unittest.cc" ] |
| |
| deps = [ |
| "//src/developer/forensics/crash_reports:reporting_policy_watcher", |
| "//src/developer/forensics/testing:gtest_with_syslog_main", |
| "//src/developer/forensics/testing:unit_test_fixture", |
| "//src/developer/forensics/testing/fakes:privacy_settings", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| cc_test_executable("report_util_unittest_exe") { |
| testonly = true |
| |
| sources = [ "report_util_unittest.cc" ] |
| |
| deps = [ |
| "//src/developer/forensics/crash_reports:report_util", |
| "//src/developer/forensics/testing:gtest_with_syslog_main", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| cc_test_executable("sized_data_reader_unittest_exe") { |
| testonly = true |
| |
| sources = [ "sized_data_reader_unittest.cc" ] |
| |
| deps = [ |
| ":test_data", |
| "//src/developer/forensics/crash_reports:sized_data_reader", |
| "//src/lib/files", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/crashpad/src/util", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| cc_test_executable("snapshot_collector_unittest_exe") { |
| testonly = true |
| |
| sources = [ |
| "snapshot_collector_unittest.cc", |
| "stub_crash_server.cc", |
| "stub_crash_server.h", |
| ] |
| |
| deps = [ |
| ":scoped_test_report_store", |
| "//src/developer/forensics/crash_reports:errors", |
| "//src/developer/forensics/crash_reports:snapshot_collector", |
| "//src/developer/forensics/testing:gmatchers", |
| "//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:data_provider", |
| "//src/lib/timekeeper:testing", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| cc_test_executable("snapshot_persistence_metadata_unittest_exe") { |
| testonly = true |
| |
| sources = [ "snapshot_persistence_metadata_unittest.cc" ] |
| |
| deps = [ |
| "//src/developer/forensics/crash_reports:store", |
| "//src/developer/forensics/testing:gtest_with_syslog_main", |
| "//src/developer/forensics/testing:scoped_memfs_manager", |
| "//src/developer/forensics/utils:storage_size", |
| "//src/lib/files", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| cc_test_executable("snapshot_persistence_unittest_exe") { |
| testonly = true |
| |
| sources = [ "snapshot_persistence_unittest.cc" ] |
| |
| deps = [ |
| "//src/developer/forensics/crash_reports:constants", |
| "//src/developer/forensics/crash_reports:store", |
| "//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:scoped_memfs_manager", |
| "//src/developer/forensics/testing:unit_test_fixture", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| cc_test_executable("snapshot_store_unittest_exe") { |
| testonly = true |
| |
| sources = [ "snapshot_store_unittest.cc" ] |
| |
| deps = [ |
| "//src/developer/forensics/crash_reports:constants", |
| "//src/developer/forensics/crash_reports:store", |
| "//src/developer/forensics/testing:gmatchers", |
| "//src/developer/forensics/testing:gpretty_printers", |
| "//src/developer/forensics/testing:gtest_with_syslog_main", |
| "//src/developer/forensics/testing:unit_test_fixture", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| cc_test_executable("report_store_unittest_exe") { |
| testonly = true |
| |
| sources = [ "report_store_unittest.cc" ] |
| |
| deps = [ |
| "//sdk/lib/syslog/cpp", |
| "//src/developer/forensics/crash_reports:store", |
| "//src/developer/forensics/feedback_data:constants", |
| "//src/developer/forensics/testing:gpretty_printers", |
| "//src/developer/forensics/testing:gtest_with_syslog_main", |
| "//src/developer/forensics/testing:scoped_memfs_manager", |
| "//src/developer/forensics/testing:unit_test_fixture", |
| "//src/developer/forensics/utils:sized_data", |
| "//src/developer/forensics/utils:storage_size", |
| "//src/lib/files", |
| "//src/lib/timekeeper:testing", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//third_party/rapidjson", |
| ] |
| } |
| |
| cc_test_executable("report_store_metadata_unittest_exe") { |
| testonly = true |
| |
| sources = [ "report_store_metadata_unittest.cc" ] |
| |
| deps = [ |
| "//sdk/lib/syslog/cpp", |
| "//src/developer/forensics/crash_reports:store", |
| "//src/developer/forensics/testing:gtest_with_syslog_main", |
| "//src/developer/forensics/testing:scoped_memfs_manager", |
| "//src/developer/forensics/utils:storage_size", |
| "//src/lib/files", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| source_set("scoped_test_report_store") { |
| sources = [ |
| "scoped_test_report_store.cc", |
| "scoped_test_report_store.h", |
| ] |
| |
| public_deps = [ |
| "//src/developer/forensics/crash_reports:store", |
| "//src/developer/forensics/feedback/annotations", |
| "//src/developer/forensics/utils:storage_size", |
| ] |
| |
| deps = [ |
| "//src/developer/forensics/crash_reports:constants", |
| "//src/lib/files", |
| ] |
| } |
| |
| ############################################################################### |
| # RESOURCES |
| ############################################################################### |
| resource("test_data") { |
| sources = [ "resources/test_data.zip" ] |
| |
| outputs = [ "data/test_data.zip" ] |
| } |
| |
| ############################################################################### |
| # COMPONENTS |
| ############################################################################### |
| fuchsia_unittest_component("annotation_map_unittest") { |
| deps = [ ":annotation_map_unittest_exe" ] |
| } |
| |
| fuchsia_unittest_component("crash_register_unittest") { |
| deps = [ |
| ":crash_register_unittest_exe", |
| "//src/sys/test_runners:tmp_storage", |
| ] |
| } |
| |
| fuchsia_component("crash_reporter_unittest") { |
| testonly = true |
| |
| manifest = "meta/crash_reporter_unittest.cml" |
| |
| deps = [ |
| ":crash_reporter_unittest_exe", |
| "//src/sys/test_runners:tmp_storage", |
| ] |
| } |
| |
| fuchsia_unittest_component("crash_server_unittest") { |
| deps = [ ":crash_server_unittest_exe" ] |
| } |
| |
| fuchsia_unittest_component("dart_module_parser_unittest") { |
| deps = [ ":dart_module_parser_unittest_exe" ] |
| } |
| |
| fuchsia_unittest_component("filing_result_unittest") { |
| deps = [ ":filing_result_unittest_exe" ] |
| } |
| |
| fuchsia_unittest_component("inspect_manager_unittest") { |
| deps = [ ":inspect_manager_unittest_exe" ] |
| } |
| |
| fuchsia_unittest_component("product_quotas_unittest") { |
| deps = [ |
| ":product_quotas_unittest_exe", |
| "//src/sys/test_runners:tmp_storage", |
| "//src/sys/test_runners/gtest:death_test", |
| ] |
| } |
| |
| fuchsia_component("queue_unittest") { |
| testonly = true |
| |
| manifest = "meta/queue_unittest.cml" |
| |
| deps = [ |
| ":queue_unittest_exe", |
| "//src/sys/test_runners:tmp_storage", |
| ] |
| } |
| |
| fuchsia_unittest_component("report_util_unittest") { |
| deps = [ ":report_util_unittest_exe" ] |
| } |
| |
| fuchsia_unittest_component("reporting_policy_watcher_unittest") { |
| deps = [ |
| ":reporting_policy_watcher_unittest_exe", |
| "//src/sys/test_runners/gtest:death_test", |
| ] |
| } |
| |
| fuchsia_unittest_component("sized_data_reader_unittest") { |
| deps = [ ":sized_data_reader_unittest_exe" ] |
| } |
| |
| fuchsia_unittest_component("snapshot_collector_unittest") { |
| deps = [ |
| ":snapshot_collector_unittest_exe", |
| "//src/sys/test_runners:tmp_storage", |
| ] |
| } |
| |
| fuchsia_unittest_component("snapshot_persistence_metadata_unittest") { |
| deps = [ |
| ":snapshot_persistence_metadata_unittest_exe", |
| "//src/sys/test_runners:tmp_storage", |
| ] |
| } |
| |
| fuchsia_unittest_component("snapshot_persistence_unittest") { |
| deps = [ |
| ":snapshot_persistence_unittest_exe", |
| "//src/sys/test_runners:tmp_storage", |
| "//src/sys/test_runners/gtest:death_test", |
| ] |
| } |
| |
| fuchsia_unittest_component("snapshot_store_unittest") { |
| deps = [ |
| ":snapshot_store_unittest_exe", |
| "//src/sys/test_runners:tmp_storage", |
| "//src/sys/test_runners/gtest:death_test", |
| ] |
| } |
| |
| fuchsia_unittest_component("report_store_metadata_unittest") { |
| deps = [ |
| ":report_store_metadata_unittest_exe", |
| "//src/sys/test_runners:tmp_storage", |
| ] |
| } |
| |
| fuchsia_unittest_component("report_store_unittest") { |
| deps = [ |
| ":report_store_unittest_exe", |
| "//src/sys/test_runners:tmp_storage", |
| "//src/sys/test_runners/gtest:death_test", |
| ] |
| } |
| |
| ############################################################################### |
| # PACKAGES |
| ############################################################################### |
| fuchsia_test_package("crash-reports-tests") { |
| test_components = [ |
| ":annotation_map_unittest", |
| ":crash_register_unittest", |
| ":crash_reporter_unittest", |
| ":crash_server_unittest", |
| ":dart_module_parser_unittest", |
| ":filing_result_unittest", |
| ":reporting_policy_watcher_unittest", |
| ":inspect_manager_unittest", |
| ":product_quotas_unittest", |
| ":queue_unittest", |
| ":report_util_unittest", |
| ":sized_data_reader_unittest", |
| ":snapshot_collector_unittest", |
| ":snapshot_persistence_metadata_unittest", |
| ":snapshot_persistence_unittest", |
| ":snapshot_store_unittest", |
| ":report_store_unittest", |
| ":report_store_metadata_unittest", |
| ] |
| |
| test_specs = { |
| log_settings = { |
| max_severity = "FATAL" |
| } |
| } |
| } |
| |
| ############################################################################### |
| # GROUPS |
| ############################################################################### |
| group("tests") { |
| testonly = true |
| |
| deps = [ |
| ":crash-reports-tests", |
| |
| # To run the Crashpad tests. |
| "//third_party/crashpad/src:tests", |
| ] |
| |
| visibility += [ "//src/developer/forensics:tests" ] |
| } |