diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-26 16:31:22 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-26 16:31:22 +0000 |
commit | 0dc5bd149a8b69e8dc6d3b4713b827659c9b0a6b (patch) | |
tree | 53fdc1e7747c8ed33c275deb6f24802bc41d365a /tests/Test.h | |
parent | 1e762d39bb6383d33d8e1f04a296f164aa2a6beb (diff) |
Let DM run unit tests.
- refactor GYPs and a few flags
- make GPU tests grab a thread-local GrContextFactory when needed as we do in DM for GMs
- add a few more UI features to make DM more like tests
I believe this makes the program 'tests' obsolete.
It should be somewhat faster to run the two sets together than running the old binaries serially:
- serial: tests 20s (3m18s CPU), dm 21s (3m01s CPU)
- together: 27s (6m21s CPU)
Next up is to incorporate benches. I'm only planning there on a single-pass sanity check, so that won't obsolete the program 'bench' just yet.
Tested: out/Debug/tests && out/Debug/dm && echo ok
BUG=skia:
Committed: http://code.google.com/p/skia/source/detail?r=13586
R=reed@google.com, bsalomon@google.com, mtklein@google.com, tfarina@chromium.org
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/178273002
git-svn-id: http://skia.googlecode.com/svn/trunk@13592 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/Test.h')
-rw-r--r-- | tests/Test.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/Test.h b/tests/Test.h index 0a9c306b15..4d2cf2b639 100644 --- a/tests/Test.h +++ b/tests/Test.h @@ -62,9 +62,11 @@ namespace skiatest { static SkString GetTmpDir(); + static void SetResourcePath(const char*); static SkString GetResourcePath(); virtual bool isGPUTest() const { return false; } + virtual void setGrContextFactory(GrContextFactory* factory) {} protected: virtual void onGetName(SkString*) = 0; @@ -79,11 +81,15 @@ namespace skiatest { class GpuTest : public Test{ public: - GpuTest() : Test() {} - static GrContextFactory* GetGrContextFactory(); - static void DestroyContexts(); + GpuTest() : Test(), fGrContextFactory(NULL) {} + virtual bool isGPUTest() const { return true; } - private: + virtual void setGrContextFactory(GrContextFactory* factory) { + fGrContextFactory = factory; + } + + protected: + GrContextFactory* fGrContextFactory; // Unowned. }; typedef SkTRegistry<Test*(*)(void*)> TestRegistry; @@ -162,7 +168,7 @@ namespace skiatest { name->set(#name); \ } \ virtual void onRun(Reporter* r) SK_OVERRIDE { \ - name(r, GetGrContextFactory()); \ + name(r, fGrContextFactory); \ } \ }; \ static TestRegistry gReg_##name##Class(name##Class::Factory); \ |