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

Unified Diff: base/test/launcher/unit_test_launcher.cc

Issue 1430633002: Use --gtest_flagfile for --gtest_filter in unit test launcher (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 5 years, 2 months 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 | « base/test/launcher/test_launcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/launcher/unit_test_launcher.cc
diff --git a/base/test/launcher/unit_test_launcher.cc b/base/test/launcher/unit_test_launcher.cc
index dc79f658aac5135691bc65a6c5c144e631f64e08..761dcfdb9f9431e5242f7503cc2cd257d07c158f 100644
--- a/base/test/launcher/unit_test_launcher.cc
+++ b/base/test/launcher/unit_test_launcher.cc
@@ -113,9 +113,19 @@ class DefaultUnitTestPlatformDelegate : public UnitTestPlatformDelegate {
const base::FilePath& output_file) override {
CommandLine new_cmd_line(*CommandLine::ForCurrentProcess());
+ CHECK(temp_dir_.IsValid() || temp_dir_.CreateUniqueTempDir());
+ FilePath temp_file;
+ CHECK(CreateTemporaryFileInDir(temp_dir_.path(), &temp_file));
+ std::string long_flags(
+ std::string("--") + kGTestFilterFlag + "=" +
+ JoinString(test_names, ":"));
+ CHECK_EQ(static_cast<int>(long_flags.size()),
+ WriteFile(temp_file,
+ long_flags.data(),
+ static_cast<int>(long_flags.size())));
+
new_cmd_line.AppendSwitchPath(switches::kTestLauncherOutput, output_file);
- new_cmd_line.AppendSwitchASCII(kGTestFilterFlag,
- JoinString(test_names, ":"));
+ new_cmd_line.AppendSwitchPath(kGTestFlagfileFlag, temp_file);
new_cmd_line.AppendSwitch(kSingleProcessTestsFlag);
return new_cmd_line;
@@ -137,6 +147,8 @@ class DefaultUnitTestPlatformDelegate : public UnitTestPlatformDelegate {
}
}
+ ScopedTempDir temp_dir_;
+
DISALLOW_COPY_AND_ASSIGN(DefaultUnitTestPlatformDelegate);
};
« no previous file with comments | « base/test/launcher/test_launcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698