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

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: trybots 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..631e6d2848b758480b9fd6f8139acf9ddbab1872 100644
--- a/base/test/launcher/unit_test_launcher.cc
+++ b/base/test/launcher/unit_test_launcher.cc
@@ -113,9 +113,21 @@ class DefaultUnitTestPlatformDelegate : public UnitTestPlatformDelegate {
const base::FilePath& output_file) override {
CommandLine new_cmd_line(*CommandLine::ForCurrentProcess());
+ if (!temp_dir_.IsValid()) {
sky 2015/10/29 17:32:34 nit: no {}. That said, I would likely move this in
Paweł Hajdan Jr. 2015/10/29 18:43:20 Done.
+ CHECK(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 +149,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