OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include "gflags/gflags.h" | 11 #include "gflags/gflags.h" |
12 #include "webrtc/rtc_base/logging.h" | 12 #include "webrtc/rtc_base/logging.h" |
13 #include "webrtc/system_wrappers/include/metrics_default.h" | 13 #include "webrtc/system_wrappers/include/metrics_default.h" |
14 #include "webrtc/test/field_trial.h" | 14 #include "webrtc/test/field_trial.h" |
15 #include "webrtc/test/gmock.h" | 15 #include "webrtc/test/gmock.h" |
16 #include "webrtc/test/gtest.h" | 16 #include "webrtc/test/gtest.h" |
17 #include "webrtc/test/testsupport/fileutils.h" | 17 #include "webrtc/test/testsupport/fileutils.h" |
18 #include "webrtc/test/testsupport/trace_to_stderr.h" | 18 #include "webrtc/test/testsupport/trace_to_stderr.h" |
19 | 19 |
20 #if defined(WEBRTC_IOS) | 20 #if defined(WEBRTC_IOS) |
21 #include "webrtc/test/ios/test_support.h" | 21 #include "webrtc/test/ios/test_support.h" |
22 | |
23 DEFINE_string(NSTreatUnknownArgumentsAsOpen, "", | |
24 "Intentionally ignored flag intended for iOS simulator."); | |
25 DEFINE_string(ApplePersistenceIgnoreState, "", | |
26 "Intentionally ignored flag intended for iOS simulator."); | |
27 #endif | 22 #endif |
28 | 23 |
29 DEFINE_bool(logs, false, "print logs to stderr"); | 24 DEFINE_bool(logs, false, "print logs to stderr"); |
30 | 25 |
31 DEFINE_string(force_fieldtrials, "", | 26 DEFINE_string(force_fieldtrials, "", |
32 "Field trials control experimental feature code which can be forced. " | 27 "Field trials control experimental feature code which can be forced. " |
33 "E.g. running with --force_fieldtrials=WebRTC-FooFeature/Enable/" | 28 "E.g. running with --force_fieldtrials=WebRTC-FooFeature/Enable/" |
34 " will assign the group Enable to field trial WebRTC-FooFeature."); | 29 " will assign the group Enable to field trial WebRTC-FooFeature."); |
35 | 30 |
36 int main(int argc, char* argv[]) { | 31 int main(int argc, char* argv[]) { |
37 ::testing::InitGoogleMock(&argc, argv); | 32 ::testing::InitGoogleMock(&argc, argv); |
38 | 33 |
39 // Default to LS_INFO, even for release builds to provide better test logging. | 34 // Default to LS_INFO, even for release builds to provide better test logging. |
40 // TODO(pbos): Consider adding a command-line override. | 35 // TODO(pbos): Consider adding a command-line override. |
41 if (rtc::LogMessage::GetLogToDebug() > rtc::LS_INFO) | 36 if (rtc::LogMessage::GetLogToDebug() > rtc::LS_INFO) |
42 rtc::LogMessage::LogToDebug(rtc::LS_INFO); | 37 rtc::LogMessage::LogToDebug(rtc::LS_INFO); |
43 | 38 |
| 39 // AllowCommandLineParsing allows us to ignore flags passed on to us by |
| 40 // Chromium build bots without having to explicitly disable them. |
| 41 google::AllowCommandLineReparsing(); |
44 google::ParseCommandLineFlags(&argc, &argv, false); | 42 google::ParseCommandLineFlags(&argc, &argv, false); |
45 | 43 |
46 webrtc::test::SetExecutablePath(argv[0]); | 44 webrtc::test::SetExecutablePath(argv[0]); |
47 webrtc::test::InitFieldTrialsFromString(FLAGS_force_fieldtrials); | 45 webrtc::test::InitFieldTrialsFromString(FLAGS_force_fieldtrials); |
48 webrtc::metrics::Enable(); | 46 webrtc::metrics::Enable(); |
49 | 47 |
50 rtc::LogMessage::SetLogToStderr(FLAGS_logs); | 48 rtc::LogMessage::SetLogToStderr(FLAGS_logs); |
51 std::unique_ptr<webrtc::test::TraceToStderr> trace_to_stderr; | 49 std::unique_ptr<webrtc::test::TraceToStderr> trace_to_stderr; |
52 if (FLAGS_logs) | 50 if (FLAGS_logs) |
53 trace_to_stderr.reset(new webrtc::test::TraceToStderr); | 51 trace_to_stderr.reset(new webrtc::test::TraceToStderr); |
54 #if defined(WEBRTC_IOS) | 52 #if defined(WEBRTC_IOS) |
55 rtc::test::InitTestSuite(RUN_ALL_TESTS, argc, argv); | 53 rtc::test::InitTestSuite(RUN_ALL_TESTS, argc, argv); |
56 rtc::test::RunTestsFromIOSApp(); | 54 rtc::test::RunTestsFromIOSApp(); |
57 #endif | 55 #endif |
58 | 56 |
59 return RUN_ALL_TESTS(); | 57 return RUN_ALL_TESTS(); |
60 } | 58 } |
OLD | NEW |