Re: [Piglit] [Mesa-dev] Request for Mentorship

2015-06-10 Thread Matt Turner
On Wed, Jun 10, 2015 at 5:04 PM, Emil Velikov  wrote:
> On 10 June 2015 at 23:56, Rob Clark  wrote:
>> On Wed, Jun 10, 2015 at 7:28 PM, Emil Velikov  
>> wrote:
>>> On 5 June 2015 at 22:08, Rob Clark  wrote:
 so, maybe a bit off topic (and maybe doesn't really help with the
 whole finding a mentor thing).. but a sort of wish-list thing for
 piglit that I've had in the back of my head is something like "tig"
 for piglit.  I suppose it doesn't have to necessarily be a curses
 based UI, it could be gui..  but a lot of times while I find myself
 searching through results.json to find cmdline to re-run failed tests,
 which is kind of time consuming.  Some sort of front-end to piglit
 which would let me do things like filter on test status, then see
 output/results and if I want re-run the selected test(s) would be kind
 of nice.

>>> Sounds like exactly what the html test summary provides. Although I'm
>>> not sure how many people actually use it - json seems to be more
>>> popular nowadays :-) I even recall naggin' on Dylan when things broke
>>> on an occasion or two.
>>
>> except html is neither interactive nor fast/convenient ;-)
>>
>> The use case I'm thinking of is mostly driver devel/debug where I want
>> to check if some updated version of a change I am working on fixed the
>> regressions, and that sort of thing.  (Or re-run the failed tests with
>> some FD_MESA_DEBUG env var debug flag.)  So ability to re-run
>> individual tests (or group of tests based on filtered result status,
>> etc) is what I'm looking for.  Versus digging through .json or html to
>> find individual cmdlines for some 100's of tests ;-)
>>
> I see. I was fortunate enough to rerun only 2-3 regressing tests,
> rather than 100's, so html was convenient enough :) The "rerun all
> {failing,...} tests" does sound like a useful feature.
>
> -Emil

Why are you guys using a thread about requesting an EVoC mentor for this?
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [Mesa-dev] Request for Mentorship

2015-06-10 Thread Emil Velikov
On 10 June 2015 at 23:56, Rob Clark  wrote:
> On Wed, Jun 10, 2015 at 7:28 PM, Emil Velikov  
> wrote:
>> On 5 June 2015 at 22:08, Rob Clark  wrote:
>>> so, maybe a bit off topic (and maybe doesn't really help with the
>>> whole finding a mentor thing).. but a sort of wish-list thing for
>>> piglit that I've had in the back of my head is something like "tig"
>>> for piglit.  I suppose it doesn't have to necessarily be a curses
>>> based UI, it could be gui..  but a lot of times while I find myself
>>> searching through results.json to find cmdline to re-run failed tests,
>>> which is kind of time consuming.  Some sort of front-end to piglit
>>> which would let me do things like filter on test status, then see
>>> output/results and if I want re-run the selected test(s) would be kind
>>> of nice.
>>>
>> Sounds like exactly what the html test summary provides. Although I'm
>> not sure how many people actually use it - json seems to be more
>> popular nowadays :-) I even recall naggin' on Dylan when things broke
>> on an occasion or two.
>
> except html is neither interactive nor fast/convenient ;-)
>
> The use case I'm thinking of is mostly driver devel/debug where I want
> to check if some updated version of a change I am working on fixed the
> regressions, and that sort of thing.  (Or re-run the failed tests with
> some FD_MESA_DEBUG env var debug flag.)  So ability to re-run
> individual tests (or group of tests based on filtered result status,
> etc) is what I'm looking for.  Versus digging through .json or html to
> find individual cmdlines for some 100's of tests ;-)
>
I see. I was fortunate enough to rerun only 2-3 regressing tests,
rather than 100's, so html was convenient enough :) The "rerun all
{failing,...} tests" does sound like a useful feature.

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


Re: [Piglit] [Mesa-dev] Request for Mentorship

2015-06-10 Thread Rob Clark
On Wed, Jun 10, 2015 at 7:28 PM, Emil Velikov  wrote:
> On 5 June 2015 at 22:08, Rob Clark  wrote:
>> so, maybe a bit off topic (and maybe doesn't really help with the
>> whole finding a mentor thing).. but a sort of wish-list thing for
>> piglit that I've had in the back of my head is something like "tig"
>> for piglit.  I suppose it doesn't have to necessarily be a curses
>> based UI, it could be gui..  but a lot of times while I find myself
>> searching through results.json to find cmdline to re-run failed tests,
>> which is kind of time consuming.  Some sort of front-end to piglit
>> which would let me do things like filter on test status, then see
>> output/results and if I want re-run the selected test(s) would be kind
>> of nice.
>>
> Sounds like exactly what the html test summary provides. Although I'm
> not sure how many people actually use it - json seems to be more
> popular nowadays :-) I even recall naggin' on Dylan when things broke
> on an occasion or two.

