[Piglit] [PATCH 1/2] Convert older tests to use piglit-framework.c

Paul Berry stereotype441 at gmail.com
Sat Feb 25 09:19:06 PST 2012


On 24 February 2012 11:43, Chad Versace <chad.versace at linux.intel.com>wrote:

> On 02/22/2012 01:29 PM, Paul Berry wrote:
> > This patch converts the following tests to use the main() function in
> > piglit-framework.c rather than define their own main() function.
> >
> > - asmparsertest
> > - fdo14575
> > - fdo20701
> > - fdo22540
> > - fdo31934
> > - glslparsertest
> > - texunits
> > ---
> >  tests/asmparsertest/asmparsertest.c   |   44 +++++++----------
> >  tests/bugs/fdo14575.c                 |   29 ++++-------
> >  tests/bugs/fdo20701.c                 |   53 ++++-----------------
> >  tests/bugs/fdo22540.c                 |   31 +++---------
> >  tests/bugs/fdo31934.c                 |   25 ++++------
> >  tests/general/texunits.c              |   84
> +++++++--------------------------
> >  tests/glslparsertest/glslparsertest.c |   23 ++++-----
> >  7 files changed, 87 insertions(+), 202 deletions(-)
> >
>
>
>
> > diff --git a/tests/bugs/fdo20701.c b/tests/bugs/fdo20701.c
> > index 279de10..6bab980 100644
> > --- a/tests/bugs/fdo20701.c
> > +++ b/tests/bugs/fdo20701.c
> > @@ -36,12 +36,14 @@
> >
>
> > @@ -81,8 +61,6 @@ init(void)
> >  {
> >       GLenum status;
> >
> > -     glewInit();
> > -
> >       piglit_require_extension("GL_EXT_framebuffer_object");
> >
> >       glGenFramebuffersEXT(1, &fb);
> > @@ -110,20 +88,7 @@ init(void)
> >  }
> >
> >
> > -int main(int argc, char**argv)
> > +void
> > +piglit_init(int argc, char**argv)
> >  {
> > -     glutInit(&argc, argv);
> > -     if (argc == 2 && !strcmp(argv[1], "-auto"))
> > -             Automatic = 1;
> > -     glutInitDisplayMode(GLUT_RGB);
> > -     glutInitWindowSize(Width, Height);
> > -     glutCreateWindow("FD.O bug #20701 test");
> > -     glutReshapeFunc(Reshape);
> > -     glutKeyboardFunc(Key);
> > -     glutDisplayFunc(Display);
> > -     if (!Automatic)
> > -             printf("If the test doesn't crash, then it passes.\n");
> > -     init();
> > -     glutMainLoop();
> > -     return 0;
> >  }
>
> In fdo20701.c, init() no longer gets called. It needs to be renamed to
> piglit_init().
>

Whoops.  Good catch.  I'm not sure how I missed that.


>
> Other than that, this is
> Reviewed-by: Chad Versace <chad.versace at linux.intel.com>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20120225/aa302545/attachment.html>


More information about the Piglit mailing list