[Piglit] [PATCH] Add comprehensive tests of builtin functions with uniform input.

Paul Berry stereotype441 at gmail.com
Fri Jul 22 16:09:53 PDT 2011

On 22 July 2011 15:19, Vinson Lee <vlee at vmware.com> wrote:
> The hard requirement of python-2.7 and numpy will make piglit not buildable on many default environments, including Ubuntu 10.10 and Snow Leopard. I prefer a soft requirement where piglit warns and doesn't generate these new tests if the requirements aren't met.

Vinson and I took a look at this in more detail and here's what we found:

- Ubuntu 10.10 and Snow Leopard both have numpy available (in fact, on
Snow Leopard it's installed by default).
- We don't know how easy it is to install numpy on Windows, however
there is a Windows binary available from numpy.scipy.org, so
presumably it is not difficult.
- Ubuntu 10.10 and Snow Leopard ship with Python 2.6.
- I don't know what versions of Python are available on Windows,
however other parts of Piglit have depended on Python 2.6 since at
least as far back as November 2010 (in spite of the README's assertion
that Python 2.4 was sufficient).  So presumably Python 2.6 is
obtainable on Windows.
- Removing this patch's dependency on Python 2.7 would be fairly
trivial--just switch from using argparse to optparse.  It would be
unfortunate, since optparse is deprecated as of Python 2.7, but I'm
sure far worse crimes than this have been committed.
- Removing this patch's dependency on numpy would be a lot more work
(since the test generation code that currently performs vector
operations would have to be rewritten in native Python, decreasing
confidence that the tests are correct).
- A disadvantage of the "soft requirement" approach would be that for
users of OSes in which numpy is easily available but not installed by
default (e.g. Fedora, Ubuntu, and I suspect all other Linux distros),
these users would not be alerted to the fact that they were missing
out on useful tests.  This would constitute a gap in test coverage for
those who didn't notice the new soft requirement on numpy.

(Vinson, I hope I've represented your contribution to the discussion
adequately; if I haven't please feel free to reply)

Based on this, my proposal would be:

- Remove the requirement on Python 2.7 by switching to optparse
instead of argparse
- Retain the hard requirement on numpy.

I realize that it will be an inconvenience to people to have to
install numpy on all of their test machines, and I apologize for that.
 But I have good reason to expect that numpy is easy to install on all
platforms (including Windows).  And considering the fact that we are
testing GL functions that perform vector and matrix math, I believe
it's worth it to be able to perform vector and matrix math in our
testing infrastructure too.

More information about the Piglit mailing list