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

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

Issue 1027993002: Allow unit tests to force serial execution in the test launcher. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TestID experiment Created 5 years, 9 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_id.cc ('k') | chrome/chrome_tests.gypi » ('j') | 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 1b3a162c661ac25f419ed477764f5d935b467221..79831bbd0bc454d1d7e86c22d869be4ecb583f5c 100644
--- a/base/test/launcher/unit_test_launcher.cc
+++ b/base/test/launcher/unit_test_launcher.cc
@@ -557,9 +557,14 @@ size_t UnitTestLauncherDelegate::RunTests(
int launch_flags = use_job_objects_ ? TestLauncher::USE_JOB_OBJECTS : 0;
+ std::vector<std::string> serialized;
std::vector<std::string> batch;
- for (size_t i = 0; i < test_names.size(); i++) {
- batch.push_back(test_names[i]);
+ for (const auto& test_name : test_names) {
+ if (test_name.find(".SERIALIZE_") != std::string::npos) {
+ serialized.push_back(test_name);
+ continue;
+ }
+ batch.push_back(test_name);
// Use 0 to indicate unlimited batch size.
if (batch.size() >= batch_limit_ && batch_limit_ != 0) {
@@ -570,6 +575,9 @@ size_t UnitTestLauncherDelegate::RunTests(
RunUnitTestsBatch(test_launcher, platform_delegate_, batch, launch_flags);
+ RunUnitTestsSerially(test_launcher, platform_delegate_, serialized,
+ launch_flags);
+
return test_names.size();
}
« no previous file with comments | « base/test/launcher/test_id.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698