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

Unified Diff: tests/skia_test.cpp

Issue 144343004: Add --skip_cpu and --skip_gpu options to tests (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 11 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
« tests/Test.h ('K') | « tests/Test.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/skia_test.cpp
diff --git a/tests/skia_test.cpp b/tests/skia_test.cpp
index fd7f3a356b3367f32c6f12d43ee73dfa1f1f2cda..587a3151887b72a32d9dd9bc5dfdafa22a532b8f 100644
--- a/tests/skia_test.cpp
+++ b/tests/skia_test.cpp
@@ -35,6 +35,8 @@ DEFINE_bool2(extendedTest, x, false, "run extended tests for pathOps.");
DEFINE_bool2(leaks, l, false, "show leaked ref cnt'd objects.");
DEFINE_bool2(single, z, false, "run tests on a single thread internally.");
DEFINE_bool2(verbose, v, false, "enable verbose output.");
+DEFINE_bool(skip_cpu, false, "skip CPU tests.");
mtklein 2014/01/27 22:35:29 Would somewhat prefer to keep the flags positively
djsollen 2014/01/28 14:21:02 I'm a fan of this as well. On 2014/01/27 22:35:29
borenet 2014/01/28 18:42:09 Done.
+DEFINE_bool(skip_gpu, false, "skip GPU tests.");
DEFINE_int32(threads, SkThreadPool::kThreadPerCore,
"Run threadsafe tests on a threadpool with this many threads.");
@@ -174,6 +176,10 @@ int tool_main(int argc, char** argv) {
if(!SkCommandLineFlags::ShouldSkip(FLAGS_match, test->getName())) {
toRun++;
+ } else if (test->isGPUTest() && !FLAGS_skip_gpu){
mtklein 2014/01/27 22:35:29 I think this is going to double-count? Shouldn't
borenet 2014/01/28 18:42:09 Moved to its own function for clarity.
+ toRun++;
+ } else if (!test->isGPUTest() && !FLAGS_skip_cpu) {
+ toRun++;
}
total++;
}
@@ -191,6 +197,10 @@ int tool_main(int argc, char** argv) {
SkAutoTDelete<Test> test(iter.next(&reporter));
if (SkCommandLineFlags::ShouldSkip(FLAGS_match, test->getName())) {
++skipCount;
+ } else if (test->isGPUTest() && FLAGS_skip_gpu) {
mtklein 2014/01/27 22:35:29 Same deal down here.
+ ++skipCount;
+ } else if (!test->isGPUTest() && FLAGS_skip_cpu) {
+ ++skipCount;
} else if (!test->isThreadsafe()) {
unsafeTests.push_back() = test.detach();
} else {
« tests/Test.h ('K') | « tests/Test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698