blob: f919c4bba77069ac1dba36ac3f4ac2bca4cb7d37 [file] [log] [blame]
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +00001/*
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 Titov40a7a352018-10-15 15:25:34 +020011#include <memory>
Oleh Prypin135aad02018-09-21 13:56:26 +020012
Danil Chapovalov40dc98a2019-08-12 13:40:47 +020013#include "absl/debugging/failure_signal_handler.h"
14#include "absl/debugging/symbolize.h"
Artem Titovbcb42f12020-08-11 12:19:18 +020015#include "absl/flags/parse.h"
16#include "test/gmock.h"
Artem Titov40a7a352018-10-15 15:25:34 +020017#include "test/test_main_lib.h"
oprypin9b2f20c2017-08-29 05:51:57 -070018
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000019int main(int argc, char* argv[]) {
Danil Chapovalov40dc98a2019-08-12 13:40:47 +020020 // Initialize the symbolizer to get a human-readable stack trace
Mirko Bonadeie6e7f6a2020-05-15 15:01:54 +020021 absl::InitializeSymbolizer(argv[0]);
Artem Titovbcb42f12020-08-11 12:19:18 +020022 testing::InitGoogleMock(&argc, argv);
23 absl::ParseCommandLine(argc, argv);
Danil Chapovalov40dc98a2019-08-12 13:40:47 +020024
Mirko Bonadeie6e7f6a2020-05-15 15:01:54 +020025 absl::FailureSignalHandlerOptions options;
26 absl::InstallFailureSignalHandler(options);
Danil Chapovalov40dc98a2019-08-12 13:40:47 +020027
Artem Titov40a7a352018-10-15 15:25:34 +020028 std::unique_ptr<webrtc::TestMain> main = webrtc::TestMain::Create();
Artem Titovbcb42f12020-08-11 12:19:18 +020029 int err_code = main->Init();
Artem Titov40a7a352018-10-15 15:25:34 +020030 if (err_code != 0) {
31 return err_code;
oprypin9b2f20c2017-08-29 05:51:57 -070032 }
Artem Titov40a7a352018-10-15 15:25:34 +020033 return main->Run(argc, argv);
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000034}