Re: [Piglit] [PATCH v1] Porting the OpenGL shading language from Glean to Piglit.

2015-10-20 Thread Brian Paul
For that particular test, we want to check that glLinkProgram() fails if 
the vertex shader(s) do not write anything to gl_Position.


In tests/all.py, look for 'glsl-link-test'.  For example:

g(['glsl-link-test',
   os.path.join('shaders', 'glsl-link-initializer-06a.vert'),
   os.path.join('shaders', 'glsl-link-initializer-06b.vert'),
   'fail'],
  'GLSL link mismatched global initializer expression')

That's an example of a test that checks for linker failure.

So, you basically have to write a "no_gl_Position_written.vert" file 
something like:


void main()
{
   // no gl_Position writen
   gl_Color = vec4(1,0,0,0);
}

Then, add a new glsl-link-test entry to tests/all.py something like:

g(['glsl-link-test',
   os.path.join('shaders', 'no_gl_Position_written.vert'),
   'fail'],
   'GLSL no gl_Position written')

-Brian



On 10/20/2015 01:16 AM, Juliet Fru wrote:

Hi Brian,

I have been working on the "gl_Position not written check"
(tests/spec/glsl-1.10/linker/) test from glean to shader_test files.Here

is what I have so far.  I'm sure there may be some errors since this
test does not have the fragment shader aspects. I am not very familiar
with shader_test files. I will appreciate if you could correct this
sample test so I could submit the patch and move on to the others.

Thanks,
Juliet

On Wed, Oct 14, 2015 at 9:18 PM, Juliet Fru mailto:juliet...@gmail.com>> wrote:

Thanks, I will look at them As soon as possible.

On Wed, Oct 14, 2015 at 6:09 PM, Brian Paul mailto:bri...@vmware.com>> wrote:

On 10/14/2015 02:33 AM, Juliet Fru wrote:

Hello Brian,

 Please post a plan for what you're doing before you do
all the work
 to make sure you don't do anything unnecessary.

 Like I said before, most of the glsl1 tests should
already be
 covered by existing shader runner tests.  There's
probably not too
 many that need to be ported.


  I don't like this at all. These tests should
become
 shader_test files
  -- not just a straight port from glean to the
piglit framework.


I have been looking at the shader_test files and the
shader_lang tests I
see they're covered in the shader directory. I don't know if
porting
this test is necessary if not I'll like to know which tests
should be
moved as the shader_test files.


I think just a hand-full of tests could be ported to
shader_runner tests.

"current name" and (place to put new test):

"gl_Position not written check"  (tests/spec/glsl-1.10/linker/)

"varying var mismatch"(tests/spec/glsl-1.10/linker/)

"varying read but not written"  (tests/spec/glsl-1.10/linker/)

"illegal assignment"   (tests/spec/glsl-1.10/compiler/)

"continue with no loop"   (tests/spec/glsl-1.10/compiler/)

"break with no loop"  (tests/spec/glsl-1.10/compiler/)

"if (boolean-scalar) check"  (tests/spec/glsl-1.10/compiler/)


There _may_ be shader runner tests already for some of these,
but I didn't find them with a quick search.

-Brian





___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] New tests no longer appearing on changes.html

2015-10-20 Thread Michel Dänzer

I recently noticed that newly added tests are no longer appearing on the
changes.html page. It would be nice to have that back.


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 1/6] framework/test/gleantest.py: call super in interpret_result()

2015-10-20 Thread baker . dylan . c
From: Dylan Baker 

This adds crash and warn statuses back and should have been handled as
part of commit 947b212a39304, but was not.

Signed-off-by: Dylan Baker 
---
 framework/test/gleantest.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/framework/test/gleantest.py b/framework/test/gleantest.py
index 21592c4..cd58f2f 100644
--- a/framework/test/gleantest.py
+++ b/framework/test/gleantest.py
@@ -57,6 +57,7 @@ class GleanTest(Test):
 self.result.result = 'fail'
 else:
 self.result.result = 'pass'
+super(GleanTest, self).interpret_result()
 
 def is_skip(self):
 # Glean tests require glx
