mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-12 10:26:12 +00:00
core: Prettify igt_require_f output
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
9df77d5664
commit
fb9c9e3adc
@ -198,6 +198,8 @@ __attribute__((format(printf, 5, 6)))
|
|||||||
void __igt_skip_check(const char *file, const int line,
|
void __igt_skip_check(const char *file, const int line,
|
||||||
const char *func, const char *check,
|
const char *func, const char *check,
|
||||||
const char *format, ...) __attribute__((noreturn));
|
const char *format, ...) __attribute__((noreturn));
|
||||||
|
#define igt_skip_check(E, F...) \
|
||||||
|
__igt_skip_check(__FILE__, __LINE__, __func__, E, F);
|
||||||
void igt_success(void);
|
void igt_success(void);
|
||||||
|
|
||||||
void igt_fail(int exitcode) __attribute__((noreturn));
|
void igt_fail(int exitcode) __attribute__((noreturn));
|
||||||
@ -343,10 +345,9 @@ void igt_exit(void) __attribute__((noreturn));
|
|||||||
* skipping. This is useful to streamline the skip logic since it allows for a more flat
|
* skipping. This is useful to streamline the skip logic since it allows for a more flat
|
||||||
* code control flow, similar to igt_assert()
|
* code control flow, similar to igt_assert()
|
||||||
*/
|
*/
|
||||||
#define igt_require(expr) \
|
#define igt_require(expr) do { \
|
||||||
do { if (!(expr)) \
|
if (!(expr)) igt_skip_check(#expr , NULL); \
|
||||||
__igt_skip_check(__FILE__, __LINE__, __func__, #expr , NULL); \
|
} while (0)
|
||||||
} while (0)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* igt_skip_on:
|
* igt_skip_on:
|
||||||
@ -358,10 +359,9 @@ void igt_exit(void) __attribute__((noreturn));
|
|||||||
* skipping. This is useful to streamline the skip logic since it allows for a more flat
|
* skipping. This is useful to streamline the skip logic since it allows for a more flat
|
||||||
* code control flow, similar to igt_assert()
|
* code control flow, similar to igt_assert()
|
||||||
*/
|
*/
|
||||||
#define igt_skip_on(expr) \
|
#define igt_skip_on(expr) do { \
|
||||||
do { if ((expr)) \
|
if ((expr)) igt_skip_check("!(" #expr ")" , NULL); \
|
||||||
__igt_skip_check(__FILE__, __LINE__, __func__, "!(" #expr ")" , NULL); \
|
} while (0)
|
||||||
} while (0)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* igt_require_f:
|
* igt_require_f:
|
||||||
@ -377,7 +377,9 @@ void igt_exit(void) __attribute__((noreturn));
|
|||||||
* In addition to the plain igt_require() helper this allows to print additional
|
* In addition to the plain igt_require() helper this allows to print additional
|
||||||
* information to help debugging test failures.
|
* information to help debugging test failures.
|
||||||
*/
|
*/
|
||||||
#define igt_require_f(expr, f...) igt_skip_on_f(!(expr), f)
|
#define igt_require_f(expr, f...) do { \
|
||||||
|
if (!(expr)) igt_skip_check(#expr , f); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* igt_skip_on_f:
|
* igt_skip_on_f:
|
||||||
@ -393,10 +395,9 @@ void igt_exit(void) __attribute__((noreturn));
|
|||||||
* In addition to the plain igt_skip_on() helper this allows to print additional
|
* In addition to the plain igt_skip_on() helper this allows to print additional
|
||||||
* information to help debugging test failures.
|
* information to help debugging test failures.
|
||||||
*/
|
*/
|
||||||
#define igt_skip_on_f(expr, f...) \
|
#define igt_skip_on_f(expr, f...) do { \
|
||||||
do { if ((expr)) \
|
if ((expr)) igt_skip_check(#expr , f); \
|
||||||
__igt_skip_check(__FILE__, __LINE__, __func__, #expr , f); \
|
} while (0)
|
||||||
} while (0)
|
|
||||||
|
|
||||||
/* fork support code */
|
/* fork support code */
|
||||||
bool __igt_fork(void);
|
bool __igt_fork(void);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user