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); |