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

Brian Paul brianp at vmware.com
Mon Jun 9 14:03:44 PDT 2014


On 06/09/2014 09:39 AM, jfonseca at vmware.com wrote:
> 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;
>   }
>

The series looks OK to me, AFAICT.

Reviewed-by: Brian Paul <brianp at vmware.com>



More information about the Piglit mailing list