diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-07-25 14:28:51 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-07-25 14:39:18 +0100 |
commit | e0dffbdeda010a0114e16fb7b2e3adb7336acff4 (patch) | |
tree | 0489ae4b3e3910a8a04be107f3dac64f97e7c526 /lib | |
parent | 72b12636492cdf1c97eb1fec313165720f741cca (diff) | |
download | intel-gpu-tools-e0dffbdeda010a0114e16fb7b2e3adb7336acff4.tar.gz intel-gpu-tools-e0dffbdeda010a0114e16fb7b2e3adb7336acff4.tar.bz2 intel-gpu-tools-e0dffbdeda010a0114e16fb7b2e3adb7336acff4.zip |
core: Improve phrasing for test requirements
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/igt_core.c | 4 | ||||
-rw-r--r-- | lib/igt_core.h | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/lib/igt_core.c b/lib/igt_core.c index 91964281..7bd8e192 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -648,12 +648,12 @@ void __igt_skip_check(const char *file, const int line, va_end(args); igt_skip("Test requirement not met in function %s, file %s:%i:\n" - "Test requirement: (%s)\n%s" + "Test requirement: %s\n%s" "%s", func, file, line, check, buf, err_str ?: ""); } else { igt_skip("Test requirement not met in function %s, file %s:%i:\n" - "Test requirement: (%s)\n" + "Test requirement: %s\n" "%s", func, file, line, check, err_str ?: ""); } diff --git a/lib/igt_core.h b/lib/igt_core.h index 2838cb18..1d3d7fc6 100644 --- a/lib/igt_core.h +++ b/lib/igt_core.h @@ -307,7 +307,10 @@ void igt_exit(void) __attribute__((noreturn)); * skipping. This is useful to streamline the skip logic since it allows for a more flat * code control flow, similar to igt_assert() */ -#define igt_require(expr) igt_skip_on(!(expr)) +#define igt_require(expr) \ + do { if (!(expr)) \ + __igt_skip_check(__FILE__, __LINE__, __func__, #expr , NULL); \ + } while (0) /** * igt_skip_on: @@ -321,7 +324,7 @@ void igt_exit(void) __attribute__((noreturn)); */ #define igt_skip_on(expr) \ do { if ((expr)) \ - __igt_skip_check(__FILE__, __LINE__, __func__, #expr , NULL); \ + __igt_skip_check(__FILE__, __LINE__, __func__, "!(" #expr ")" , NULL); \ } while (0) /** |