2013-07-09 08:02:33 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2014-05-16 09:39:51 +00:00
|
|
|
#include "gflags/gflags.h"
|
2017-07-06 19:44:34 +02:00
|
|
|
#include "webrtc/rtc_base/logging.h"
|
2016-05-20 06:29:46 -07:00
|
|
|
#include "webrtc/system_wrappers/include/metrics_default.h"
|
2014-05-16 09:39:51 +00:00
|
|
|
#include "webrtc/test/field_trial.h"
|
2016-11-30 06:12:01 -08:00
|
|
|
#include "webrtc/test/gmock.h"
|
2016-09-30 22:29:43 -07:00
|
|
|
#include "webrtc/test/gtest.h"
|
2013-08-21 16:00:15 +00:00
|
|
|
#include "webrtc/test/testsupport/fileutils.h"
|
2016-11-30 06:12:01 -08:00
|
|
|
#include "webrtc/test/testsupport/trace_to_stderr.h"
|
|
|
|
|
|
2017-06-09 10:31:58 +02:00
|
|
|
#if defined(WEBRTC_IOS)
|
|
|
|
|
#include "webrtc/test/ios/test_support.h"
|
2017-08-18 07:12:20 -07:00
|
|
|
|
|
|
|
|
DEFINE_string(NSTreatUnknownArgumentsAsOpen, "",
|
|
|
|
|
"Intentionally ignored flag intended for iOS simulator.");
|
|
|
|
|
DEFINE_string(ApplePersistenceIgnoreState, "",
|
|
|
|
|
"Intentionally ignored flag intended for iOS simulator.");
|
2017-06-09 10:31:58 +02:00
|
|
|
#endif
|
|
|
|
|
|
2016-11-30 06:12:01 -08:00
|
|
|
DEFINE_bool(logs, false, "print logs to stderr");
|
2013-07-09 08:02:33 +00:00
|
|
|
|
2014-05-16 09:39:51 +00:00
|
|
|
DEFINE_string(force_fieldtrials, "",
|
|
|
|
|
"Field trials control experimental feature code which can be forced. "
|
|
|
|
|
"E.g. running with --force_fieldtrials=WebRTC-FooFeature/Enable/"
|
|
|
|
|
" will assign the group Enable to field trial WebRTC-FooFeature.");
|
|
|
|
|
|
2013-07-09 08:02:33 +00:00
|
|
|
int main(int argc, char* argv[]) {
|
2016-11-30 06:12:01 -08:00
|
|
|
::testing::InitGoogleMock(&argc, argv);
|
2013-07-09 08:02:33 +00:00
|
|
|
|
2015-11-27 17:53:22 +01:00
|
|
|
// Default to LS_INFO, even for release builds to provide better test logging.
|
|
|
|
|
// TODO(pbos): Consider adding a command-line override.
|
|
|
|
|
if (rtc::LogMessage::GetLogToDebug() > rtc::LS_INFO)
|
|
|
|
|
rtc::LogMessage::LogToDebug(rtc::LS_INFO);
|
|
|
|
|
|
2014-05-16 09:39:51 +00:00
|
|
|
google::ParseCommandLineFlags(&argc, &argv, false);
|
|
|
|
|
|
|
|
|
|
webrtc::test::SetExecutablePath(argv[0]);
|
|
|
|
|
webrtc::test::InitFieldTrialsFromString(FLAGS_force_fieldtrials);
|
2016-05-20 06:29:46 -07:00
|
|
|
webrtc::metrics::Enable();
|
2016-11-30 06:12:01 -08:00
|
|
|
|
|
|
|
|
rtc::LogMessage::SetLogToStderr(FLAGS_logs);
|
|
|
|
|
std::unique_ptr<webrtc::test::TraceToStderr> trace_to_stderr;
|
|
|
|
|
if (FLAGS_logs)
|
|
|
|
|
trace_to_stderr.reset(new webrtc::test::TraceToStderr);
|
2017-06-09 10:31:58 +02:00
|
|
|
#if defined(WEBRTC_IOS)
|
|
|
|
|
rtc::test::InitTestSuite(RUN_ALL_TESTS, argc, argv);
|
|
|
|
|
rtc::test::RunTestsFromIOSApp();
|
|
|
|
|
#endif
|
2016-11-30 06:12:01 -08:00
|
|
|
|
2014-06-05 09:32:51 +00:00
|
|
|
return RUN_ALL_TESTS();
|
2013-07-09 08:02:33 +00:00
|
|
|
}
|