Move initialization of GoogleMock and flags to main from test_main_lib

Bug: None
Change-Id: Ie3aed382d4e468c4adbfdbcc1bdb3f069d3eaae2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181364
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31909}
This commit is contained in:
Artem Titov
2020-08-11 12:19:18 +02:00
committed by Commit Bot
parent 07b7dece9a
commit bcb42f1e4b
4 changed files with 15 additions and 8 deletions

View File

@ -15,7 +15,6 @@
#include <string>
#include "absl/flags/flag.h"
#include "absl/flags/parse.h"
#include "absl/memory/memory.h"
#include "absl/strings/match.h"
#include "absl/types/optional.h"
@ -28,7 +27,6 @@
#include "system_wrappers/include/field_trial.h"
#include "system_wrappers/include/metrics.h"
#include "test/field_trial.h"
#include "test/gmock.h"
#include "test/gtest.h"
#include "test/testsupport/perf_test.h"
#include "test/testsupport/resources_dir_flag.h"
@ -157,10 +155,9 @@ class TestMainImpl : public TestMain {
std::unique_ptr<rtc::Thread> thread_;
};
int Init(int* argc, char* argv[]) override {
::testing::InitGoogleMock(argc, argv);
absl::ParseCommandLine(*argc, argv);
int Init(int* argc, char* argv[]) override { return Init(); }
int Init() override {
// Make sure we always pull in the --resources_dir flag, even if the test
// binary doesn't link with fileutils (downstream expects all test mains to
// have this flag).