Reason for revert: Relanding without changes. Problem with unused flags was fixed in https://codereview.webrtc.org/2998143002/ Original issue's description: > Revert of Stop silently accepting unsupported flags in test binaries (patchset #5 id:150001 of https://codereview.webrtc.org/2968003003/ ) > > Reason for revert: > Causes failures on perf bots > https://luci-milo.appspot.com/buildbot/client.webrtc.perf/Mac%2010.11/3567 > > Original issue's description: > > Stop silently accepting unsupported flags in test binaries > > > > Instead explicitly ignore only the flags we know should be ignored. > > > > BUG=webrtc:7568 > > > > Review-Url: https://codereview.webrtc.org/2968003003 > > Cr-Commit-Position: refs/heads/master@{#19412} > > Committed:a2782f6f5d> > TBR=kjellander@webrtc.org,henrika@webrtc.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=webrtc:7568 > > Review-Url: https://codereview.webrtc.org/3002963002 > Cr-Commit-Position: refs/heads/master@{#19413} > Committed:d64072c598TBR=kjellander@webrtc.org,henrika@webrtc.org # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=webrtc:7568 Review-Url: https://codereview.webrtc.org/2999383002 Cr-Commit-Position: refs/heads/master@{#19455}
61 lines
2.1 KiB
C++
61 lines
2.1 KiB
C++
/*
|
|
* 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.
|
|
*/
|
|
|
|
#include "gflags/gflags.h"
|
|
#include "webrtc/rtc_base/logging.h"
|
|
#include "webrtc/system_wrappers/include/metrics_default.h"
|
|
#include "webrtc/test/field_trial.h"
|
|
#include "webrtc/test/gmock.h"
|
|
#include "webrtc/test/gtest.h"
|
|
#include "webrtc/test/testsupport/fileutils.h"
|
|
#include "webrtc/test/testsupport/trace_to_stderr.h"
|
|
|
|
#if defined(WEBRTC_IOS)
|
|
#include "webrtc/test/ios/test_support.h"
|
|
|
|
DEFINE_string(NSTreatUnknownArgumentsAsOpen, "",
|
|
"Intentionally ignored flag intended for iOS simulator.");
|
|
DEFINE_string(ApplePersistenceIgnoreState, "",
|
|
"Intentionally ignored flag intended for iOS simulator.");
|
|
#endif
|
|
|
|
DEFINE_bool(logs, false, "print logs to stderr");
|
|
|
|
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.");
|
|
|
|
int main(int argc, char* argv[]) {
|
|
::testing::InitGoogleMock(&argc, argv);
|
|
|
|
// 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);
|
|
|
|
google::ParseCommandLineFlags(&argc, &argv, false);
|
|
|
|
webrtc::test::SetExecutablePath(argv[0]);
|
|
webrtc::test::InitFieldTrialsFromString(FLAGS_force_fieldtrials);
|
|
webrtc::metrics::Enable();
|
|
|
|
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);
|
|
#if defined(WEBRTC_IOS)
|
|
rtc::test::InitTestSuite(RUN_ALL_TESTS, argc, argv);
|
|
rtc::test::RunTestsFromIOSApp();
|
|
#endif
|
|
|
|
return RUN_ALL_TESTS();
|
|
}
|