except html is neither interactive nor fast/convenient ;-)

The use case I'm thinking of is mostly driver devel/debug where I want
to check if some updated version of a change I am working on fixed the
regressions, and that sort of thing.  (Or re-run the failed tests with
some FD_MESA_DEBUG env var debug flag.)  So ability to re-run
individual tests (or group of tests based on filtered result status,
etc) is what I'm looking for.  Versus digging through .json or html to
find individual cmdlines for some 100's of tests ;-)

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


Re: [Piglit] [Mesa-dev] Request for Mentorship

2015-06-10 Thread Emil Velikov
On 5 June 2015 at 22:08, Rob Clark  wrote:
> so, maybe a bit off topic (and maybe doesn't really help with the
> whole finding a mentor thing).. but a sort of wish-list thing for
> piglit that I've had in the back of my head is something like "tig"
> for piglit.  I suppose it doesn't have to necessarily be a curses
> based UI, it could be gui..  but a lot of times while I find myself
> searching through results.json to find cmdline to re-run failed tests,
> which is kind of time consuming.  Some sort of front-end to piglit
> which would let me do things like filter on test status, then see
> output/results and if I want re-run the selected test(s) would be kind
> of nice.
>
Sounds like exactly what the html test summary provides. Although I'm
not sure how many people actually use it - json seems to be more
popular nowadays :-) I even recall naggin' on Dylan when things broke
on an occasion or two.

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


Re: [Piglit] [PATCH 1/2] framework/summary.py: raise a FatalError for name collision

2015-06-10 Thread Dylan Baker
On Wed, Jun 10, 2015 at 11:01:52AM -0700, Ben Widawsky wrote:
> This patch is:
> Tested-by: Ben Widawsky 
> 
> For patch 2, I'd prefer to just always do the rename, as long as you don't 
> touch
> the original data. I don't see a usecase where anyone would expect and act 
> upon
> this failure. If you must, provide a flag to not do the rename.

If it's all the same then, I'll push patch 1 so we have a good error
message, and then write a patch to automatically rename the result,
without overwriting.

