| # Copyright 2018 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 |
| deps = [ |
| ":config_unittest", |
| ":crasher_exe", |
| ":crashpad_agent_integration_test", |
| ":crashpad_agent_tests", |
| ":crashpad_agent_unittest", |
| ] |
| } |
| |
| test_package("crashpad_agent_tests") { |
| tests = [ |
| { |
| name = "crashpad_agent_unittest" |
| environments = basic_envs |
| }, |
| { |
| name = "crashpad_config_unittest" |
| environments = basic_envs |
| }, |
| { |
| name = "crashpad_agent_integration_test" |
| environments = basic_envs |
| }, |
| ] |
| |
| binaries = [ |
| # needed for crashpad_agent_impl_unittest |
| { |
| name = "crasher_exe" |
| }, |
| ] |
| |
| resources = [ |
| # needed for crashpad_config_unittest |
| { |
| path = "configs/valid_no_upload.json" |
| dest = "valid_config_no_upload.json" |
| }, |
| |
| # needed for crashpad_config_unittest |
| { |
| path = "configs/valid_upload.json" |
| dest = "valid_config_upload.json" |
| }, |
| |
| # needed for crashpad_config_unittest |
| { |
| path = "configs/valid_no_upload_spurious_server.json" |
| dest = "valid_config_no_upload_spurious_server.json" |
| }, |
| |
| # needed for crashpad_config_unittest |
| { |
| path = "configs/bad_schema_spurious_field.json" |
| dest = "bad_schema_spurious_field_config.json" |
| }, |
| |
| # needed for crashpad_config_unittest |
| { |
| path = "configs/bad_schema_missing_required_field.json" |
| dest = "bad_schema_missing_required_field_config.json" |
| }, |
| |
| # needed for crashpad_config_unittest |
| { |
| path = "configs/bad_schema_missing_server.json" |
| dest = "bad_schema_missing_server_config.json" |
| }, |
| ] |
| |
| deps = [ |
| ":config_unittest", |
| ":crasher_exe", |
| ":crashpad_agent_integration_test", |
| ":crashpad_agent_unittest", |
| ] |
| } |
| |
| executable("config_unittest") { |
| testonly = true |
| |
| output_name = "crashpad_config_unittest" |
| |
| sources = [ |
| "config_unittest.cc", |
| ] |
| |
| deps = [ |
| "//garnet/public/lib/syslog/cpp", |
| "//src/developer/crashpad_agent:src", |
| "//third_party/googletest:gtest_main", |
| ] |
| } |
| |
| executable("crasher_exe") { |
| testonly = true |
| |
| sources = [ |
| "crasher_exe.cc", |
| ] |
| } |
| |
| executable("crashpad_agent_unittest") { |
| testonly = true |
| |
| sources = [ |
| "crashpad_agent_unittest.cc", |
| "stub_crash_server.cc", |
| "stub_crash_server.h", |
| "stub_feedback_data_provider.cc", |
| "stub_feedback_data_provider.h", |
| ] |
| |
| deps = [ |
| "//garnet/public/lib/fsl", |
| "//garnet/public/lib/gtest", |
| "//garnet/public/lib/syslog/cpp", |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/sys/cpp/testing:unit", |
| "//src/developer/crashpad_agent:src", |
| "//src/lib/fxl", |
| "//third_party/crashpad/util", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest_main", |
| "//zircon/public/fidl/fuchsia-crash", |
| "//zircon/public/fidl/fuchsia-mem", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| executable("crashpad_agent_integration_test") { |
| testonly = true |
| |
| sources = [ |
| "crashpad_agent_integration_test.cc", |
| ] |
| |
| deps = [ |
| "//garnet/public/lib/fsl", |
| "//sdk/lib/sys/cpp", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gtest", |
| "//zircon/public/fidl/fuchsia-crash", |
| "//zircon/public/fidl/fuchsia-mem", |
| "//zircon/public/lib/zx", |
| ] |
| } |