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

Unified Diff: tests/TestClassDef.h

Issue 23828008: Add an even more convenient way to declare tests, with example. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: DEF_TEST Created 7 years, 3 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/AAClipTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/TestClassDef.h
diff --git a/tests/TestClassDef.h b/tests/TestClassDef.h
index 70d6039c16f38654293e569ed64645f722eaaab1..89124c78faa8b8f063975f52e1b32fbc2cf91195 100644
--- a/tests/TestClassDef.h
+++ b/tests/TestClassDef.h
@@ -55,3 +55,15 @@
}; \
static TestRegistry gReg_##classname(classname::Factory); \
}
+
+
+// Yet shorter way to define a test. E.g.
+//
+// DEF_TEST(some_test_name, r) {
+// ...
+// REPORTER_ASSERT(r, x == 15);
+// }
+#define DEF_TEST(name, reporter) \
+ static void name(skiatest::Reporter* reporter); \
+ DEFINE_TESTCLASS_SHORT(name) \
+ static void name(skiatest::Reporter* reporter)
« no previous file with comments | « tests/AAClipTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698