aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-01-28 20:21:23 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-01-28 20:21:23 +0000
commit04bfdc39a7e42bb8af04533cd4ddec236d75c898 (patch)
treeb026dcce408bd9ba6276909eed7fdd7b56841fd2 /tests
parent5683acd9092e95479da28269b8a26f7914b21050 (diff)
Revert of Add --skip_cpu and --skip_gpu options to tests (https://codereview.chromium.org/144343004/)
Reason for revert: Broke tests on Win7 and Mac Original issue's description: > Add --skip_cpu and --skip_gpu options to tests > > BUG=skia:2074 > > Committed: http://code.google.com/p/skia/source/detail?r=13223 R=djsollen@google.com, mtklein@google.com TBR=djsollen@google.com, mtklein@google.com NOTREECHECKS=true NOTRY=true BUG=skia:2074 Author: borenet@google.com Review URL: https://codereview.chromium.org/148173010 git-svn-id: http://skia.googlecode.com/svn/trunk@13224 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests')
-rw-r--r--tests/Test.h4
-rw-r--r--tests/skia_test.cpp22
2 files changed, 6 insertions, 20 deletions
diff --git a/tests/Test.h b/tests/Test.h
index 0a9c306b15..2dc7c66f7c 100644
--- a/tests/Test.h
+++ b/tests/Test.h
@@ -64,7 +64,7 @@ namespace skiatest {
static SkString GetResourcePath();
- virtual bool isGPUTest() const { return false; }
+ virtual bool isThreadsafe() const { return true; }
protected:
virtual void onGetName(SkString*) = 0;
@@ -82,7 +82,7 @@ namespace skiatest {
GpuTest() : Test() {}
static GrContextFactory* GetGrContextFactory();
static void DestroyContexts();
- virtual bool isGPUTest() const { return true; }
+ virtual bool isThreadsafe() const { return false; }
private:
};
diff --git a/tests/skia_test.cpp b/tests/skia_test.cpp
index 76bb3cc499..fd7f3a356b 100644
--- a/tests/skia_test.cpp
+++ b/tests/skia_test.cpp
@@ -35,8 +35,6 @@ 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(cpu, true, "whether or not to run CPU tests.");
-DEFINE_bool(gpu, true, "whether or not to run GPU tests.");
DEFINE_int32(threads, SkThreadPool::kThreadPerCore,
"Run threadsafe tests on a threadpool with this many threads.");
@@ -126,19 +124,6 @@ private:
int32_t* fFailCount;
};
-static bool should_run(const char* testName, bool isGPUTest) {
- if (SkCommandLineFlags::ShouldSkip(FLAGS_match, testName)) {
- return false;
- }
- if (!FLAGS_cpu && !isGPUTest) {
- return false;
- }
- if (!FLAGS_gpu && isGPUTest) {
- return false;
- }
- return true;
-}
-
int tool_main(int argc, char** argv);
int tool_main(int argc, char** argv) {
SkCommandLineFlags::SetUsage("");
@@ -186,7 +171,8 @@ int tool_main(int argc, char** argv) {
Iter iter;
while ((test = iter.next(NULL/*reporter not needed*/)) != NULL) {
SkAutoTDelete<Test> owned(test);
- if (should_run(test->getName(), test->isGPUTest())) {
+
+ if(!SkCommandLineFlags::ShouldSkip(FLAGS_match, test->getName())) {
toRun++;
}
total++;
@@ -203,9 +189,9 @@ int tool_main(int argc, char** argv) {
DebugfReporter reporter(toRun);
for (int i = 0; i < total; i++) {
SkAutoTDelete<Test> test(iter.next(&reporter));
- if (!should_run(test->getName(), test->isGPUTest())) {
+ if (SkCommandLineFlags::ShouldSkip(FLAGS_match, test->getName())) {
++skipCount;
- } else if (!test->isGPUTest()) {
+ } else if (!test->isThreadsafe()) {
unsafeTests.push_back() = test.detach();
} else {
threadpool.add(SkNEW_ARGS(SkTestRunnable, (test.detach(), &failCount)));