From ea8c086919041d152b957773b0071e0cfafd3f78 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Tue, 10 Dec 2013 08:07:11 +0100 Subject: lib: Always print errno in igt assert/require macros Useful to figure out why things have failed. Signed-off-by: Daniel Vetter --- lib/drmtest.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/drmtest.c') diff --git a/lib/drmtest.c b/lib/drmtest.c index 97a44031..f2624a10 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -1009,12 +1009,14 @@ 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" + "Last errno: %i, %s\n" "Test requirement: (%s)\n%s", - func, file, line, check, buf); + func, file, line, errno, strerror(errno), check, buf); } else { igt_skip("Test requirement not met in function %s, file %s:%i:\n" + "Last errno: %i, %s\n" "Test requirement: (%s)\n", - func, file, line, check); + func, file, line, errno, strerror(errno), check); } } @@ -1068,8 +1070,9 @@ void __igt_fail_assert(int exitcode, const char *file, va_list args; printf("Test assertion failure function %s, file %s:%i:\n" + "Last errno: %i, %s\n" "Failed assertion: %s\n", - func, file, line, assertion); + func, file, line, errno, strerror(errno), assertion); if (f) { va_start(args, f); -- cgit v1.2.3