diff options
author | Eric Anholt <eric@anholt.net> | 2015-07-08 13:34:07 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2015-07-08 22:18:23 -0700 |
commit | 785c0cc14753bb77e7f772ecc8b920eb47866685 (patch) | |
tree | 03ecc61653d7ba5d43fb51e49d96b651a9efedb9 | |
parent | 02bd37fd49fe50f934b803b8f4a7df0943e53339 (diff) |
xts: Add a set of rendercheck tests to run.
We don't do a full run, because that takes approximately an eternity.
However, running a small subset can be useful to catch certain bugs in
Render implementations. This passes on an fb implementation in <4
seconds on my laptop.
v2: Style fixes from Dylan (one variant on his suggestions, to avoid
grouptools.from_path).
Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com> (v1)
Reviewed-by: Dave Airlie <airlied@redhat.com> (v1)
-rw-r--r-- | tests/xts-render.py | 4 | ||||
-rw-r--r-- | tests/xts.py | 60 |
2 files changed, 60 insertions, 4 deletions
diff --git a/tests/xts-render.py b/tests/xts-render.py index 487851bc0..fb4e943f4 100644 --- a/tests/xts-render.py +++ b/tests/xts-render.py @@ -26,6 +26,10 @@ __all__ = ['profile'] def xts_render_filter(path, test): + # Keep any tests that aren't from xts. + if 'xts5' not in path: + return True + # All of Xlib9 is for rendering. return 'xlib9' in path diff --git a/tests/xts.py b/tests/xts.py index d9e3a3e8a..325475f38 100644 --- a/tests/xts.py +++ b/tests/xts.py @@ -161,10 +161,21 @@ class XTSTest(Test): # pylint: disable=too-few-public-methods self.result['images'] = self._process_log_for_images(log) -def _populate_profile(): - """ Populate the profile attribute """ - # Add all tests to the profile - profile = XTSProfile() # pylint: disable=redefined-outer-name +class RendercheckTest(Test): + def __init__(self, args): + super(RendercheckTest, self).__init__(['rendercheck'] + args) + self.testname = "rendercheck " + " ".join(args) + + def interpret_result(self): + if self.result['returncode'] == 0: + self.result['result'] = 'pass' + elif self.result['returncode'] == 77: + self.result['result'] = 'skip' + else: + self.result['result'] = 'fail' + + +def _populate_profile_xts(profile): fpath = os.path.join(X_TEST_SUITE, 'xts5') for dirpath, _, filenames in os.walk(fpath): for fname in filenames: @@ -192,6 +203,47 @@ def _populate_profile(): os.path.join(dirpath, testname), testname, num) + + +def _add_rendercheck_test(profile, path, args): + test = RendercheckTest(args.split(' ')) + group_path = 'rendercheck/' + path + group = grouptools.join(*(group_path.split('/'))) + profile.test_list[group] = test + + +def _populate_profile_rendercheck(profile): + _add_rendercheck_test(profile, 'blend/All/a8r8g8b8', '-t blend -f a8r8g8b8') + _add_rendercheck_test(profile, 'blend/All/x8r8g8b8', '-t blend -f a8r8g8b8,x8r8g8b8') + _add_rendercheck_test(profile, 'blend/All/a2r10g10b10', '-t blend -f a8r8g8b8,a2r10g10b10') + _add_rendercheck_test(profile, 'blend/Clear', '-t blend -o clear') + _add_rendercheck_test(profile, 'blend/Src', '-t blend -o src') + _add_rendercheck_test(profile, 'blend/Over', '-t blend -o over') + _add_rendercheck_test(profile, 'composite/All/a8r8g8b8', '-t composite -f a8r8g8b8') + _add_rendercheck_test(profile, 'composite/All/x8r8g8b8', '-t composite -f a8r8g8b8,x8r8g8b8') + _add_rendercheck_test(profile, 'composite/All/a2r10g10b10', '-t composite -f a8r8g8b8,a2r10g10b10') + _add_rendercheck_test(profile, 'ca composite/All/a8r8g8b8', '-t cacomposite -f a8r8g8b8') + _add_rendercheck_test(profile, 'ca composite/All/x8r8g8b8', '-t cacomposite -f a8r8g8b8,x8r8g8b8') + _add_rendercheck_test(profile, 'ca composite/All/a2r10g10b10', '-t cacomposite -f a8r8g8b8,a2r10g10b10') + _add_rendercheck_test(profile, 'fill', '-t fill') + _add_rendercheck_test(profile, 'bug7366', '-t bug7366') + _add_rendercheck_test(profile, 'destination coordinates', '-t dcoords') + _add_rendercheck_test(profile, 'source coordinates', '-t scoords') + _add_rendercheck_test(profile, 'mask coordinates', '-t mcoords') + _add_rendercheck_test(profile, 'translated source coordinates', '-t tscoords') + _add_rendercheck_test(profile, 'translated mask coordinates', '-t tmcoords') + _add_rendercheck_test(profile, 'triangles', '-t triangles') + _add_rendercheck_test(profile, 'LibreOffice xRGB', '-t libreoffice_xrgb') + _add_rendercheck_test(profile, 'GTK ARGB vs xBGR', '-t gtk_argb_xbgr') + _add_rendercheck_test(profile, 'large blend source', '-t large_blend_src') + + +def _populate_profile(): + """ Populate the profile attribute """ + # Add all tests to the profile + profile = XTSProfile() # pylint: disable=redefined-outer-name + _populate_profile_xts(profile) + _populate_profile_rendercheck(profile) return profile |