| # 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("data_provider_unittest_exe") { |
| testonly = true |
| |
| sources = [ |
| "data_provider_unittest.cc", |
| "stub_attachment_provider.cc", |
| "stub_attachment_provider.h", |
| ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.boot:fuchsia.boot_hlcpp", |
| "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics_hlcpp", |
| "//sdk/fidl/fuchsia.feedback:fuchsia.feedback_hlcpp", |
| "//sdk/fidl/fuchsia.images:fuchsia.images_hlcpp", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_hlcpp", |
| "//sdk/fidl/fuchsia.math:fuchsia.math_hlcpp", |
| "//sdk/lib/fidl/cpp", |
| "//src/developer/forensics/feedback/attachments", |
| "//src/developer/forensics/feedback_data:constants", |
| "//src/developer/forensics/feedback_data:data_provider", |
| "//src/developer/forensics/feedback_data:metadata", |
| "//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:cobalt", |
| "//src/developer/forensics/testing/stubs:screenshot", |
| "//src/developer/forensics/utils:archive", |
| "//src/lib/fostr/fidl/fuchsia.math", |
| "//src/lib/fsl", |
| "//src/lib/fxl", |
| "//src/lib/timekeeper:testing", |
| "//src/lib/uuid:uuid", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//third_party/rapidjson", |
| "//zircon/system/ulib/zx", |
| ] |
| |
| # TODO(https://fxbug.dev/42136089): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| executable("inspect_data_budget_unittest_exe") { |
| testonly = true |
| |
| sources = [ "inspect_data_budget_unittest.cc" ] |
| |
| deps = [ |
| "//src/developer/forensics/feedback_data:constants", |
| "//src/developer/forensics/feedback_data:inspect_budget", |
| "//src/developer/forensics/testing:gtest_with_syslog_main", |
| "//src/developer/forensics/testing:unit_test_fixture", |
| "//src/lib/files", |
| "//src/lib/timekeeper:testing", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| |
| # TODO(https://fxbug.dev/42136089): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| executable("log_source_unittest_exe") { |
| testonly = true |
| |
| sources = [ "log_source_unittest.cc" ] |
| |
| deps = [ |
| "//sdk/lib/sys/cpp/testing:cpp", |
| "//src/developer/forensics/feedback_data:log_source", |
| "//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:diagnostics", |
| "//src/developer/forensics/utils:logs", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| executable("metadata_unittest_exe") { |
| testonly = true |
| |
| sources = [ "metadata_unittest.cc" ] |
| |
| deps = [ |
| "//sdk/lib/fit-promise", |
| "//sdk/lib/syslog/cpp", |
| "//src/developer/forensics/feedback/attachments", |
| "//src/developer/forensics/feedback_data:constants", |
| "//src/developer/forensics/feedback_data:metadata", |
| "//src/developer/forensics/testing:unit_test_fixture", |
| "//src/developer/forensics/testing/stubs:utc_clock_ready_watcher", |
| "//src/developer/forensics/utils:errors", |
| "//src/developer/forensics/utils/redact", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/timekeeper:testing", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//third_party/rapidjson", |
| ] |
| } |
| |
| executable("screenshot_unittest_exe") { |
| testonly = true |
| |
| sources = [ "screenshot_unittest.cc" ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.images:fuchsia.images_hlcpp", |
| "//src/developer/forensics/feedback_data:screenshot", |
| "//src/developer/forensics/testing:gtest_with_syslog_main", |
| "//src/developer/forensics/testing:unit_test_fixture", |
| "//src/developer/forensics/testing/stubs:screenshot", |
| "//src/lib/fxl", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/system/ulib/async:async-cpp", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| ############################################################################### |
| # RESOURCES |
| ############################################################################### |
| resource("test_image") { |
| sources = |
| [ "//src/developer/forensics/testing/resources/checkerboard_100.png" ] |
| |
| outputs = [ "data/checkerboard_100.png" ] |
| } |
| |
| ############################################################################### |
| # COMPONENTS |
| ############################################################################### |
| fuchsia_test_component("data_provider_unittest") { |
| manifest = "meta/data_provider_unittest.cml" |
| |
| deps = [ |
| ":data_provider_unittest_exe", |
| ":test_image", |
| ] |
| test_type = "system" |
| } |
| |
| fuchsia_unittest_component("inspect_data_budget_unittest") { |
| deps = [ |
| ":inspect_data_budget_unittest_exe", |
| "//src/sys/test_runners:tmp_storage", |
| ] |
| } |
| |
| fuchsia_unittest_component("log_source_unittest") { |
| deps = [ ":log_source_unittest_exe" ] |
| } |
| |
| fuchsia_component("metadata_unittest") { |
| testonly = true |
| |
| manifest = "meta/metadata_unittest.cml" |
| |
| deps = [ ":metadata_unittest_exe" ] |
| } |
| |
| fuchsia_unittest_component("screenshot_unittest") { |
| deps = [ |
| ":screenshot_unittest_exe", |
| "//src/sys/test_runners/gtest:death_test", |
| ] |
| } |
| |
| ############################################################################### |
| # PACKAGES |
| ############################################################################### |
| fuchsia_test_package("feedback-data-tests") { |
| test_components = [ |
| ":data_provider_unittest", |
| ":inspect_data_budget_unittest", |
| ":log_source_unittest", |
| ":metadata_unittest", |
| ":screenshot_unittest", |
| ] |
| |
| test_specs = { |
| log_settings = { |
| max_severity = "FATAL" |
| } |
| } |
| } |
| |
| ############################################################################### |
| # GROUPS |
| ############################################################################### |
| group("tests") { |
| testonly = true |
| |
| deps = [ ":feedback-data-tests" ] |
| |
| visibility += [ "//src/developer/forensics:tests" ] |
| } |