| # 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/config.gni") |
| import("//build/test/test_package.gni") |
| import("//build/testing/environments.gni") |
| import("//src/hwinfo/hwinfo_config.gni") |
| |
| ############################################################################### |
| # GROUPS |
| ############################################################################### |
| group("tests") { |
| testonly = true |
| |
| public_deps = [ |
| ":fake_hwinfo_board_config", |
| ":fake_hwinfo_product_config", |
| ":feedback-data-tests", |
| |
| # Packages for the components that we are injecting in the integration tests. |
| "//garnet/bin/sysmem_connector", |
| "//src/cobalt/bin/testing/mock_cobalt", |
| "//src/developer/feedback/feedback_data:feedback_agent", |
| "//src/developer/feedback/testing/fakes:fake-last-reboot-info-provider", |
| "//src/diagnostics/archivist", |
| "//src/graphics/bin/vulkan_loader", |
| "//src/hwinfo:tests", |
| "//src/sys/pkg/bin/system-update-checker", |
| ] |
| } |
| |
| ############################################################################### |
| # PACKAGES |
| ############################################################################### |
| test_package("feedback-data-tests") { |
| tests = [ |
| { |
| name = "board_info_provider_unittest" |
| }, |
| { |
| name = "channel_provider_unittest" |
| }, |
| { |
| # Binary name on the host. We prefix it with "data_provider" to reduce collisions. |
| name = "data_provider_config_unittest" |
| |
| # Component and binary name on the target. Confined to the package so no risk of collisions. |
| dest = "config_unittest" |
| }, |
| { |
| name = "data_provider_unittest" |
| }, |
| { |
| name = "data_register_unittest" |
| }, |
| { |
| name = "datastore_unittest" |
| }, |
| { |
| name = "device_id_provider_unittest" |
| }, |
| { |
| name = "feedback_data_integration_test" |
| |
| # We need to also test on real devices as we talk to a real Scenic service. |
| environments = basic_envs |
| }, |
| { |
| # Binary name on the host. We prefix it with "feedback_data" to reduce collisions. |
| name = "feedback_data_main_service_unittest" |
| |
| # Component and binary name on the target. Confined to the package so no risk of collisions. |
| dest = "main_service_unittest" |
| }, |
| { |
| name = "inspect_ptr_unittest" |
| }, |
| { |
| name = "integrity_reporter_unittest" |
| }, |
| { |
| name = "kernel_log_ptr_integration_test" |
| }, |
| { |
| # Binary name on the host. We prefix it with "feedback_data" to reduce collisions. |
| name = "feedback_data_last_reboot_info_provider_unittest" |
| |
| # Component and binary name on the target. Confined to the package so no risk of collisions. |
| dest = "last_reboot_info_provider_unittest" |
| }, |
| { |
| name = "product_info_provider_unittest" |
| }, |
| { |
| name = "screenshot_ptr_unittest" |
| }, |
| { |
| name = "system_log_ptr_unittest" |
| }, |
| { |
| name = "system_log_recorder_unittest" |
| }, |
| ] |
| |
| binaries = [ |
| # needed for feedback_data_integration_test |
| { |
| name = "inspect_exe" |
| }, |
| ] |
| |
| meta = [ |
| { |
| path = "meta/inspect_test_app.cmx" |
| dest = "inspect_test_app.cmx" |
| }, |
| ] |
| |
| resources = [ |
| # needed for data_provider_unittest |
| { |
| path = "//src/developer/feedback/testing/resources/checkerboard_100.png" |
| dest = "checkerboard_100.png" |
| }, |
| |
| # needed for config_unittest |
| { |
| path = "configs/valid.json" |
| dest = "valid_config.json" |
| }, |
| |
| # needed for config_unittest |
| { |
| path = "configs/valid_empty_list.json" |
| dest = "valid_config_empty_list.json" |
| }, |
| |
| # needed for config_unittest |
| { |
| path = "configs/bad_schema_duplicated_attachment_key.json" |
| dest = "bad_schema_duplicated_attachment_key_config.json" |
| }, |
| |
| # needed for config_unittest |
| { |
| path = "configs/bad_schema_spurious_field.json" |
| dest = "bad_schema_spurious_field_config.json" |
| }, |
| |
| # needed for config_unittest |
| { |
| path = "configs/bad_schema_missing_required_field.json" |
| dest = "bad_schema_missing_required_field_config.json" |
| }, |
| |
| # needed for main_service_unittest |
| { |
| path = "configs/main_service_unittest.json" |
| |
| # main_service.cc expects a config at /pkg/data/config.json |
| dest = "config.json" |
| }, |
| ] |
| |
| deps = [ |
| ":board_info_provider_unittest", |
| ":channel_provider_unittest", |
| ":config_unittest", |
| ":data_provider_unittest", |
| ":data_register_unittest", |
| ":datastore_unittest", |
| ":device_id_provider_unittest", |
| ":feedback_data_integration_test", |
| ":inspect_exe", |
| ":inspect_ptr_unittest", |
| ":integrity_reporter_unittest", |
| ":kernel_log_ptr_integration_test", |
| ":last_reboot_info_provider_unittest", |
| ":main_service_unittest", |
| ":product_info_provider_unittest", |
| ":screenshot_ptr_unittest", |
| ":system_log_ptr_unittest", |
| ":system_log_recorder_unittest", |
| ] |
| } |
| |
| ############################################################################### |
| # EXECUTABLES |
| ############################################################################### |
| executable("board_info_provider_unittest") { |
| testonly = true |
| |
| sources = [ "board_info_provider_unittest.cc" ] |
| |
| deps = [ |
| "//src/developer/feedback/feedback_data:constants", |
| "//src/developer/feedback/feedback_data/annotations:board_info_provider", |
| "//src/developer/feedback/testing:cobalt_test_fixture", |
| "//src/developer/feedback/testing:gtest_with_syslog_main", |
| "//src/developer/feedback/testing:unit_test_fixture", |
| "//src/developer/feedback/testing/stubs:board_info_provider", |
| "//src/developer/feedback/testing/stubs:cobalt", |
| "//src/lib/fxl", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/async-cpp", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| executable("channel_provider_unittest") { |
| testonly = true |
| |
| sources = [ "channel_provider_unittest.cc" ] |
| |
| deps = [ |
| "//sdk/lib/syslog/cpp", |
| "//src/developer/feedback/feedback_data:constants", |
| "//src/developer/feedback/feedback_data/annotations:channel_provider", |
| "//src/developer/feedback/feedback_data/annotations:types", |
| "//src/developer/feedback/testing:cobalt_test_fixture", |
| "//src/developer/feedback/testing:gtest_with_syslog_main", |
| "//src/developer/feedback/testing:unit_test_fixture", |
| "//src/developer/feedback/testing/stubs:channel_provider", |
| "//src/developer/feedback/testing/stubs:cobalt", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/async-cpp", |
| "//zircon/public/lib/fit", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| executable("config_unittest") { |
| testonly = true |
| |
| output_name = "data_provider_config_unittest" |
| |
| sources = [ "config_unittest.cc" ] |
| |
| deps = [ |
| "//src/developer/feedback/feedback_data:config", |
| "//src/developer/feedback/testing:gtest_with_syslog_main", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| executable("data_provider_unittest") { |
| testonly = true |
| |
| sources = [ "data_provider_unittest.cc" ] |
| |
| deps = [ |
| "//garnet/public/lib/fostr/fidl/fuchsia.math", |
| "//sdk/fidl/fuchsia.feedback", |
| "//sdk/fidl/fuchsia.math", |
| "//sdk/fidl/fuchsia.sys", |
| "//sdk/lib/fidl/cpp", |
| "//src/developer/feedback/feedback_data:constants", |
| "//src/developer/feedback/feedback_data:data_provider", |
| "//src/developer/feedback/feedback_data:device_id_provider", |
| "//src/developer/feedback/feedback_data:integrity_reporter", |
| "//src/developer/feedback/feedback_data/annotations:types", |
| "//src/developer/feedback/feedback_data/attachments:types", |
| "//src/developer/feedback/testing:cobalt_test_fixture", |
| "//src/developer/feedback/testing:gmatchers", |
| "//src/developer/feedback/testing:gpretty_printers", |
| "//src/developer/feedback/testing:gtest_with_syslog_main", |
| "//src/developer/feedback/testing:unit_test_fixture", |
| "//src/developer/feedback/testing/stubs:cobalt", |
| "//src/developer/feedback/testing/stubs:scenic", |
| "//src/developer/feedback/utils:archive", |
| "//src/lib/fsl", |
| "//src/lib/fxl", |
| "//src/lib/timekeeper:testing", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//third_party/rapidjson", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| executable("data_register_unittest") { |
| testonly = true |
| |
| sources = [ "data_register_unittest.cc" ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.feedback", |
| "//src/developer/feedback/feedback_data:data_register", |
| "//src/developer/feedback/testing:gtest_with_syslog_main", |
| "//src/developer/feedback/testing:unit_test_fixture", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| executable("datastore_unittest") { |
| testonly = true |
| |
| sources = [ "datastore_unittest.cc" ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.hwinfo", |
| "//sdk/fidl/fuchsia.intl", |
| "//src/developer/feedback/feedback_data:constants", |
| "//src/developer/feedback/feedback_data:datastore", |
| "//src/developer/feedback/feedback_data:device_id_provider", |
| "//src/developer/feedback/feedback_data/annotations:types", |
| "//src/developer/feedback/feedback_data/attachments:types", |
| "//src/developer/feedback/testing:cobalt_test_fixture", |
| "//src/developer/feedback/testing:gmatchers", |
| "//src/developer/feedback/testing:gtest_with_syslog_main", |
| "//src/developer/feedback/testing:unit_test_fixture", |
| "//src/developer/feedback/testing/stubs:board_info_provider", |
| "//src/developer/feedback/testing/stubs:channel_provider", |
| "//src/developer/feedback/testing/stubs:cobalt", |
| "//src/developer/feedback/testing/stubs:inspect", |
| "//src/developer/feedback/testing/stubs:last_reboot_info_provider", |
| "//src/developer/feedback/testing/stubs:logger", |
| "//src/developer/feedback/testing/stubs:product_info_provider", |
| "//src/developer/feedback/utils:files", |
| "//src/developer/feedback/utils:time", |
| "//src/lib/files", |
| "//src/lib/fxl", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/async-cpp", |
| "//zircon/public/lib/fit", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| executable("device_id_provider_unittest") { |
| testonly = true |
| |
| sources = [ "device_id_provider_unittest.cc" ] |
| |
| deps = [ |
| "//src/developer/feedback/feedback_data:device_id_provider", |
| "//src/developer/feedback/feedback_data/annotations:types", |
| "//src/developer/feedback/testing:gtest_with_syslog_main", |
| "//src/developer/feedback/utils:errors", |
| "//src/lib/files:files", |
| "//src/lib/uuid:uuid", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| executable("feedback_data_integration_test") { |
| testonly = true |
| |
| sources = [ "feedback_data_integration_test.cc" ] |
| |
| deps = [ |
| ":zx_object_util", |
| "//garnet/public/lib/fostr/fidl/fuchsia.feedback", |
| "//sdk/fidl/fuchsia.cobalt", |
| "//sdk/fidl/fuchsia.cobalt.test", |
| "//sdk/fidl/fuchsia.feedback", |
| "//sdk/fidl/fuchsia.hwinfo", |
| "//sdk/fidl/fuchsia.logger", |
| "//sdk/fidl/fuchsia.sys", |
| "//sdk/fidl/fuchsia.update.channel", |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/inspect/contrib/cpp:archive_reader", |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/sys/cpp/testing:integration", |
| "//sdk/lib/syslog/cpp", |
| "//src/developer/feedback/feedback_data:constants", |
| "//src/developer/feedback/testing:gmatchers", |
| "//src/developer/feedback/testing/fakes:cobalt", |
| "//src/developer/feedback/utils:archive", |
| "//src/developer/feedback/utils/cobalt", |
| "//src/lib/fsl", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/uuid:uuid", |
| "//src/ui/lib/escher/test/common:gtest_vulkan", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//third_party/rapidjson", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| executable("main_service_unittest") { |
| testonly = true |
| |
| output_name = "feedback_data_main_service_unittest" |
| |
| sources = [ "main_service_unittest.cc" ] |
| |
| deps = [ |
| "//sdk/lib/inspect/testing/cpp", |
| "//sdk/lib/syslog/cpp", |
| "//src/developer/feedback/feedback_data:main_service", |
| "//src/developer/feedback/testing:cobalt_test_fixture", |
| "//src/developer/feedback/testing:gtest_with_syslog_main", |
| "//src/developer/feedback/testing:unit_test_fixture", |
| "//src/developer/feedback/testing/stubs:cobalt", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/system/ulib/inspect", |
| ] |
| } |
| |
| executable("inspect_exe") { |
| testonly = true |
| |
| sources = [ "inspect_exe.cc" ] |
| |
| deps = [ |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/sys/inspect/cpp", |
| "//src/lib/fxl", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| executable("inspect_ptr_unittest") { |
| testonly = true |
| |
| sources = [ "inspect_ptr_unittest.cc" ] |
| |
| deps = [ |
| "//sdk/lib/sys/cpp/testing:integration", |
| "//src/developer/feedback/feedback_data/attachments:attachment_providers", |
| "//src/developer/feedback/feedback_data/attachments:types", |
| "//src/developer/feedback/testing:gpretty_printers", |
| "//src/developer/feedback/testing:gtest_with_syslog_main", |
| "//src/developer/feedback/testing:unit_test_fixture", |
| "//src/developer/feedback/testing/stubs:inspect", |
| "//src/developer/feedback/utils:errors", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| executable("integrity_reporter_unittest") { |
| testonly = true |
| |
| sources = [ "integrity_reporter_unittest.cc" ] |
| |
| deps = [ |
| "//sdk/lib/syslog/cpp", |
| "//src/developer/feedback/feedback_data:integrity_reporter", |
| "//src/developer/feedback/feedback_data/annotations:types", |
| "//src/developer/feedback/feedback_data/attachments:types", |
| "//src/developer/feedback/utils:errors", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//third_party/rapidjson", |
| "//zircon/public/lib/fit", |
| ] |
| } |
| |
| executable("kernel_log_ptr_integration_test") { |
| testonly = true |
| |
| sources = [ "kernel_log_ptr_integration_test.cc" ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.boot:fuchsia.boot_c", |
| "//sdk/lib/sys/cpp/testing:integration", |
| "//src/developer/feedback/feedback_data/attachments:attachment_providers", |
| "//src/developer/feedback/feedback_data/attachments:types", |
| "//src/developer/feedback/utils:errors", |
| "//src/lib/fxl", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| executable("last_reboot_info_provider_unittest") { |
| testonly = true |
| |
| output_name = "feedback_data_last_reboot_info_provider_unittest" |
| |
| sources = [ "last_reboot_info_provider_unittest.cc" ] |
| |
| deps = [ |
| "//src/developer/feedback/feedback_data:constants", |
| "//src/developer/feedback/feedback_data/annotations:last_reboot_info_provider", |
| "//src/developer/feedback/feedback_data/annotations:types", |
| "//src/developer/feedback/testing:cobalt_test_fixture", |
| "//src/developer/feedback/testing:gtest_with_syslog_main", |
| "//src/developer/feedback/testing:unit_test_fixture", |
| "//src/developer/feedback/testing/stubs:cobalt", |
| "//src/developer/feedback/testing/stubs:last_reboot_info_provider", |
| "//src/developer/feedback/utils:time", |
| "//src/lib/fxl", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/async-cpp", |
| ] |
| } |
| |
| executable("product_info_provider_unittest") { |
| testonly = true |
| |
| sources = [ "product_info_provider_unittest.cc" ] |
| |
| deps = [ |
| "//src/developer/feedback/feedback_data:constants", |
| "//src/developer/feedback/feedback_data/annotations:product_info_provider", |
| "//src/developer/feedback/testing:cobalt_test_fixture", |
| "//src/developer/feedback/testing:gtest_with_syslog_main", |
| "//src/developer/feedback/testing:unit_test_fixture", |
| "//src/developer/feedback/testing/stubs:cobalt", |
| "//src/developer/feedback/testing/stubs:product_info_provider", |
| "//src/developer/feedback/utils:errors", |
| "//src/lib/fxl", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/async-cpp", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| executable("screenshot_ptr_unittest") { |
| testonly = true |
| |
| sources = [ "screenshot_ptr_unittest.cc" ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.ui.scenic", |
| "//src/developer/feedback/feedback_data/attachments:attachment_providers", |
| "//src/developer/feedback/testing:gtest_with_syslog_main", |
| "//src/developer/feedback/testing:unit_test_fixture", |
| "//src/developer/feedback/testing/stubs:scenic", |
| "//src/lib/fxl", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/async-cpp", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| executable("system_log_ptr_unittest") { |
| testonly = true |
| |
| sources = [ "system_log_ptr_unittest.cc" ] |
| |
| deps = [ |
| "//garnet/public/lib/fostr/fidl/fuchsia.mem", |
| "//src/developer/feedback/feedback_data/attachments:attachment_providers", |
| "//src/developer/feedback/feedback_data/attachments:types", |
| "//src/developer/feedback/testing:gmatchers", |
| "//src/developer/feedback/testing:gpretty_printers", |
| "//src/developer/feedback/testing:gtest_with_syslog_main", |
| "//src/developer/feedback/testing:unit_test_fixture", |
| "//src/developer/feedback/testing/stubs:logger", |
| "//src/developer/feedback/utils:errors", |
| "//src/lib/fxl", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/async-cpp", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| executable("system_log_recorder_unittest") { |
| testonly = true |
| |
| sources = [ "system_log_recorder_unittest.cc" ] |
| |
| deps = [ |
| "//src/developer/feedback/feedback_data/attachments:types", |
| "//src/developer/feedback/feedback_data/system_log_recorder:src", |
| "//src/developer/feedback/testing:gmatchers", |
| "//src/developer/feedback/testing:gpretty_printers", |
| "//src/developer/feedback/testing:gtest_with_syslog_main", |
| "//src/developer/feedback/testing:unit_test_fixture", |
| "//src/developer/feedback/testing/stubs:logger", |
| "//src/developer/feedback/utils:errors", |
| "//src/developer/feedback/utils:files", |
| "//src/lib/files", |
| "//src/lib/fxl", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/async-cpp", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| ############################################################################### |
| # SOURCES |
| ############################################################################### |
| source_set("zx_object_util") { |
| sources = [ |
| "zx_object_util.cc", |
| "zx_object_util.h", |
| ] |
| |
| public_deps = [ |
| "//sdk/lib/syslog/cpp", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| ############################################################################### |
| # CONFIGS |
| ############################################################################### |
| hwinfo_config_validate("fake_hwinfo_product_config_validate") { |
| type = "product" |
| config = "configs/hwinfo_product_config.json" |
| } |
| |
| hwinfo_config_validate("fake_hwinfo_board_config_validate") { |
| type = "board" |
| config = "configs/hwinfo_board_config.json" |
| } |
| |
| config_data("fake_hwinfo_product_config") { |
| for_pkg = "fake_hwinfo" |
| |
| sources = [ rebase_path("configs/hwinfo_product_config.json") ] |
| |
| outputs = [ "product_config.json" ] |
| |
| deps = [ ":fake_hwinfo_product_config_validate" ] |
| } |
| |
| config_data("fake_hwinfo_board_config") { |
| for_pkg = "fake_hwinfo" |
| |
| sources = [ rebase_path("configs/hwinfo_board_config.json") ] |
| |
| outputs = [ "board_config.json" ] |
| |
| deps = [ ":fake_hwinfo_board_config_validate" ] |
| } |
| |
| config_data("fake_hwinfo_factory_config") { |
| for_pkg = "fake_factory_store_providers" |
| |
| sources = [ "configs/hwinfo_factory_config.json" ] |
| |
| outputs = [ "fuchsia.factory.MiscFactoryStoreProvider.config" ] |
| } |