[Piglit] [Patch v2 4/4] tests/xts.py: Add a tests file for the X Test suite.

Eric Anholt eric at anholt.net
Tue Apr 22 16:57:51 PDT 2014


Dylan Baker <baker.dylan.c at gmail.com> writes:

> This adds support for running XTS from piglit.
>
> This patch was original written by Eric Anholt, but I've cleaned it up
> and reworked parts of it for upstreaming, and as a result I've attached
> my name as the author so ``git bisect'' and ``git blame'' will send
> angry mail my way instead of Eric's.

> diff --git a/tests/xts.py b/tests/xts.py
> new file mode 100644
> index 0000000..5f5222c
> --- /dev/null
> +++ b/tests/xts.py

> +import os
> +import re
> +import sys
> +import subprocess
> +import itertools
> +from framework.core import TestProfile
> +from framework.exectest import Test, testBinDir

testBinDir needed fixup on rebasing.

> +__all__ = ['profile']
> +
> +X_TEST_SUITE = os.path.join(testBinDir, 'xtest')
> +
> +
> +class XTSProfile(TestProfile):
> +    """ A sublcass of TestProfile that provides a setup hook for XTS """

"subclass"

> +    def pre_run_hook(self):
> +        """ This hook sets the XTSTest.results_path variable

> +class XTSTest(Test):
> +    """ X Test Suite class
> +
> +    Runs a single test or subtest from XTS. For best results it's recomended
> +    that you run this using Xephyr, the nested x-server
> +
> +    Arguments:
> +    name -- the name of the test
> +    testname -- the name of the test file
> +    testnum -- the number of the test file
> +
> +    """

That advice is kind of silly -- the point of the test suite is to test
an X server.  If you're working on Xorg, well, you need to test Xorg not
Xephyr.

> +                # Each Err*.err log contains a rendered image, and a reference
> +                # image that it was compared to.  We relocate the to our tree
> +                # with more useful names.  (Otherwise, since tests generate
> +                # error logs with numbers sequentially starting from 0, each
> +                # subtest with an error would overwrite the previous test's
> +                # images).
> +                #
> +                # XXX: This *should* be sending the images to the results
> +                # directory, but since nothing fails on my system (and I cant
> +                # hack on the test suite I can't know for sure
> +                ref_path = '{0}/images/{1}-{2}-ref.png'.format(
> +                    XTSTest.RESULTS_PATH, self.testname, match.group(1))
> +                render_path = '{0}/images/{1}-{2}-render.png'.format(
> +                    XTSTest.RESULTS_PATH, self.testname, match.group(1))

Looks like the images handling is working.  I tested it by smashing the
vertex shader for glamor_poly_fill_rect, and I've got images being
produced by XFillRectangle tests.  Thanks for fixing this up!

Other than the spelling fixes, this series is:

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


More information about the Piglit mailing list