[Piglit] [PATCH 1/4] util: Ensure that stdout and stderr are flushed on exceptions.

jfonseca at vmware.com jfonseca at vmware.com
Mon Jun 9 08:39:19 PDT 2014


From: José Fonseca <jfonseca at vmware.com>

Also return the exception code as the program return code, which matches
the normal behaviour of uncaught exceptions.

Currently I see several tests failing on Windows, but with no clue
(in stdout, stderr, or exit code) as to why.  This should help.

Trivial.  Only affects Windows.
---
 tests/util/piglit-util.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/util/piglit-util.c b/tests/util/piglit-util.c
index 6fe146e..c9b72ca 100644
--- a/tests/util/piglit-util.c
+++ b/tests/util/piglit-util.c
@@ -307,9 +307,13 @@ exception_handler(PEXCEPTION_POINTERS pExceptionInfo)
 		return EXCEPTION_CONTINUE_SEARCH;
 	}
 
-	fprintf(stderr, "warning: uncaught exception 0x%08lx\n", pExceptionRecord->ExceptionCode);
+	fflush(stdout);
+	fprintf(stderr, "error: uncaught exception 0x%08lx\n",
+		pExceptionRecord->ExceptionCode);
+	fflush(stderr);
 
-	TerminateProcess(GetCurrentProcess(), EXIT_FAILURE);
+	TerminateProcess(GetCurrentProcess(),
+			 pExceptionRecord->ExceptionCode);
 
 	return EXCEPTION_CONTINUE_SEARCH;
 }
-- 
1.9.1



More information about the Piglit mailing list