Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(909)

Unified Diff: webrtc/test/test_main.cc

Issue 2540693002: Replace test_support_main by test_main and get rid of test_support_main_threaded_mac (Closed)
Patch Set: Adressed comments. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/test/run_all_unittests.cc ('k') | webrtc/test/test_suite.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/test_main.cc
diff --git a/webrtc/test/test_main.cc b/webrtc/test/test_main.cc
index b75e78c9dd5560905d193639371b858497ff4396..1b1cdba789454e9884cb81c087ae492d496c990a 100644
--- a/webrtc/test/test_main.cc
+++ b/webrtc/test/test_main.cc
@@ -12,8 +12,12 @@
#include "webrtc/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"
+
+DEFINE_bool(logs, false, "print logs to stderr");
DEFINE_string(force_fieldtrials, "",
"Field trials control experimental feature code which can be forced. "
@@ -21,7 +25,7 @@ DEFINE_string(force_fieldtrials, "",
" will assign the group Enable to field trial WebRTC-FooFeature.");
int main(int argc, char* argv[]) {
- ::testing::InitGoogleTest(&argc, 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.
@@ -36,5 +40,11 @@ int main(int argc, char* argv[]) {
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);
+
return RUN_ALL_TESTS();
}
« no previous file with comments | « webrtc/test/run_all_unittests.cc ('k') | webrtc/test/test_suite.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698