lib: Always print errno in igt assert/require macros

Useful to figure out why things have failed.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Daniel Vetter 2013-12-10 08:07:11 +01:00
parent 3c5423b9a7
commit ea8c086919

View File

@ -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);