Skip to contentSkip to conversation

lib/igt_core.h: fix igt_skip_on_f requirement message

PATCH In review Thomas Wood 2 participants 3 messages Oct 29, 2014 – Nov 3, 2014 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 lib/igt_core.h: fix igt_skip_on_f requirement message

---
 lib/igt_core.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/igt_core.h +1 -1
index b8f6702..5318c5e 100644
@@ -397,7 +397,7 @@ void igt_exit(void) __attribute__((noreturn));
  * information to help debugging test failures.
  */
 #define igt_skip_on_f(expr, f...) do { \
-	if ((expr)) igt_skip_check(#expr , f); \
+	if ((expr)) igt_skip_check("!("#expr")", f); \
 } while (0)
 
 /* fork support code */
Signature · 6 lines
2.1.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 2/2 lib/igt_core.h: add debug messages for test requirements

---
 lib/igt_core.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
lib/igt_core.h +5 -1
index 5318c5e..f7a92ce 100644
@@ -199,7 +199,7 @@ void __igt_skip_check(const char *file, const int line,
 		      const char *func, const char *check,
 		      const char *format, ...) __attribute__((noreturn));
 #define igt_skip_check(E, F...) \
-	__igt_skip_check(__FILE__, __LINE__, __func__, E, F);
+	__igt_skip_check(__FILE__, __LINE__, __func__, E, F)
 void igt_success(void);
 
 void igt_fail(int exitcode) __attribute__((noreturn));
@@ -348,6 +348,7 @@ void igt_exit(void) __attribute__((noreturn));
  */
 #define igt_require(expr) do { \
 	if (!(expr)) igt_skip_check(#expr , NULL); \
+	else igt_debug("Test requirement passed: "#expr"\n"); \
 } while (0)
 
 /**
@@ -362,6 +363,7 @@ void igt_exit(void) __attribute__((noreturn));
  */
 #define igt_skip_on(expr) do { \
 	if ((expr)) igt_skip_check("!(" #expr ")" , NULL); \
+	else igt_debug("Test requirement passed: !("#expr")\n"); \
 } while (0)
 
 /**
@@ -380,6 +382,7 @@ void igt_exit(void) __attribute__((noreturn));
  */
 #define igt_require_f(expr, f...) do { \
 	if (!(expr)) igt_skip_check(#expr , f); \
+	else igt_debug("Test requirement passed: "#expr"\n"); \
 } while (0)
 
 /**
@@ -398,6 +401,7 @@ void igt_exit(void) __attribute__((noreturn));
  */
 #define igt_skip_on_f(expr, f...) do { \
 	if ((expr)) igt_skip_check("!("#expr")", f); \
+	else igt_debug("Test requirement passed: !("#expr")\n"); \
 } while (0)
 
 /* fork support code */
Signature · 6 lines
2.1.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

Re: [PATCH i-g-t 2/2] lib/igt_core.h: add debug messages for test requirements

lib/igt_core.h void igt_exit(void) __attribute__((noreturn)); · line 404

Quoted 13 lines · Thomas Wood
lib/igt_core.h +2 -0
@@ -380,6 +382,7 @@ void igt_exit(void) __attribute__((noreturn));
  */
 #define igt_require_f(expr, f...) do { \
 	if (!(expr)) igt_skip_check(#expr , f); \
+	else igt_debug("Test requirement passed: "#expr"\n"); \
 } while (0)
 
 /**
@@ -398,6 +401,7 @@ void igt_exit(void) __attribute__((noreturn));
  */
 #define igt_skip_on_f(expr, f...) do { \
 	if ((expr)) igt_skip_check("!("#expr")", f); \
+	else igt_debug("Test requirement passed: !("#expr")\n"); \

Hm, for the the _f variants, should we also print the format string? Often I use that one when it's not clear what precise requirement failed from the test alone. Or is the resulting output too confusing? -Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx