pbos@webrtc.org | af8d5af | 2013-07-09 08:02:33 +0000 | [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 | |
andresp@webrtc.org | 60015d2 | 2014-05-16 09:39:51 +0000 | [diff] [blame] | 11 | #include "gflags/gflags.h" |
Peter Boström | def5820 | 2015-11-27 17:53:22 +0100 | [diff] [blame] | 12 | #include "webrtc/base/logging.h" |
asapersson | 01d70a3 | 2016-05-20 06:29:46 -0700 | [diff] [blame] | 13 | #include "webrtc/system_wrappers/include/metrics_default.h" |
andresp@webrtc.org | 60015d2 | 2014-05-16 09:39:51 +0000 | [diff] [blame] | 14 | #include "webrtc/test/field_trial.h" |
kwiberg | ac9f876 | 2016-09-30 22:29:43 -0700 | [diff] [blame^] | 15 | #include "webrtc/test/gtest.h" |
pbos@webrtc.org | fbf0f69 | 2013-08-21 16:00:15 +0000 | [diff] [blame] | 16 | #include "webrtc/test/testsupport/fileutils.h" |
pbos@webrtc.org | af8d5af | 2013-07-09 08:02:33 +0000 | [diff] [blame] | 17 | |
andresp@webrtc.org | 60015d2 | 2014-05-16 09:39:51 +0000 | [diff] [blame] | 18 | DEFINE_string(force_fieldtrials, "", |
| 19 | "Field trials control experimental feature code which can be forced. " |
| 20 | "E.g. running with --force_fieldtrials=WebRTC-FooFeature/Enable/" |
| 21 | " will assign the group Enable to field trial WebRTC-FooFeature."); |
| 22 | |
pbos@webrtc.org | af8d5af | 2013-07-09 08:02:33 +0000 | [diff] [blame] | 23 | int main(int argc, char* argv[]) { |
| 24 | ::testing::InitGoogleTest(&argc, argv); |
pbos@webrtc.org | af8d5af | 2013-07-09 08:02:33 +0000 | [diff] [blame] | 25 | |
Peter Boström | def5820 | 2015-11-27 17:53:22 +0100 | [diff] [blame] | 26 | // Default to LS_INFO, even for release builds to provide better test logging. |
| 27 | // TODO(pbos): Consider adding a command-line override. |
| 28 | if (rtc::LogMessage::GetLogToDebug() > rtc::LS_INFO) |
| 29 | rtc::LogMessage::LogToDebug(rtc::LS_INFO); |
| 30 | |
andresp@webrtc.org | 60015d2 | 2014-05-16 09:39:51 +0000 | [diff] [blame] | 31 | // AllowCommandLineParsing allows us to ignore flags passed on to us by |
| 32 | // Chromium build bots without having to explicitly disable them. |
| 33 | google::AllowCommandLineReparsing(); |
| 34 | google::ParseCommandLineFlags(&argc, &argv, false); |
| 35 | |
| 36 | webrtc::test::SetExecutablePath(argv[0]); |
| 37 | webrtc::test::InitFieldTrialsFromString(FLAGS_force_fieldtrials); |
asapersson | 01d70a3 | 2016-05-20 06:29:46 -0700 | [diff] [blame] | 38 | webrtc::metrics::Enable(); |
mflodman@webrtc.org | eae7924 | 2014-06-05 09:32:51 +0000 | [diff] [blame] | 39 | return RUN_ALL_TESTS(); |
pbos@webrtc.org | af8d5af | 2013-07-09 08:02:33 +0000 | [diff] [blame] | 40 | } |