| # 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_agent_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_agent", |
| "//src/diagnostics/archivist", |
| "//src/graphics/bin/vulkan_loader", |
| "//src/hwinfo:tests", |
| "//src/sys/pkg/bin/system-update-checker", |
| ] |
| } |
| |
| ############################################################################### |
| # PACKAGES |
| ############################################################################### |
| test_package("feedback_agent_tests") { |
| tests = [ |
| { |
| name = "board_info_provider_unittest" |
| }, |
| { |
| name = "channel_provider_unittest" |
| }, |
| { |
| name = "data_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 = "feedback_agent_integration_test" |
| |
| # We need to also test on real devices as we talk to a real Scenic service. |
| environments = basic_envs |
| }, |
| { |
| name = "feedback_id_provider_unittest" |
| }, |
| { |
| name = "feedback_id_unittest" |
| }, |
| { |
| name = "inspect_ptr_unittest" |
| }, |
| { |
| name = "kernel_log_ptr_integration_test" |
| }, |
| { |
| name = "system_log_recorder_unittest" |
| }, |
| { |
| name = "product_info_provider_unittest" |
| }, |
| { |
| name = "screenshot_ptr_unittest" |
| }, |
| { |
| name = "single_sync_annotation_provider_unittest" |
| }, |
| { |
| name = "system_log_ptr_unittest" |
| }, |
| ] |
| |
| binaries = [ |
| # needed for data_provider_unittest and inspect_ptr_unittest |
| { |
| 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" |
| }, |
| ] |
| |
| deps = [ |
| ":board_info_provider_unittest", |
| ":channel_provider_unittest", |
| ":config_unittest", |
| ":data_provider_unittest", |
| ":feedback_agent_integration_test", |
| ":feedback_id_provider_unittest", |
| ":feedback_id_unittest", |
| ":inspect_exe", |
| ":inspect_ptr_unittest", |
| ":kernel_log_ptr_integration_test", |
| ":product_info_provider_unittest", |
| ":screenshot_ptr_unittest", |
| ":single_sync_annotation_provider_unittest", |
| ":system_log_ptr_unittest", |
| ":system_log_recorder_unittest", |
| ] |
| } |
| |
| ############################################################################### |
| # EXECUTABLES |
| ############################################################################### |
| executable("board_info_provider_unittest") { |
| testonly = true |
| |
| sources = [ "board_info_provider_unittest.cc" ] |
| |
| deps = [ |
| ":stub_board", |
| "//src/developer/feedback/feedback_agent:constants", |
| "//src/developer/feedback/feedback_agent/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:stub_cobalt_logger_factory", |
| "//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 = [ |
| ":stub_channel_provider", |
| "//src/developer/feedback/feedback_agent:data_provider", |
| "//src/developer/feedback/feedback_agent/annotations:channel_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:stub_cobalt_logger_factory", |
| "//src/lib/fxl", |
| "//src/lib/syslog/cpp", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/async-cpp", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| executable("config_unittest") { |
| testonly = true |
| |
| output_name = "data_provider_config_unittest" |
| |
| sources = [ "config_unittest.cc" ] |
| |
| deps = [ |
| "//src/developer/feedback/feedback_agent:data_provider", |
| "//src/developer/feedback/testing:gtest_with_syslog_main", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/zx", |
| ] |
| |
| # TODO(46560): Fix the leaks and remove this. |
| deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ] |
| } |
| |
| executable("data_provider_unittest") { |
| testonly = true |
| |
| sources = [ "data_provider_unittest.cc" ] |
| |
| deps = [ |
| ":stub_board", |
| ":stub_channel_provider", |
| ":stub_inspect", |
| ":stub_logger", |
| ":stub_product", |
| ":stub_scenic", |
| "//garnet/public/lib/fostr/fidl/fuchsia.math", |
| "//garnet/public/lib/timekeeper:testing", |
| "//sdk/fidl/fuchsia.feedback", |
| "//sdk/fidl/fuchsia.math", |
| "//sdk/fidl/fuchsia.sys", |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/sys/cpp/testing:integration", |
| "//src/developer/feedback/feedback_agent:constants", |
| "//src/developer/feedback/feedback_agent:data_provider", |
| "//src/developer/feedback/feedback_agent:feedback_id", |
| "//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:stub_cobalt_logger_factory", |
| "//src/developer/feedback/utils:archive", |
| "//src/lib/files", |
| "//src/lib/fsl", |
| "//src/lib/fxl", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//third_party/rapidjson", |
| "//zircon/public/lib/zx", |
| ] |
| |
| # TODO(46560): Fix the leaks and remove this. |
| deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ] |
| } |
| |
| executable("feedback_agent_integration_test") { |
| testonly = true |
| |
| sources = [ "feedback_agent_integration_test.cc" ] |
| |
| deps = [ |
| ":zx_object_util", |
| "//garnet/public/lib/fostr/fidl/fuchsia.feedback", |
| "//garnet/public/lib/gtest", |
| "//sdk/fidl/fuchsia.cobalt.test", |
| "//sdk/fidl/fuchsia.feedback", |
| "//sdk/fidl/fuchsia.hwinfo", |
| "//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", |
| "//src/developer/feedback/feedback_agent:constants", |
| "//src/developer/feedback/feedback_agent:feedback_agent_src", |
| "//src/developer/feedback/testing:fake_cobalt", |
| "//src/developer/feedback/testing:gmatchers", |
| "//src/developer/feedback/utils:archive", |
| "//src/developer/feedback/utils:cobalt", |
| "//src/lib/fsl", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/syslog/cpp", |
| "//src/ui/lib/escher/test:gtest_vulkan", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//third_party/rapidjson", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/zx", |
| "//zircon/system/fidl/fuchsia-cobalt", |
| "//zircon/system/fidl/fuchsia-logger", |
| ] |
| |
| # TODO(46560): Fix the leaks and remove this. |
| deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ] |
| } |
| |
| executable("feedback_id_provider_unittest") { |
| testonly = true |
| |
| sources = [ "feedback_id_provider_unittest.cc" ] |
| |
| deps = [ |
| "//src/developer/feedback/feedback_agent:constants", |
| "//src/developer/feedback/feedback_agent/annotations:feedback_id_provider", |
| "//src/developer/feedback/testing:gtest_with_syslog_main", |
| "//src/lib/files:files", |
| "//src/lib/uuid:uuid", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| executable("feedback_id_unittest") { |
| testonly = true |
| |
| sources = [ "feedback_id_unittest.cc" ] |
| |
| deps = [ |
| "//src/developer/feedback/feedback_agent:feedback_id", |
| "//src/developer/feedback/testing:gtest_with_syslog_main", |
| "//src/lib/files:files", |
| "//src/lib/uuid:uuid", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| |
| # TODO(46560): Fix the leaks and remove this. |
| deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ] |
| } |
| |
| executable("inspect_exe") { |
| testonly = true |
| |
| sources = [ "inspect_exe.cc" ] |
| |
| deps = [ |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/sys/inspect/cpp", |
| "//src/lib/fxl", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/async-loop-default", |
| ] |
| } |
| |
| executable("inspect_ptr_unittest") { |
| testonly = true |
| |
| sources = [ "inspect_ptr_unittest.cc" ] |
| |
| deps = [ |
| ":stub_inspect", |
| "//sdk/lib/sys/cpp/testing:integration", |
| "//src/developer/feedback/feedback_agent/attachments:attachment_providers", |
| "//src/developer/feedback/testing:cobalt_test_fixture", |
| "//src/developer/feedback/testing:gtest_with_syslog_main", |
| "//src/developer/feedback/testing/stubs:stub_cobalt_logger_factory", |
| "//src/lib/fsl", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| executable("kernel_log_ptr_integration_test") { |
| testonly = true |
| |
| sources = [ "kernel_log_ptr_integration_test.cc" ] |
| |
| deps = [ |
| "//sdk/lib/sys/cpp/testing:integration", |
| "//src/developer/feedback/feedback_agent/attachments:attachment_providers", |
| "//src/developer/feedback/testing/:cobalt_test_fixture", |
| "//src/developer/feedback/testing/stubs:stub_cobalt_logger_factory", |
| "//src/lib/fsl", |
| "//src/lib/fxl", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/zx", |
| "//zircon/system/fidl/fuchsia-boot:fuchsia-boot_c", |
| ] |
| } |
| |
| executable("product_info_provider_unittest") { |
| testonly = true |
| |
| sources = [ "product_info_provider_unittest.cc" ] |
| |
| deps = [ |
| ":stub_product", |
| "//src/developer/feedback/feedback_agent:constants", |
| "//src/developer/feedback/feedback_agent/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:stub_cobalt_logger_factory", |
| "//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 = [ |
| ":stub_scenic", |
| "//sdk/fidl/fuchsia.ui.scenic", |
| "//src/developer/feedback/feedback_agent/attachments:attachment_providers", |
| "//src/developer/feedback/testing:gtest_with_syslog_main", |
| "//src/developer/feedback/testing:unit_test_fixture", |
| "//src/developer/feedback/testing/:cobalt_test_fixture", |
| "//src/developer/feedback/testing/stubs:stub_cobalt_logger_factory", |
| "//src/lib/fxl", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/async-cpp", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| executable("single_sync_annotation_provider_unittest") { |
| testonly = true |
| |
| sources = [ "single_sync_annotation_provider_unittest.cc" ] |
| |
| deps = [ |
| "//src/developer/feedback/feedback_agent/annotations:single_sync_annotation_provider", |
| "//src/developer/feedback/testing:gtest_with_syslog_main", |
| "//src/developer/feedback/testing:unit_test_fixture", |
| "//src/lib/fxl", |
| "//src/lib/syslog/cpp", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/async-cpp", |
| ] |
| } |
| |
| executable("system_log_ptr_unittest") { |
| testonly = true |
| |
| sources = [ "system_log_ptr_unittest.cc" ] |
| |
| deps = [ |
| ":stub_logger", |
| "//garnet/public/lib/fostr/fidl/fuchsia.mem", |
| "//src/developer/feedback/feedback_agent/attachments:attachment_providers", |
| "//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:stub_cobalt_logger_factory", |
| "//src/lib/fsl", |
| "//src/lib/fxl", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/async-cpp", |
| "//zircon/public/lib/zx", |
| "//zircon/system/fidl/fuchsia-mem", |
| ] |
| } |
| |
| executable("system_log_recorder_unittest") { |
| testonly = true |
| |
| sources = [ "system_log_recorder_unittest.cc" ] |
| |
| deps = [ |
| ":stub_logger", |
| "//src/developer/feedback/feedback_agent: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/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", |
| ] |
| |
| # TODO(46560): Fix the leaks and remove this. |
| deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ] |
| } |
| |
| ############################################################################### |
| # SOURCES |
| ############################################################################### |
| source_set("stub_board") { |
| sources = [ |
| "stub_board.cc", |
| "stub_board.h", |
| ] |
| |
| public_deps = [ |
| "//sdk/fidl/fuchsia.hwinfo", |
| "//sdk/lib/fidl/cpp", |
| ] |
| } |
| |
| source_set("stub_channel_provider") { |
| sources = [ |
| "stub_channel_provider.cc", |
| "stub_channel_provider.h", |
| ] |
| |
| public_deps = [ |
| "//sdk/fidl/fuchsia.update.channel", |
| "//sdk/lib/fidl/cpp", |
| ] |
| } |
| |
| source_set("stub_inspect") { |
| sources = [ |
| "stub_inspect_archive.cc", |
| "stub_inspect_archive.h", |
| "stub_inspect_batch_iterator.cc", |
| "stub_inspect_batch_iterator.h", |
| ] |
| |
| public_deps = [ |
| "//sdk/fidl/fuchsia.diagnostics", |
| "//sdk/lib/fidl/cpp", |
| "//src/lib/fsl", |
| "//src/lib/fxl", |
| ] |
| } |
| |
| source_set("stub_logger") { |
| sources = [ |
| "stub_logger.cc", |
| "stub_logger.h", |
| ] |
| |
| public_deps = [ |
| "//sdk/lib/fidl/cpp", |
| "//src/lib/syslog/cpp", |
| "//zircon/public/lib/zx", |
| "//zircon/system/fidl/fuchsia-logger", |
| ] |
| } |
| |
| source_set("stub_product") { |
| sources = [ |
| "stub_product.cc", |
| "stub_product.h", |
| ] |
| |
| public_deps = [ |
| "//sdk/fidl/fuchsia.hwinfo", |
| "//sdk/lib/fidl/cpp", |
| ] |
| } |
| |
| source_set("stub_scenic") { |
| sources = [ |
| "stub_scenic.cc", |
| "stub_scenic.h", |
| ] |
| |
| public_deps = [ |
| "//sdk/fidl/fuchsia.ui.scenic", |
| "//sdk/lib/fidl/cpp", |
| "//src/lib/fxl", |
| ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.images", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| source_set("zx_object_util") { |
| sources = [ |
| "zx_object_util.cc", |
| "zx_object_util.h", |
| ] |
| |
| public_deps = [ |
| "//src/lib/fxl", |
| "//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" ] |
| } |