[Piglit] [PATCH 06/15] Convert more older tests to use piglit-framework.c.

Eric Anholt eric at anholt.net
Mon Mar 5 22:12:19 PST 2012


On Fri,  2 Mar 2012 15:40:24 -0800, Paul Berry <stereotype441 at gmail.com> wrote:
> This patch converts the following tests to use the main() function in
> piglit-frmework.c rather than define their own main() function.

piglit-framework.c

> -static void display(void)
> +enum piglit_result
> +piglit_display(void)
>  {
>  	static int goterrors = 0;
>  	static int frame = 0;
> @@ -29,21 +31,12 @@ static void display(void)
>  		goterrors++;
>  	}
>  
> -	if (Automatic && frame > 2) {
> -		printf("PIGLIT: {'result': '%s' }\n", goterrors ? "fail" : "pass");
> -		exit(0);
> -	}
> +	piglit_present_results();
>  
> -	glutPostRedisplay();
> +	return goterrors ? PIGLIT_FAIL : PIGLIT_PASS;
>  }

I don't think this is an equivalent change.  glutPostRedisplay()
requested that glut's mainloop call our display function again (thus the
frame++ counting).  Just calling the display function twice from
piglit_display ought to work.

Other than that,

Reviewed-by: Eric Anholt <eric at anholt.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20120305/0b2ff56b/attachment.pgp>


More information about the Piglit mailing list