> 
> (If I were being a pedant I would also say you should have patch1 refer to a
> tool that doesn't exist until the next patch, but meh).
> 
> Thanks.
> 

[snip]


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


Re: [Piglit] [PATCH 1/2] framework/summary.py: raise a FatalError for name collision

2015-06-10 Thread Ben Widawsky
This patch is:
Tested-by: Ben Widawsky 

For patch 2, I'd prefer to just always do the rename, as long as you don't touch
the original data. I don't see a usecase where anyone would expect and act upon
this failure. If you must, provide a flag to not do the rename.

(If I were being a pedant I would also say you should have patch1 refer to a
tool that doesn't exist until the next patch, but meh).

Thanks.

On Tue, Jun 09, 2015 at 04:43:02PM -0700, Dylan Baker wrote:
> When two json results have the same "name" value in the root of the json
> dictionary, piglit will try to create two directories with the same
> name. In this event an OSError will be raised to the top level exception
> handler, resulting in a bug warning.
> 
> This patch raises an expected error, giving the user advice on resolving
> the issue.
> 
> Signed-off-by: Dylan Baker 
> ---
>  framework/summary.py | 15 +--
>  1 file changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/framework/summary.py b/framework/summary.py
> index 14eaf05..ecd59f1 100644
> --- a/framework/summary.py
> +++ b/framework/summary.py
> @@ -31,13 +31,14 @@ import re
>  import getpass
>  import sys
>  import posixpath
> +import errno
>  
>  from mako.template import Template
>  
>  # a local variable status exists, prevent accidental overloading by renaming
>  # the module
>  import framework.status as so
> -from framework import grouptools, backends
> +from framework import grouptools, backends, exceptions
>  
>  __all__ = [
>  'Summary',
> @@ -475,7 +476,17 @@ class Summary:
>  # Iterate across the tests creating the various test specific files
>  for each in self.results:
>  name = escape_pathname(each.name)
> -os.mkdir(path.join(destination, name))
> +try:
> +os.mkdir(path.join(destination, name))
> +except OSError as e:
> +if e.errno == errno.EEXIST:
> +raise exceptions.PiglitFatalError(
> +'Two or more of your results have the same "name" '
> +'attribute. Try changing one or more of the "name" '
> +'values in your json files.\n'
> +'Duplicate value: {}'.format(name))
> +else:
> +raise e
>  
>  if each.time_elapsed is not None:
>  time = datetime.timedelta(0, each.time_elapsed)
> -- 
> 2.4.2
> 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] egl-gl-colorspace: new test for the EGL extension

2015-06-10 Thread Marek Olšák
From: Marek Olšák 

---
 tests/all.py  |   7 +++
 tests/egl/CMakeLists.gl.txt   |   2 +
 tests/egl/egl-gl-colorspace.c | 107 ++
 tests/egl/egl-util.c  |   4 +-
 tests/egl/egl-util.h  |   1 +
 5 files changed, 120 insertions(+), 1 deletion(-)
 create mode 100644 tests/egl/egl-gl-colorspace.c

diff --git a/tests/all.py b/tests/all.py
index 2839059..1ec8e92 100755
--- a/tests/all.py
+++ b/tests/all.py
@@ -4234,6 +4234,13 @@ with profile.group_manager(
 
 with profile.group_manager(
 PiglitGLTest,
+grouptools.join('spec', 'egl_khr_gl_colorspace'),
+exclude_platforms=['glx']) as g:
+g(['egl-gl-colorspace'], 'linear')
+g(['egl-gl-colorspace', 'srgb'], 'srgb')
+
+with profile.group_manager(
+PiglitGLTest,
 grouptools.join('spec', 'egl_khr_wait_sync'),
 exclude_platforms=['glx']) as g:
 g(['egl_khr_fence_sync', 'wait_sync'], 'conformance')
diff --git a/tests/egl/CMakeLists.gl.txt b/tests/egl/CMakeLists.gl.txt
index fe055f0..34fee6e 100644
--- a/tests/egl/CMakeLists.gl.txt
+++ b/tests/egl/CMakeLists.gl.txt
@@ -24,6 +24,8 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries(egl-create-pbuffer-surface pthread ${X11_X11_LIB})
piglit_add_executable (egl-configless-context egl-configless-context.c)
target_link_libraries(egl-configless-context pthread ${X11_X11_LIB})
+   piglit_add_executable (egl-gl-colorspace egl-util.c egl-gl-colorspace.c)
+   target_link_libraries(egl-gl-colorspace pthread ${X11_X11_LIB})
 ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
 
 # vim: ft=cmake:
diff --git a/tests/egl/egl-gl-colorspace.c b/tests/egl/egl-gl-colorspace.c
new file mode 100644
index 000..b00233d
--- /dev/null
+++ b/tests/egl/egl-gl-colorspace.c
@@ -0,0 +1,107 @@
+/*
+ * Copyright © 2015 Advanced Micro Devices, Inc.
+ *
+ * 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.
+ */
+
+#include "piglit-util-gl.h"
+#include "egl-util.h"
+
+static bool test_srgb;
+
+static enum piglit_result
+draw(struct egl_state *state)
+{
+   enum piglit_result result = PIGLIT_PASS;
+   float green[] = {0, 0.3, 0, 0};
+   float expected_green[4];
+   float expected_blend[4];
+
+   eglMakeCurrent(state->egl_dpy, state->surf, state->surf, state->ctx);
+
+   glViewport(0, 0, state->width, state->height);
+   piglit_ortho_projection(state->width, state->height, GL_FALSE);
+
+   glClearColor(0.5, 0.5, 0.5, 1.0);
+   glClear(GL_COLOR_BUFFER_BIT);
+
+   glColor4f(green[0], green[1], green[2], green[3]);
+
+   /* Draw first without blending. */
+   piglit_draw_rect(0, 0, 20, 20);
+
+   /* Draw second with blending. */
+   piglit_draw_rect(20, 0, 20, 20);
+   glEnable(GL_BLEND);
+   glBlendFunc(GL_ONE, GL_ONE);
+   piglit_draw_rect(20, 0, 20, 20);
+   glDisable(GL_BLEND);
+
+   /* Check first. */
+   memcpy(expected_green, green, sizeof(float) * 4);
+   if (test_srgb)
+   expected_green[1] = piglit_linear_to_srgb(green[1]);
+   if (!piglit_probe_rect_rgb(0, 0, 20, 20, expected_green))
+   result = PIGLIT_FAIL;
+
+   /* Check second. */
+   memcpy(expected_blend, green, sizeof(float) * 4);
+   if (test_srgb)
+   expected_blend[1] = piglit_linear_to_srgb(green[1] * 2.0);
+   else
+   expected_blend[1] *= 2;
+   if (!piglit_probe_rect_rgb(20, 0, 20, 20, expected_blend))
+   result = PIGLIT_FAIL;
+
+   eglSwapBuffers(state->egl_dpy, state->surf);
+   return result;
+}
+
+int
+main(int argc, char *argv[])
+{
+   struct egl_test test;
+   const char *extensions[] = {"EGL_KHR_gl_colorspace", NULL};
+   const EGLint surface_linear[] = {
+   EGL_GL_COLORSPACE, EGL_GL_COLORSPACE_LINEAR,
+   EGL_NONE
+   };
+   const EGLint surf