| # 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("//src/sys/build/components.gni") |
| |
| ############################################################################### |
| # EXECUTABLES |
| ############################################################################### |
| executable("last_reboot_info_provider_unittest_exe") { |
| testonly = true |
| |
| # "last_reboot_info_provider_unittest" is also used by feedback-data. |
| output_dir = target_out_dir |
| |
| sources = [ "last_reboot_info_provider_unittest.cc" ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.feedback", |
| "//src/developer/forensics/last_reboot:last_reboot_info_provider", |
| "//src/developer/forensics/last_reboot:reboot_reason", |
| "//src/developer/forensics/testing:gpretty_printers", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| executable("main_service_unittest_exe") { |
| testonly = true |
| |
| # "main_service_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 = [ "main_service_unittest.cc" ] |
| |
| deps = [ |
| "//sdk/lib/syslog/cpp", |
| "//src/developer/forensics/last_reboot: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/testing/stubs:reboot_methods_watcher_register", |
| "//src/lib/files", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/system/ulib/inspect", |
| ] |
| } |
| |
| executable("reboot_log_unittest_exe") { |
| testonly = true |
| |
| sources = [ "reboot_log_unittest.cc" ] |
| |
| deps = [ |
| "//sdk/lib/syslog/cpp", |
| "//src/developer/forensics/last_reboot:reboot_log", |
| "//src/developer/forensics/last_reboot:reboot_watcher", |
| "//src/developer/forensics/testing:gpretty_printers", |
| "//src/developer/forensics/testing:gtest_with_syslog_main", |
| "//src/developer/forensics/testing:unit_test_fixture", |
| "//src/lib/files", |
| "//src/lib/fxl", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| executable("reboot_reason_unittest_exe") { |
| testonly = true |
| |
| sources = [ "reboot_reason_unittest.cc" ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.feedback", |
| "//src/developer/forensics/last_reboot:reboot_reason", |
| "//src/developer/forensics/utils/cobalt", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| executable("reboot_watcher_unittest_exe") { |
| testonly = true |
| |
| sources = [ "reboot_watcher_unittest.cc" ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.power.statecontrol", |
| "//src/developer/forensics/last_reboot:reboot_watcher", |
| "//src/developer/forensics/testing:gpretty_printers", |
| "//src/developer/forensics/testing:unit_test_fixture", |
| "//src/developer/forensics/testing/stubs:cobalt", |
| "//src/lib/files", |
| "//src/lib/fxl", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| executable("reporter_unittest_exe") { |
| testonly = true |
| |
| sources = [ "reporter_unittest.cc" ] |
| |
| deps = [ |
| "//src/developer/forensics/last_reboot:reporter", |
| "//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:crash_reporter", |
| "//src/developer/forensics/utils/cobalt", |
| "//src/lib/files", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/async-cpp", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| ############################################################################### |
| # COMPONENTS |
| ############################################################################### |
| fuchsia_component("last_reboot_info_provider_unittest") { |
| testonly = true |
| |
| manifest = "meta/last_reboot_info_provider_unittest.cmx" |
| |
| deps = [ ":last_reboot_info_provider_unittest_exe" ] |
| } |
| |
| fuchsia_component("main_service_unittest") { |
| testonly = true |
| |
| manifest = "meta/main_service_unittest.cmx" |
| |
| deps = [ ":main_service_unittest_exe" ] |
| } |
| |
| fuchsia_component("reboot_log_unittest") { |
| testonly = true |
| |
| manifest = "meta/reboot_log_unittest.cmx" |
| |
| deps = [ ":reboot_log_unittest_exe" ] |
| } |
| |
| fuchsia_component("reboot_reason_unittest") { |
| testonly = true |
| |
| manifest = "meta/reboot_reason_unittest.cmx" |
| |
| deps = [ ":reboot_reason_unittest_exe" ] |
| } |
| |
| fuchsia_component("reboot_watcher_unittest") { |
| testonly = true |
| |
| manifest = "meta/reboot_watcher_unittest.cmx" |
| |
| deps = [ ":reboot_watcher_unittest_exe" ] |
| } |
| |
| fuchsia_component("reporter_unittest") { |
| testonly = true |
| |
| manifest = "meta/reporter_unittest.cmx" |
| |
| deps = [ ":reporter_unittest_exe" ] |
| } |
| |
| ############################################################################### |
| # PACKAGES |
| ############################################################################### |
| fuchsia_test_package("last-reboot-tests") { |
| test_components = [ |
| ":last_reboot_info_provider_unittest", |
| ":main_service_unittest", |
| ":reboot_log_unittest", |
| ":reboot_reason_unittest", |
| ":reboot_watcher_unittest", |
| ":reporter_unittest", |
| ] |
| } |
| |
| ############################################################################### |
| # GROUPS |
| ############################################################################### |
| group("tests") { |
| testonly = true |
| |
| deps = [ ":last-reboot-tests" ] |
| } |