-- 
2.6.1

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 5/6] tests/xts.py: call super in intpret_result()

2015-10-20 Thread baker . dylan . c
From: Dylan Baker 

Fix crash/warn handling.

Signed-off-by: Dylan Baker 
---
 tests/xts.py | 4 
 1 file changed, 4 insertions(+)

diff --git a/tests/xts.py b/tests/xts.py
index de560c4..a078056 100644
--- a/tests/xts.py
+++ b/tests/xts.py
@@ -160,6 +160,8 @@ class XTSTest(Test):  # pylint: 
disable=too-few-public-methods
 
 self.result.images = self._process_log_for_images(log)
 
+super(XTSTest, self).interpret_result()
+
 
 class RendercheckTest(Test):
 def __init__(self, args):
@@ -174,6 +176,8 @@ class RendercheckTest(Test):
 else:
 self.result.result = 'fail'
 
+super(RendercheckTest, self).interpret_result()
+
 
 def _populate_profile_xts(profile):
 fpath = os.path.join(X_TEST_SUITE, 'xts5')
-- 
2.6.1

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 6/6] tests/oglconform.py: add super call to interpret_result()

2015-10-20 Thread baker . dylan . c
From: Dylan Baker 

fix crash/warn handling.

cc: Kenneth Graunke 
Signed-off-by: Dylan Baker 
---
 tests/oglconform.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/oglconform.py b/tests/oglconform.py
index cdae4d4..1b8a54c 100644
--- a/tests/oglconform.py
+++ b/tests/oglconform.py
@@ -62,6 +62,8 @@ class OGLCTest(Test):
 else:
 self.result.result = 'fail'
 
+super(OGLCTest, self).interpret_result()
+
 # Create a new top-level 'oglconform' category
 
 testlist_file = '/tmp/oglc.tests'
-- 
2.6.1

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] Fix interpret_result() in integrated test suites

2015-10-20 Thread baker . dylan . c
This fixes crash and warn handling in test suites other than native
piglit.

The problem is that a simple refactor to fix some odd layering problems
wasn't applied to integrated suites by me in commit 947b212a393. This
carries those changes through to fix glean, igt, xts, gtest, and
oglconform.

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 3/6] tests/igt.py: add super call for interpret_result()

2015-10-20 Thread baker . dylan . c
From: Dylan Baker 

Fixes crash/warn status handling.

Signed-off-by: Dylan Baker 
---
 tests/igt.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/igt.py b/tests/igt.py
index 7ba7842..4f970a8 100644
--- a/tests/igt.py
+++ b/tests/igt.py
@@ -118,6 +118,8 @@ class IGTTest(Test):
 else:
 self.result.result = 'fail'
 
+super(IGTTest, self).interpret_result()
+
 
 def list_tests(listname):
 """Parse igt test list and return them as a list."""
-- 
2.6.1

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 2/6] framework/test/gtest.py: add super call in interpret_result

2015-10-20 Thread baker . dylan . c
From: Dylan Baker 

This is required to get the crash and warn status.

Signed-off-by: Dylan Baker 
---
 framework/test/gtest.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/framework/test/gtest.py b/framework/test/gtest.py
index 8d239af..6eba4cb 100644
--- a/framework/test/gtest.py
+++ b/framework/test/gtest.py
@@ -22,7 +22,7 @@
 # Authors: Tom Stellard 
 #
 
-from __future__ import print_function, absolute_import 
+from __future__ import print_function, absolute_import
 import re
 
 from .base import Test
@@ -44,4 +44,5 @@ class GTest(Test):
 else:
 #If we get here, then the test probably exited early.
 self.result.result = 'fail'
-return out
+
+super(GTest, self).interpret_result()
-- 
2.6.1

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 4/6] tests/igt.py: move timeout parameter to class level

2015-10-20 Thread baker . dylan . c
From: Dylan Baker 

It's constant across the class and this will save a tiny bit of memory.

Signed-off-by: Dylan Baker 
---
 tests/igt.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/igt.py b/tests/igt.py
