Remove the fileutils hack for good.

Or, well, to be fair it still kind of does the same thing, but
the thing it's (void)ing in is a lot more related to what it
actually happening. I could not find another way to solve this
since fileutils is fundamentally optional to unit tests, but the
flag isn't.

Bug: webrtc:9792
Change-Id: I6ebf012246bc259883bc0aaf73ac7fea5525dd1f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157101
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29501}
This commit is contained in:
Patrik Höglund
2019-10-16 10:24:35 +02:00
committed by Commit Bot
parent 64444bc865
commit 2bc1ea0b36
4 changed files with 4 additions and 33 deletions

View File

@ -27,8 +27,6 @@
#include "test/field_trial.h"
#include "test/gmock.h"
#include "test/gtest.h"
#include "test/testsupport/file_utils.h"
#include "test/testsupport/file_utils_override.h"
#include "test/testsupport/perf_test.h"
#include "test/testsupport/resources_dir_flag.h"
@ -108,9 +106,10 @@ class TestMainImpl : public TestMain {
::testing::InitGoogleMock(argc, argv);
absl::ParseCommandLine(*argc, argv);
std::string resources_dir = absl::GetFlag(FLAGS_resources_dir);
if (!resources_dir.empty())
test::internal::OverrideResourcesDir(resources_dir);
// 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).
(void)absl::GetFlag(FLAGS_resources_dir);
// Default to LS_INFO, even for release builds to provide better test
// logging.
@ -130,13 +129,6 @@ class TestMainImpl : public TestMain {
rtc::tracing::StartInternalCapture(trace_event_path.c_str());
}
// TODO(bugs.webrtc.org/9792): we need to reference something from
// fileutils.h so that our downstream hack where we replace fileutils.cc
// works. Otherwise the downstream flag implementation will take over and
// botch the flag introduced by the hack. Remove this awful thing once the
// downstream implementation has been eliminated.
(void)webrtc::test::JoinFilename("horrible", "hack");
// InitFieldTrialsFromString stores the char*, so the char array must
// outlive the application.
field_trials_ = absl::GetFlag(FLAGS_force_fieldtrials);