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

Unified Diff: dm/DM.cpp

Issue 2243143002: Add --serial mode to dm, runs unit tests serially (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use --solo Created 4 years, 4 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 | « no previous file | infra/bots/recipes/swarm_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DM.cpp
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 5dd8a6f63e96a28387e78ebbd445006ec0dabce3..6d1151737bd2b687f09781ade14fa5eb9b3372eb 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -71,6 +71,10 @@ DEFINE_string(uninterestingHashesFile, "",
DEFINE_int32(shards, 1, "We're splitting source data into this many shards.");
DEFINE_int32(shard, 0, "Which shard do I run?");
+DEFINE_string2(solo, s, nullptr,
+ "Run the specified tests alone, before creating multiple threads.\n"
+ "Test names must match exactly. Multiple tests may be separated by spaces.");
+
DEFINE_string(mskps, "", "Directory to read mskps from, or a single mskp file.");
DEFINE_string(svgs, "", "Directory to read SVGs from, or a single SVG file.");
@@ -1206,7 +1210,7 @@ struct Task {
// Unit tests don't fit so well into the Src/Sink model, so we give them special treatment.
-static SkTDArray<skiatest::Test> gParallelTests, gSerialTests;
+static SkTDArray<skiatest::Test> gParallelTests, gSerialTests, gSoloTests;
static void gather_tests() {
if (!FLAGS_src.contains("tests")) {
@@ -1222,6 +1226,10 @@ static void gather_tests() {
if (SkCommandLineFlags::ShouldSkip(FLAGS_match, test.name)) {
continue;
}
+ if (FLAGS_solo.contains(test.name)) {
+ gSoloTests.push(test);
+ continue;
+ }
if (test.needsGpu && gpu_supported()) {
(FLAGS_gpu_threading ? gParallelTests : gSerialTests).push(test);
} else if (!test.needsGpu && FLAGS_cpu) {
@@ -1317,6 +1325,13 @@ int dm_main() {
return 1;
}
gather_tests();
+
+ // First, run memory intensive tests serially.
+ if (gSoloTests.count() > 0) {
+ info("Running %d tests serially...\n", gSoloTests.count());
+ for (auto test : gSoloTests) { run_test(test); }
+ }
+
gPending = gSrcs.count() * gSinks.count() + gParallelTests.count() + gSerialTests.count();
info("%d srcs * %d sinks + %d tests == %d tasks",
gSrcs.count(), gSinks.count(), gParallelTests.count() + gSerialTests.count(), gPending);
« no previous file with comments | « no previous file | infra/bots/recipes/swarm_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698