index 4f970a8..d04f6c8 100644
--- a/tests/igt.py
+++ b/tests/igt.py
@@ -101,12 +101,13 @@ profile = IGTTestProfile()  # pylint: disable=invalid-name
 
 class IGTTest(Test):
 """Test class for running libdrm."""
+timeout = 600
+
 def __init__(self, binary, arguments=None):
 if arguments is None:
 arguments = []
 super(IGTTest, self).__init__(
 [os.path.join(IGT_TEST_ROOT, binary)] + arguments)
-self.timeout = 600
 
 def interpret_result(self):
 if self.result.returncode == 0:
-- 
2.6.1

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 3/3] framework/sumamry/common.py: Fix subtest handling in non-all groups

2015-10-20 Thread Dylan Baker
Thanks for testing Marek. Sorry that I broke so many corners of the
summary code.

On Tue, Oct 20, 2015 at 12:32:06PM +0200, Marek Olšák wrote:
> Thanks. It works like a charm.
> 
> Tested-by: Marek Olšák 
> 
> Marek
> 
> On Tue, Oct 20, 2015 at 12:34 AM,   wrote:
> > From: Dylan Baker 
> >
> > The gist of the problem is that we handle lookup for subtests in the all
> > group correctly, but when we went to compare between multiple results we
> > don't.
> >
> > This patch makes use of the get_result from the previous patch to
> > simplify test name lookups, and fix the non-all case.
> >
> > Signed-off-by: Dylan Baker 
> > ---
> >  framework/summary/common.py  | 33 
> > +---
> >  framework/tests/summary_console_tests.py |  2 +-
> >  2 files changed, 19 insertions(+), 16 deletions(-)
> >
> > diff --git a/framework/summary/common.py b/framework/summary/common.py
> > index b67a983..95af02a 100644
> > --- a/framework/summary/common.py
> > +++ b/framework/summary/common.py
> > @@ -55,19 +55,9 @@ class Results(object):  # pylint: 
> > disable=too-few-public-methods
> >  results = []
> >  for res in self.results:
> >  try:
> > -results.append(res.tests[name].result)
> > +results.append(res.get_result(name))
> >  except KeyError:
> >  results.append(so.NOTRUN)
> > -if all(x == so.NOTRUN for x in results):
> > -# this is likely a subtest, see if that's the case
> > -name, test = grouptools.splitname(name)
> > -
> > -results = []
> > -for res in self.results:
> > -try:
> > -results.append(res.tests[name].subtests[test])
> > -except KeyError:
> > -results.append(so.NOTRUN)
> >  return results
> >
> >
> > @@ -138,8 +128,9 @@ class Names(object):
> >  @lazy_property
> >  def enabled(self):
> >  def handler(names, name, prev, cur):
> > -if name not in prev.tests and name in cur.tests:
> > +if _result_in(name, cur) and not _result_in(name, prev):
> >  names.add(name)
> > +
> >  return self.__diff(
> >  lambda x, y: x is so.NOTRUN and y is not so.NOTRUN,
> >  handler=handler)
> > @@ -147,8 +138,9 @@ class Names(object):
> >  @lazy_property
> >  def disabled(self):
> >  def handler(names, name, prev, cur):
> > -if name in prev.tests and name not in cur.tests:
> > +if _result_in(name, prev) and not _result_in(name, cur):
> >  names.add(name)
> > +
> >  return self.__diff(
> >  lambda x, y: x is not so.NOTRUN and y is so.NOTRUN,
> >  handler=handler)
> > @@ -266,6 +258,17 @@ def escape_pathname(key):
> >  return re.sub(r'[/\\]', '_', key)
> >
> >
> > +def _result_in(name, result):
> > +"""If a result (or a subtest result) exists return True, else False."""
> > +try:
> > +# This is a little hacky, but I don't know of a better way where we
> > +# ensure the value is truthy
> > +_ = result.get_result(name)
> > +return True
> > +except KeyError:
> > +return False
> > +
> > +
> >  def find_diffs(results, tests, comparator, handler=lambda *a: None):
> >  """Generate diffs between two or more sets of results.
> >
> > @@ -290,7 +293,7 @@ def find_diffs(results, tests, comparator, 
> > handler=lambda *a: None):
> >  names = set()
> >  for name in tests:
> >  try:
> > -if comparator(prev.tests[name].result, 
> > cur.tests[name].result):
> > +if comparator(prev.get_result(name), cur.get_result(name)):
> >  names.add(name)
> >  except KeyError:
> >  handler(names, name, prev, cur)
> > @@ -305,7 +308,7 @@ def find_single(results, tests, func):
> >  names = set()
> >  for name in tests:
> >  try:
> > -if func(res.tests[name].result):
> > +if func(res.get_result(name)):
> >  names.add(name)
> >  except KeyError:
> >  pass
> > diff --git a/framework/tests/summary_console_tests.py 
> > b/framework/tests/summary_console_tests.py
> > index 5d9d448..53ecdf1 100644
> > --- a/framework/tests/summary_console_tests.py
> > +++ b/framework/tests/summary_console_tests.py
> > @@ -93,7 +93,7 @@ class Test_print_summary(object):
> >  incomplete=template.format('0', '0'),
> >  dmesg_warn=template.format('0', '0'),
> >  dmesg_fail=template.format('0', '0'),
> > -changes=template.format('0', '1'),
> > +changes=template.format('0', '2'),
> >  fixes=template.format('0', '1'),
> >  regressions=template.format('0', '0'),
> >  total=template.format('3', '3')).split('\

Re: [Piglit] [PATCH] Fix oglconform integration.

2015-10-20 Thread Dylan Baker
On Mon, Oct 19, 2015 at 11:35:27PM -0700, Kenneth Graunke wrote:
> Everything reported 'fail' all the time because interpretResult()
> wasn't updated amdist all the Piglit framework rewriting.
> ---
>  tests/oglconform.py | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> This seems to get it working again, but honestly at this point I hardly
> even recognize the codebase...
> 
> diff --git a/tests/oglconform.py b/tests/oglconform.py
> index 4ec127e..cdae4d4 100644
> --- a/tests/oglconform.py
> +++ b/tests/oglconform.py
> @@ -55,12 +55,12 @@ class OGLCTest(Test):
>  '-test', category, subtest])
>  
>  def interpret_result(self):
> -if self.skip_re.search(self.result['out']) is not None:
> -self.result['result'] = 'skip'
> -elif re.search('Total Passed : 1', self.result['out']) is not None:
> -self.result['result'] = 'pass'
> +if self.skip_re.search(self.result.out) is not None:
> +self.result.result = 'skip'
> +elif re.search('Total Passed : 1', self.result.out) is not None:
> +self.result.result = 'pass'
>  else:
> -self.result['result'] = 'fail'
> +self.result.result = 'fail'
>  
>  # Create a new top-level 'oglconform' category
>  
> -- 
> 2.6.1
> 
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit

This looks correct, although I don't have a copy of oglconform to test
with.

Reviewed-by: Dylan Baker 


signature.asc
Description: PGP signature
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v2] ext_texture_format_bgra8888: Add test for GL_BGRA format API errors in Tex(Sub)Image

2015-10-20 Thread Eduardo Lima Mitev
Hi,

Just a heads-up that I'm planning to merge this patch tomorrow. I have
renamed the test to api-errors.c, as Jason asked for his R-b, and also
addressed all suggestions made by Emil.

Eduardo

On 10/16/2015 07:02 PM, Eduardo Lima Mitev wrote:
> This is a new test that checks valid and invalid combinations of GL_BGRA_EXT
> format and internal format in Tex(Sub)Image2D calls, as specified by the
> EXT_texture_format_BGRA extension.
> 
> Although the test is very basic and doesn't really render anything or check
> pixels, it would have prevented the regression described in the bug below,
> which was due to an API error. In the future though, more tests should be
> added to validate the extension more thoroughly.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92265
> ---
>  tests/all.py   |   6 ++
>  tests/spec/CMakeLists.txt  |   1 +
>  .../CMakeLists.gles2.txt   |   7 ++
>  .../ext_texture_format_bgra/CMakeLists.txt |   1 +
>  .../spec/ext_texture_format_bgra/api-errors.c  | 110 
> +
>  5 files changed, 125 insertions(+)
>  create mode 100644 
> tests/spec/ext_texture_format_bgra/CMakeLists.gles2.txt
>  create mode 100644 tests/spec/ext_texture_format_bgra/CMakeLists.txt
>  create mode 100644 tests/spec/ext_texture_format_bgra/api-errors.c
> 
> diff --git a/tests/all.py b/tests/all.py
> index 610d89f..c8220a5 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -2226,6 +2226,12 @@ with profile.group_manager(
>  g(['arb_occlusion_query2-api'], 'api')
>  g(['arb_occlusion_query2-render'], 'render')
>  
> +# Group EXT_texture_format_BGRA tests
> +with profile.group_manager(
> +PiglitGLTest,
> +grouptools.join('spec', 'EXT_texture_format_BGRA')) as g:
> +g(['ext_texture_format_bgra-api-errors'], 'api-errors')
> +
>  with profile.group_manager(
>  PiglitGLTest,
>  grouptools.join('spec', 'ARB_pixel_buffer_object')) as g:
> diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
> index 5dc37a1..bf22680 100644
> --- a/tests/spec/CMakeLists.txt
> +++ b/tests/spec/CMakeLists.txt
> @@ -133,3 +133,4 @@ add_subdirectory (arb_texture_stencil8)
>  add_subdirectory (arb_vertex_attrib_64bit)
>  add_subdirectory (ext_framebuffer_blit)
>  add_subdirectory (mesa_pack_invert)
> +add_subdirectory (ext_texture_format_bgra)
> diff --git a/tests/spec/ext_texture_format_bgra/CMakeLists.gles2.txt 
> b/tests/spec/ext_texture_format_bgra/CMakeLists.gles2.txt
> new file mode 100644
> index 000..09f4e41
> --- /dev/null
> +++ b/tests/spec/ext_texture_format_bgra/CMakeLists.gles2.txt
> @@ -0,0 +1,7 @@
> +link_libraries (
> + piglitutil_${piglit_target_api}
> +)
> +
> +piglit_add_executable (ext_texture_format_bgra-api-errors api-errors.c)
> +
> +# vim: ft=cmake:
> diff --git a/tests/spec/ext_texture_format_bgra/CMakeLists.txt 
> b/tests/spec/ext_texture_format_bgra/CMakeLists.txt
> new file mode 100644
> index 000..144a306
> --- /dev/null
> +++ b/tests/spec/ext_texture_format_bgra/CMakeLists.txt
> @@ -0,0 +1 @@
> +piglit_include_target_api()
> diff --git a/tests/spec/ext_texture_format_bgra/api-errors.c 
> b/tests/spec/ext_texture_format_bgra/api-errors.c
> new file mode 100644
> index 000..e0fe532
> --- /dev/null
> +++ b/tests/spec/ext_texture_format_bgra/api-errors.c
> @@ -0,0 +1,110 @@
> +/*
> + * Copyright © 2015 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
> DEALINGS
> + * IN THE SOFTWARE.
> + */
> +
> +/**
> + * @file
> + * Tests glTex(Sub)Image functions for valid and invalid combinations of
> + * GL_BGRA_EXT format and internal format, as defined by the extension
> + * EXT_texture_format_BGRA888.
> + */
> +
> +#include "piglit-util-gl.h"
> +
> +PIGLIT_GL_TEST_CONFIG_BEGIN

[Piglit] [PATCH] arb-shader-clock: add some basic tests

2015-10-20 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---

My glsl is a bit rusty, and the glsl_version is rather random :-]
Open to suggestions and recommendations though.

-Emil

 tests/spec/arb_shader_clock/linker/sanity.frag | 16 
 tests/spec/arb_shader_clock/linker/sanity.vert | 16 
 2 files changed, 32 insertions(+)
 create mode 100644 tests/spec/arb_shader_clock/linker/sanity.frag
 create mode 100644 tests/spec/arb_shader_clock/linker/sanity.vert

diff --git a/tests/spec/arb_shader_clock/linker/sanity.frag 
b/tests/spec/arb_shader_clock/linker/sanity.frag
new file mode 100644
index 000..07f00e5
--- /dev/null
+++ b/tests/spec/arb_shader_clock/linker/sanity.frag
@@ -0,0 +1,16 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.30
+// require_extensions: GL_ARB_shader_clock
+// check_link: true
+// [end config]
+
+#version 130
+#extension GL_ARB_shader_clock: require
+
+out uvec2 color;
+
+void main()
+{
+color = clock2x32ARB();
+}
diff --git a/tests/spec/arb_shader_clock/linker/sanity.vert 
b/tests/spec/arb_shader_clock/linker/sanity.vert
new file mode 100644
index 000..3d1d673
--- /dev/null
+++ b/tests/spec/arb_shader_clock/linker/sanity.vert
@@ -0,0 +1,16 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.30
+// require_extensions: GL_ARB_shader_clock
+// check_link: true
+// [end config]
+
+#version 130
+#extension GL_ARB_shader_clock: require
+
+out uvec2 x;
+
+void main() {
+gl_Position = vec4(0.0);
+x = clock2x32ARB();
+}
-- 
2.6.1

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 3/3] framework/sumamry/common.py: Fix subtest handling in non-all groups

2015-10-20 Thread Marek Olšák
Thanks. It works like a charm.

Tested-by: Marek Olšák 

Marek

On Tue, Oct 20, 2015 at 12:34 AM,   wrote:
> From: Dylan Baker 
>
> The gist of the problem is that we handle lookup for subtests in the all
> group correctly, but when we went to compare between multiple results we
> don't.
>
> This patch makes use of the get_result from the previous patch to
> simplify test name lookups, and fix the non-all case.
>
> Signed-off-by: Dylan Baker 
> ---
>  framework/summary/common.py  | 33 
> +---
>  framework/tests/summary_console_tests.py |  2 +-
>  2 files changed, 19 insertions(+), 16 deletions(-)
>
> diff --git a/framework/summary/common.py b/framework/summary/common.py
> index b67a983..95af02a 100644
> --- a/framework/summary/common.py
> +++ b/framework/summary/common.py
> @@ -55,19 +55,9 @@ class Results(object):  # pylint: 
> disable=too-few-public-methods
>  results = []
>  for res in self.results:
>  try:
> -results.append(res.tests[name].result)
> +results.append(res.get_result(name))
>  except KeyError:
>  results.append(so.NOTRUN)
> -if all(x == so.NOTRUN for x in results):
> -# this is likely a subtest, see if that's the case
> -name, test = grouptools.splitname(name)
> -
> -results = []
> -for res in self.results:
> -try:
> -results.append(res.tests[name].subtests[test])
> -except KeyError:
> -results.append(so.NOTRUN)
>  return results
>
>
> @@ -138,8 +128,9 @@ class Names(object):
>  @lazy_property
>  def enabled(self):
>  def handler(names, name, prev, cur):
> -if name not in prev.tests and name in cur.tests:
> +if _result_in(name, cur) and not _result_in(name, prev):
>  names.add(name)
> +
>  return self.__diff(
>  lambda x, y: x is so.NOTRUN and y is not so.NOTRUN,
>  handler=handler)
> @@ -147,8 +138,9 @@ class Names(object):
>  @lazy_property
>  def disabled(self):
>  def handler(names, name, prev, cur):
> -if name in prev.tests and name not in cur.tests:
> +if _result_in(name, prev) and not _result_in(name, cur):
>  names.add(name)
> +
>  return self.__diff(
>  lambda x, y: x is not so.NOTRUN and y is so.NOTRUN,
>  handler=handler)
> @@ -266,6 +258,17 @@ def escape_pathname(key):
>  return re.sub(r'[/\\]', '_', key)
>
>
> +def _result_in(name, result):
> +"""If a result (or a subtest result) exists return True, else False."""
> +try:
> +# This is a little hacky, but I don't know of a better way where we
> +# ensure the value is truthy
> +_ = result.get_result(name)
> +return True
> +except KeyError:
> +return False
> +
> +
>  def find_diffs(results, tests, comparator, handler=lambda *a: None):
>  """Generate diffs between two or more sets of results.
>
> @@ -290,7 +293,7 @@ def find_diffs(results, tests, comparator, handler=lambda 
> *a: None):
>  names = set()
>  for name in tests:
>  try:
> -if comparator(prev.tests[name].result, 
> cur.tests[name].result):
> +if comparator(prev.get_result(name), cur.get_result(name)):
>  names.add(name)
>  except KeyError:
>  handler(names, name, prev, cur)
> @@ -305,7 +308,7 @@ def find_single(results, tests, func):
>  names = set()
>  for name in tests:
>  try:
> -if func(res.tests[name].result):
> +if func(res.get_result(name)):
>  names.add(name)
>  except KeyError:
>  pass
> diff --git a/framework/tests/summary_console_tests.py 
> b/framework/tests/summary_console_tests.py
> index 5d9d448..53ecdf1 100644
> --- a/framework/tests/summary_console_tests.py
> +++ b/framework/tests/summary_console_tests.py
> @@ -93,7 +93,7 @@ class Test_print_summary(object):
>  incomplete=template.format('0', '0'),
>  dmesg_warn=template.format('0', '0'),
>  dmesg_fail=template.format('0', '0'),
> -changes=template.format('0', '1'),
> +changes=template.format('0', '2'),
>  fixes=template.format('0', '1'),
>  regressions=template.format('0', '0'),
>  total=template.format('3', '3')).split('\n')
> --
> 2.6.1
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v1] Porting the OpenGL shading language from Glean to Piglit.

