[Piglit] [PATCH 06/15] Convert more older tests to use piglit-framework.c.
Paul Berry
stereotype441 at gmail.com
Tue Mar 6 10:56:30 PST 2012
On 5 March 2012 22:12, Eric Anholt <eric at anholt.net> wrote:
> 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.
>
Any idea why the original test displayed two frames in the first place? I
had a look at the bug report the test was based on (
https://bugs.freedesktop.org/show_bug.cgi?id=9833), and it seems like the
sort of bug that would be expected to happen on every frame, or not at all.
>
> Other than that,
>
> Reviewed-by: Eric Anholt <eric at anholt.net>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20120306/ecae78eb/attachment.html>
More information about the Piglit
mailing list