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

Unified Diff: tests/Test.h

Issue 13855007: Add --threads to tests binary, to run non-GPU tests on multiple cores. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: SkTScopedPtr -> SkAutoTDelete, and clean up merge conflicts with codereview.chromium.org/14002007 Created 7 years, 8 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 | « tests/GrContextFactoryTest.cpp ('k') | tests/Test.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/Test.h
diff --git a/tests/Test.h b/tests/Test.h
index 6b0b90101e465b19fa6afc4d282522741455af1b..1aa038748f247598e4d61f44eb3d5916c7caf33f 100644
--- a/tests/Test.h
+++ b/tests/Test.h
@@ -31,13 +31,8 @@ namespace skiatest {
kLastResult = kFailed
};
- void resetReporting();
void bumpTestCount() { sk_atomic_inc(&fTestCount); }
int countTests() const { return fTestCount; }
- int countResults(Result r) {
- SkASSERT((unsigned)r <= kLastResult);
- return fResultCount[r];
- }
void startTest(Test*);
void report(const char testDesc[], Result);
@@ -45,16 +40,6 @@ namespace skiatest {
virtual bool allowExtendedTest() const { return false; }
virtual bool allowThreaded() const { return false; }
// helpers for tests
- void assertTrue(bool cond, const char desc[]) {
- if (!cond) {
- this->report(desc, kFailed);
- }
- }
- void assertFalse(bool cond, const char desc[]) {
- if (cond) {
- this->report(desc, kFailed);
- }
- }
void reportFailed(const char desc[]) {
this->report(desc, kFailed);
}
@@ -62,9 +47,6 @@ namespace skiatest {
this->report(desc.c_str(), kFailed);
}
- bool getCurrSuccess() const {
- return fCurrTestSuccess;
- }
protected:
virtual void onStart(Test*) {}
@@ -72,10 +54,7 @@ namespace skiatest {
virtual void onEnd(Test*) {}
private:
- Test* fCurrTest;
- int fTestCount;
- int fResultCount[kLastResult+1];
- bool fCurrTestSuccess;
+ int32_t fTestCount;
typedef SkRefCnt INHERITED;
};
@@ -89,12 +68,15 @@ namespace skiatest {
void setReporter(Reporter*);
const char* getName();
- bool run(); // returns true on success
+ void run();
+ bool passed() const { return fPassed; }
static const SkString& GetTmpDir();
static const SkString& GetResourcePath();
+ virtual bool isThreadsafe() const { return true; }
+
protected:
virtual void onGetName(SkString*) = 0;
virtual void onRun(Reporter*) = 0;
@@ -102,6 +84,7 @@ namespace skiatest {
private:
Reporter* fReporter;
SkString fName;
+ bool fPassed;
};
class GpuTest : public Test{
@@ -109,6 +92,7 @@ namespace skiatest {
GpuTest() : Test() {}
static GrContextFactory* GetGrContextFactory();
static void DestroyContexts();
+ virtual bool isThreadsafe() const { return false; }
private:
};
« no previous file with comments | « tests/GrContextFactoryTest.cpp ('k') | tests/Test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698