2015-10-20 Thread Juliet Fru
Hi Brian,

I have been working on the "gl_Position not written check"
(tests/spec/glsl-1.10/linker/) test from glean to shader_test files. Here
 is what I have so far.  I'm sure there may be
some errors since this test does not have the fragment shader aspects. I am
not very familiar with shader_test files. I will appreciate if you could
correct this sample test so I could submit the patch and move on to the
others.

Thanks,
Juliet

On Wed, Oct 14, 2015 at 9:18 PM, Juliet Fru  wrote:

> Thanks, I will look at them As soon as possible.
>
> On Wed, Oct 14, 2015 at 6:09 PM, Brian Paul  wrote:
>
>> On 10/14/2015 02:33 AM, Juliet Fru wrote:
>>
>>> Hello Brian,
>>>
>>> Please post a plan for what you're doing before you do all the work
>>> to make sure you don't do anything unnecessary.
>>>
>>> Like I said before, most of the glsl1 tests should already be
>>> covered by existing shader runner tests.  There's probably not too
>>> many that need to be ported.
>>>
>>>
>>>  I don't like this at all. These tests should become
>>> shader_test files
>>>  -- not just a straight port from glean to the piglit
>>> framework.
>>>
>>>
>>> I have been looking at the shader_test files and the shader_lang tests I
>>> see they're covered in the shader directory. I don't know if porting
>>> this test is necessary if not I'll like to know which tests should be
>>> moved as the shader_test files.
>>>
>>
>> I think just a hand-full of tests could be ported to shader_runner tests.
>>
>> "current name" and (place to put new test):
>>
>> "gl_Position not written check"  (tests/spec/glsl-1.10/linker/)
>>
>> "varying var mismatch"(tests/spec/glsl-1.10/linker/)
>>
>> "varying read but not written"  (tests/spec/glsl-1.10/linker/)
>>
>> "illegal assignment"   (tests/spec/glsl-1.10/compiler/)
>>
>> "continue with no loop"   (tests/spec/glsl-1.10/compiler/)
>>
>> "break with no loop"  (tests/spec/glsl-1.10/compiler/)
>>
>> "if (boolean-scalar) check"  (tests/spec/glsl-1.10/compiler/)
>>
>>
>> There _may_ be shader runner tests already for some of these, but I
>> didn't find them with a quick search.
>>
>> -Brian
>>
>>
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit