Working on introducing igt trybot

Submitted by Arkadiusz Hiler on April 9, 2019, 6:49 a.m.

Details

Message ID 20190409064919.2292-1-arkadiusz.hiler@intel.com
State New
Headers show
Series "Working on introducing igt trybot" ( rev: 1 ) in IGT - Trybot

Not browsing as part of any series.

Commit Message

Arkadiusz Hiler April 9, 2019, 6:49 a.m.
also, errno fiddlingtests by the way
---
 lib/igt_core.h | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

Patch hide | download patch | download mbox

diff --git a/lib/igt_core.h b/lib/igt_core.h
index 47ffd9e7..cdc5a939 100644
--- a/lib/igt_core.h
+++ b/lib/igt_core.h
@@ -41,6 +41,7 @@ 
 #include <stdarg.h>
 #include <getopt.h>
 #include <unistd.h>
+#include <errno.h>
 
 #ifndef IGT_LOG_DOMAIN
 #define IGT_LOG_DOMAIN (NULL)
@@ -360,7 +361,7 @@  static inline void igt_ignore_warn(bool value)
  * Should be used everywhere where a test checks results.
  */
 #define igt_assert(expr) \
-	do { if (!(expr)) \
+	do { errno = 0; if (!(expr)) \
 		__igt_fail_assert(IGT_LOG_DOMAIN, __FILE__, __LINE__, __func__, #expr , NULL); \
 	} while (0)
 
@@ -377,7 +378,7 @@  static inline void igt_ignore_warn(bool value)
  * information to help debugging test failures.
  */
 #define igt_assert_f(expr, f...) \
-	do { if (!(expr)) \
+	do { errno = 0; if (!(expr)) \
 		__igt_fail_assert(IGT_LOG_DOMAIN, __FILE__, __LINE__, __func__, #expr , f); \
 	} while (0)
 
@@ -421,7 +422,9 @@  static inline void igt_ignore_warn(bool value)
  */
 #define igt_assert_cmpint(n1, cmp, ncmp, n2) \
 	do { \
-		int __n1 = (n1), __n2 = (n2); \
+		int __n1, __n2; \
+		errno = 0; \
+		__n1 = (n1); __n2 = (n2); \
 		if (__n1 cmp __n2) ; else \
 		__igt_fail_assert(IGT_LOG_DOMAIN, __FILE__, __LINE__, __func__, \
 				  #n1 " " #cmp " " #n2, \
@@ -439,7 +442,9 @@  static inline void igt_ignore_warn(bool value)
  */
 #define igt_assert_cmpuint(n1, cmp, ncmp, n2) \
 	do { \
-		uint32_t __n1 = (n1), __n2 = (n2); \
+		uint32_t __n1, __n2; \
+		errno = 0; \
+		__n1 = (n1); __n2 = (n2); \
 		if (__n1 cmp __n2) ; else \
 		__igt_fail_assert(IGT_LOG_DOMAIN, __FILE__, __LINE__, __func__, \
 				  #n1 " " #cmp " " #n2, \
@@ -457,7 +462,9 @@  static inline void igt_ignore_warn(bool value)
  */
 #define igt_assert_cmps64(n1, cmp, ncmp, n2) \
 	do { \
-		int64_t __n1 = (n1), __n2 = (n2); \
+		int64_t __n1, __n2; \
+		errno = 0; \
+		__n1 = (n1); __n2 = (n2); \
 		if (__n1 cmp __n2) ; else \
 		__igt_fail_assert(IGT_LOG_DOMAIN, __FILE__, __LINE__, __func__, \
 				  #n1 " " #cmp " " #n2, \
@@ -475,7 +482,9 @@  static inline void igt_ignore_warn(bool value)
  */
 #define igt_assert_cmpu64(n1, cmp, ncmp, n2) \
 	do { \
-		uint64_t __n1 = (n1), __n2 = (n2); \
+		uint64_t __n1, __n2; \
+		errno = 0; \
+		__n1 = (n1); __n2 = (n2); \
 		if (__n1 cmp __n2) ; else \
 		__igt_fail_assert(IGT_LOG_DOMAIN, __FILE__, __LINE__, __func__, \
 				  #n1 " " #cmp " " #n2, \
@@ -493,7 +502,9 @@  static inline void igt_ignore_warn(bool value)
  */
 #define igt_assert_cmpdouble(n1, cmp, ncmp, n2) \
 	do { \
-		double __n1 = (n1), __n2 = (n2); \
+		double __n1, __n2; \
+		errno = 0; \
+		__n1 = (n1); __n2 = (n2); \
 		if (__n1 cmp __n2) ; else \
 		__igt_fail_assert(IGT_LOG_DOMAIN, __FILE__, __LINE__, __func__, \
 				  #n1 " " #cmp " " #n2, \