pbos@webrtc.org | af8d5af | 2013-07-09 08:02:33 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
Artem Titov | 40a7a35 | 2018-10-15 13:25:34 | [diff] [blame] | 11 | #include <memory> |
Oleh Prypin | 135aad0 | 2018-09-21 11:56:26 | [diff] [blame] | 12 | |
Danil Chapovalov | 40dc98a | 2019-08-12 11:40:47 | [diff] [blame] | 13 | #include "absl/debugging/failure_signal_handler.h" |
| 14 | #include "absl/debugging/symbolize.h" |
Artem Titov | bcb42f1 | 2020-08-11 10:19:18 | [diff] [blame] | 15 | #include "absl/flags/parse.h" |
| 16 | #include "test/gmock.h" |
Artem Titov | 40a7a35 | 2018-10-15 13:25:34 | [diff] [blame] | 17 | #include "test/test_main_lib.h" |
oprypin | 9b2f20c | 2017-08-29 12:51:57 | [diff] [blame] | 18 | |
pbos@webrtc.org | af8d5af | 2013-07-09 08:02:33 | [diff] [blame] | 19 | int main(int argc, char* argv[]) { |
Danil Chapovalov | 40dc98a | 2019-08-12 11:40:47 | [diff] [blame] | 20 | // Initialize the symbolizer to get a human-readable stack trace |
Mirko Bonadei | e6e7f6a | 2020-05-15 13:01:54 | [diff] [blame] | 21 | absl::InitializeSymbolizer(argv[0]); |
Artem Titov | bcb42f1 | 2020-08-11 10:19:18 | [diff] [blame] | 22 | testing::InitGoogleMock(&argc, argv); |
| 23 | absl::ParseCommandLine(argc, argv); |
Danil Chapovalov | 40dc98a | 2019-08-12 11:40:47 | [diff] [blame] | 24 | |
Mirko Bonadei | e6e7f6a | 2020-05-15 13:01:54 | [diff] [blame] | 25 | absl::FailureSignalHandlerOptions options; |
| 26 | absl::InstallFailureSignalHandler(options); |
Danil Chapovalov | 40dc98a | 2019-08-12 11:40:47 | [diff] [blame] | 27 | |
Artem Titov | 40a7a35 | 2018-10-15 13:25:34 | [diff] [blame] | 28 | std::unique_ptr<webrtc::TestMain> main = webrtc::TestMain::Create(); |
Artem Titov | bcb42f1 | 2020-08-11 10:19:18 | [diff] [blame] | 29 | int err_code = main->Init(); |
Artem Titov | 40a7a35 | 2018-10-15 13:25:34 | [diff] [blame] | 30 | if (err_code != 0) { |
| 31 | return err_code; |
oprypin | 9b2f20c | 2017-08-29 12:51:57 | [diff] [blame] | 32 | } |
Artem Titov | 40a7a35 | 2018-10-15 13:25:34 | [diff] [blame] | 33 | return main->Run(argc, argv); |
pbos@webrtc.org | af8d5af | 2013-07-09 08:02:33 | [diff] [blame] | 34 | } |