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

Unified Diff: tests/Test.h

Issue 132843002: Add REPORTF test macro. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: factor 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
« no previous file with comments | « tests/StreamTest.cpp ('k') | no next file » | 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 1c89f98e09f437ada747dcbbbecd62cca0a114c2..f68684843e7f19be4718e7aab4e1ebac5fb25ad6 100644
--- a/tests/Test.h
+++ b/tests/Test.h
@@ -107,5 +107,12 @@ namespace skiatest {
} \
} while(0)
+#define REPORTF(REPORTER, PRINTF_ARGS) \
mtklein 2014/01/10 14:03:58 Generally, arguments to macros don't need to be ca
mtklein 2014/01/10 14:03:58 If you write this as #define REPORTF(REPORTER, ..
hal.canary 2014/01/10 14:50:31 Done.
hal.canary 2014/01/10 14:50:31 Done.
+ do { \
+ SkString message; \
+ message.printf PRINTF_ARGS ; \
+ message.appendf(" %s:%d", __FILE__, __LINE__); \
mtklein 2014/01/10 14:03:58 I'd prefer file:line to come first. It's nice to
hal.canary 2014/01/10 14:50:31 Done.
+ (REPORTER)->reportFailed(message); \
mtklein 2014/01/10 14:03:58 We may want to follow up and make reportFailed mor
hal.canary 2014/01/10 14:50:31 Done.
+ } while(0)
#endif
« no previous file with comments | « tests/StreamTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698