| # 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/test/test_package.gni") |
| import("//build/testing/environments.gni") |
| |
| group("tests") { |
| testonly = true |
| |
| public_deps = [ |
| ":exception_broker_tests", |
| |
| # Packages for the components that we are injecting in the integration tests. |
| "//src/developer/exception_broker", |
| "//src/developer/feedback/testing/fakes:fake_crash_reporter", |
| ] |
| } |
| |
| test_package("exception_broker_config_tests") { |
| tests = [ |
| { |
| name = "exception_broker_config_test" |
| }, |
| ] |
| |
| deps = [ ":exception_broker_config_test" ] |
| |
| resources = [ |
| { |
| path = "configs/test_enable_jitd_on_startup.json" |
| dest = "enable_jitd_on_startup.json" |
| }, |
| ] |
| } |
| |
| test_package("exception_broker_tests") { |
| tests = [ |
| { |
| name = "exception_broker_unittest" |
| }, |
| { |
| name = "exception_broker_integration_test" |
| }, |
| { |
| name = "exception_broker_config_test" |
| }, |
| { |
| name = "limbo_client_unittest" |
| }, |
| ] |
| |
| # These are binaries needed by some tests. Mainly used to trigger exceptions. |
| binaries = [ |
| { |
| name = "exception_broker_crasher" |
| }, |
| ] |
| |
| deps = [ |
| ":crasher", |
| ":exception_broker_config_test", |
| ":exception_broker_integration_test", |
| ":exception_broker_unittest", |
| "//src/developer/exception_broker/limbo_client:tests", |
| ] |
| |
| resources = [ |
| { |
| path = "configs/test_enable_jitd_on_startup.json" |
| dest = "enable_jitd_on_startup.json" |
| }, |
| { |
| path = "configs/test_filter_jitd_config.json" |
| dest = "filter_jitd_config.json" |
| }, |
| ] |
| } |
| |
| # Utilities used for testing purposes. |
| source_set("test_lib") { |
| testonly = true |
| |
| sources = [ |
| "crasher_wrapper.cc", |
| "crasher_wrapper.h", |
| ] |
| |
| deps = [ |
| "//garnet/public/lib/fostr/fidl/fuchsia.exception", |
| "//src/lib/fsl", |
| "//src/lib/syslog/cpp", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| executable("exception_broker_unittest") { |
| testonly = true |
| |
| sources = [ |
| "crash_report_generation_unittest.cc", |
| "exception_broker_unittest.cc", |
| "process_limbo_manager_unittest.cc", |
| "unittest_main.cc", |
| ] |
| |
| deps = [ |
| ":test_lib", |
| "//garnet/public/lib/fostr/fidl/fuchsia.exception", |
| "//sdk/lib/sys/cpp/testing:unit", |
| "//src/developer/exception_broker:lib", |
| "//src/lib/fxl", |
| "//src/lib/fxl/test:test_settings", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| executable("exception_broker_integration_test") { |
| testonly = true |
| |
| sources = [ "exception_broker_integration_test.cc" ] |
| |
| deps = [ |
| ":test_lib", |
| "//src/developer/exception_broker:lib", |
| "//src/lib/fsl", |
| "//src/lib/fxl", |
| "//src/lib/fxl/test:test_settings", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| executable("exception_broker_config_test") { |
| testonly = true |
| |
| sources = [ "exception_broker_config_test.cc" ] |
| |
| deps = [ |
| "//sdk/lib/sys/cpp/testing:unit", |
| "//src/developer/exception_broker:lib", |
| "//src/lib/fsl", |
| "//src/lib/fxl", |
| "//src/lib/fxl/test:test_settings", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| executable("crasher") { |
| testonly = true |
| output_name = "exception_broker_crasher" |
| |
| sources = [ "crasher.cc" ] |
| } |