[Piglit] [PATCH 1/2] variable-index-read.sh: extend to support glsl es 1.00

2013-04-18 Thread Tom Gall
Please apply. Initially posted ~ a month ago. No negative feedback.

From tests/spec/glsl-1.10 extend variable-index-read.sh so that
it can also correctly generates variable index read tests that
support glsl-es-1.00.

1.00 added as a valid parameter to generated tests for glsl-es-1.00.

For 1.00 tests the vertex shader an orthographic projection is
applied since ortho during the test portion isn't supported on
OpenGL ES.

For 1.00 tests the fragent shader specifies default precision.

For 1.00 tests emit in the [require] section the correct
GLSL ES and GL ES settings.

Signed-off-by: Tom Gall tom.g...@linaro.org
---
 tests/spec/glsl-1.10/variable-index-read.sh |   54 ---
 1 file changed, 48 insertions(+), 6 deletions(-)

diff --git a/tests/spec/glsl-1.10/variable-index-read.sh 
b/tests/spec/glsl-1.10/variable-index-read.sh
index 80cb078..8fa2bc7 100755
--- a/tests/spec/glsl-1.10/variable-index-read.sh
+++ b/tests/spec/glsl-1.10/variable-index-read.sh
@@ -156,6 +156,7 @@ function emit_vs
 col=$5
 expect_type=$6
 do_compare=$7
+v=${version/./}
 
 if [ $array_dim -ne 0 ]; then
idx=[${index_value}]
@@ -164,11 +165,24 @@ function emit_vs
 fi
 
 echo [vertex shader]
+if [ $v -eq 100 ]; then
+echo attribute vec4 vertex;
+echo mat4 projection = mat4(
+echo 2.0/250.0, 0.0, 0.0, -1.0,
+echo 0.0, 2.0/250.0, 0.0, -1.0,
+echo 0.0, 0.0, -1.0, 0.0,
+echo 0.0, 0.0, 0.0, 1.0);
+fi
 emit_globals $*
 
 echo void main()
 echo {
-echo gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+if [ $v -eq 100 ]; then
+echo gl_Position = vertex;
+echo gl_Position *= projection;
+else
+echo gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+fi
 
 # Only emit the code to set the matrix if the vertex shader is generating
 # varyings for a fragment shader or the matrix is in local storage and the
@@ -215,8 +229,13 @@ emit_fs()
 col=$5
 expect_type=$6
 do_compare=$7
+v=${version/./}
 
 echo [fragment shader]
+if [ $v -eq 100 ]; then
+echo precision highp float;
+echo precision highp int;
+fi
 emit_globals $*
 
 echo void main()
@@ -275,6 +294,7 @@ function emit_test_vectors
 index_value=$4
 col=$5
 expect_type=$6
+v=${version/./}
 
 # Optimizing GLSL linkers may reduce the size of the uniform array if tail
 # elements are not accessed.  Shader runner will fail the test if one of
@@ -283,16 +303,24 @@ function emit_test_vectors
array_dim=$((index_value+1))
 fi
 
-cat EOF
+if [ $v -eq 100 ]; then
+cat EOF
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+EOF
+else
+cat EOF
 [test]
 clear color 0.5 0.5 0.5 0.5
 clear
 ortho
 
 EOF
+fi
 
 # NOTE: shader_runner uses the matCxR names even for GLSL 1.10
-v=${version/./}
 type=mat${matrix_dim}x${matrix_dim}
 if [ x$mode = xuniform -a $v -le 110 ]; then
if [ $array_dim -eq 0 ]; then
@@ -371,11 +399,18 @@ EOF
 # index in the fragment shader.
 function emit_fs_rd_test
 {
+v=${version/./}
+
 echo # Test generated by:
 echo # ${cmd}
 echo
 echo [require]
-echo GLSL = $version
+if [ $v -eq 100 ]; then
+echo GLSL ES = $version
+echo GL ES = 2.0
+else
+echo GLSL = $version
+fi
 echo
 
 emit_vs $* 0
@@ -389,11 +424,18 @@ function emit_fs_rd_test
 # index in the fragment shader.
 function emit_vs_rd_test
 {
+v=${version/./}
+
 echo # Test generated by:
 echo # ${cmd}
 echo
 echo [require]
-echo GLSL = $version
+if [ $v -eq 100 ]; then
+echo GLSL ES = $version
+echo GL ES = 2.0
+else
+echo GLSL = $version
+fi
 echo
 
 emit_vs $* 1
@@ -408,7 +450,7 @@ if [ x$1 = x ]; then
 version=1.10
 else
 case $1 in
-   1.[12]0) version=$1;;
+   1.[012]0) version=$1;;
*)
echo Bogus GLSL version \$1\ specified.
exit 1
-- 
1.7.10.4

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


[Piglit] [PATCH 2/2] variable-index-write.sh: extend to support glsl es 1.00

2013-04-18 Thread Tom Gall
Please apply. Initially posted ~ a month ago. No negative feedback.

From tests/spec/glsl-1.10 extend variable-index-write.sh so that
it can also correctly generates variable index write tests that
support glsl-es-1.00.

1.00 added as a valid parameter to generated tests for glsl-es-1.00.

For 1.00 tests in the vertex shader an orthographic projection is
applied since ortho during the test portion isn't supported on
OpenGL ES.

For 1.00 tests the fragent shader specifies default precision.

For 1.00 tests emit in the [require] section the correct
GLSL ES and GL ES settings.

Signed-off-by: Tom Gall tom.g...@linaro.org
---
 tests/spec/glsl-1.10/variable-index-write.sh |   67 +++---
 1 file changed, 61 insertions(+), 6 deletions(-)

diff --git a/tests/spec/glsl-1.10/variable-index-write.sh 
b/tests/spec/glsl-1.10/variable-index-write.sh
index 96a4791..06802c4 100755
--- a/tests/spec/glsl-1.10/variable-index-write.sh
+++ b/tests/spec/glsl-1.10/variable-index-write.sh
@@ -177,6 +177,10 @@ function emit_fs
 fi
 
 echo [fragment shader]
+if [ $v -eq 100 ]; then
+echo precision highp float;
+echo precision highp int;
+fi
 
 emit_globals $*
 
@@ -207,14 +211,24 @@ function emit_test_vectors
 index_value=$4
 col=$5
 value_type=$6
+v=${version/./}
 
-cat EOF
+if [ $v -eq 100 ]; then
+cat EOF
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+EOF
+else
+cat EOF
 [test]
 clear color 0.5 0.5 0.5 0.5
 clear
 ortho
 
 EOF
+fi
 
 # NOTE: shader_runner uses the matCxR names even for GLSL 1.10
 type=mat${matrix_dim}x${matrix_dim}
@@ -321,15 +335,37 @@ EOF
 
 function emit_fs_wr_test
 {
+v=${version/./}
+
 echo # Test generated by:
 echo # ${cmd}
 echo
 echo [require]
-echo GLSL = ${version}
+if [ $v -eq 100 ]; then
+echo GLSL ES = ${version}
+echo GL ES = 2.0
+else
+echo GLSL = ${version}
+fi
 echo
 
 echo [vertex shader]
-echo void main() { gl_Position = gl_ModelViewProjectionMatrix * 
gl_Vertex; }
+if [ $v -eq 100 ]; then
+echo attribute vec4 vertex;
+echo mat4 projection = mat4(
+echo 2.0/250.0, 0.0, 0.0, -1.0,
+echo 0.0, 2.0/250.0, 0.0, -1.0,
+echo 0.0, 0.0, -1.0, 0.0,
+echo 0.0, 0.0, 0.0, 1.0);
+echo
+echo void main()
+echo {
+echo gl_Position = vertex;
+echo gl_Position *= projection;
+echo }
+else
+echo void main() { gl_Position = gl_ModelViewProjectionMatrix * 
gl_Vertex; }
+fi
 echo
 
 emit_fs $*
@@ -342,20 +378,39 @@ function emit_vs_wr_test
 matrix_dim=$1
 array_dim=$2
 mode=$3
+v=${version/./}
 
 echo # Test generated by:
 echo # ${cmd}
 echo
 echo [require]
-echo GLSL = ${version}
+if [ $v -eq 100 ]; then
+echo GLSL ES = ${version}
+echo GL ES = 2.0
+else
+echo GLSL = ${version}
+fi
 echo
 
 echo [vertex shader]
+if [ $v -eq 100 ]; then
+echo attribute vec4 vertex;
+echo mat4 projection = mat4(
+echo 2.0/250.0, 0.0, 0.0, -1.0,
+echo 0.0, 2.0/250.0, 0.0, -1.0,
+echo 0.0, 0.0, -1.0, 0.0,
+echo 0.0, 0.0, 0.0, 1.0);
+fi
 emit_globals $*
 
 echo void main()
 echo {
-echo gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+if [ $v -eq 100 ]; then
+echo gl_Position = vertex;
+echo gl_Position *= projection;
+else
+echo gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+fi
 echo
 
 emit_set_matrix $*
@@ -387,7 +442,7 @@ if [ x$1 = x ]; then
 version=1.10
 else
 case $1 in
-   1.[12]0) version=$1;;
+   1.[012]0) version=$1;;
*)
echo Bogus GLSL version \$1\ specified.
exit 1
-- 
1.7.10.4

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


Re: [Piglit] Requiring Python 3.x for Piglit?

2013-04-18 Thread Paul Berry
On 17 April 2013 09:54, Paul Berry stereotype...@gmail.com wrote:

 On 17 April 2013 07:37, Brian Paul bri...@vmware.com wrote:

 On 04/17/2013 03:48 AM, Kenneth Graunke wrote:

 Does anyone object to porting to Python 3.x (and dropping 2.x support)?

 Some useful data points:
 - Debian stable has 3.1, testing/unstable have 3.2
 - Fedora 18 and Arch Linux have 3.3
 - Windows installers for 3.3 are available on python.org
 - Mac OS X support for 3.3 is also available on python.org

 - numpy and mako are both available for Python 3 now. numpy is
 packaged on Arch and Debian testing/unstable. Not sure how much of a
 pain it is to get on Windows/OSX.

 - intel-gpu-tools now requires Python 3.x to build.

 Jon Severinsson did a great job in making a hybrid solution that works
 with both Python 2 and 3, but I'm a bit nervous about some of it. For
 example, unicode stuff has bitten us in the past, and supporting only
 one major language version seems a lot easier to get right. It'd also
 be a lot cleaner to just transition to Python 3.x.


 We have an environment here that uses Python 2.6.  I've had to hack a few
 things to make piglit work there but it's not bad.  Going to Python 3.x
 might be pretty painful, but I'd have to do some research to know for sure,
 and I don't have time right now.


 Are you at liberty to describe a little bit more about this system, and
 why it's difficult to upgrade to Python 3.x on it?  Since Python 3.x can
 safely coexist with Python 2.x on the same machine, I'm having trouble
 imagining why this would be a source of difficulty.



 Can we please hold off on this for a while?


 What do you think a reasonable amount of time would be to wait?


Based on some off-list discussion with Brian and Ian, I think it's
reasonable to hold these patches back for a short time (maybe a month) to
give people time to get ready for the transition.  Here's what I propose:
Let's make a branch right now that requires Python 3.x, so that people can
start testing their Python 3.x integration immediately, and then let's plan
on merging that branch to master on May 20.

If anyone winds up needing a little more time than that to bring their test
systems up to speed, they can always branch piglit from right before the
merge point.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] add new --ignoreStderr option to piglit-run.py

2013-04-18 Thread Brian Paul
Normally, if anything unexpected is printed to stderr we report 'warn'
for the test result.  The list of expected/allowed stderr message is
found at the end of core.py.  It's a PITA to update this list and if
you've temporarily inserted extra debug code in Mesa/gallium it causes
piglit to just report 'warn' instead of the more useful 'pass/fail'.

I wonder if anybody depends on stderr output for generating 'warn'
results.  If not, maybe we should just remove that feature entirely.
---
 framework/core.py |5 +++--
 framework/exectest.py |5 +++--
 piglit-run.py |7 ++-
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/framework/core.py b/framework/core.py
index 08f442f..8d0d0a6 100644
--- a/framework/core.py
+++ b/framework/core.py
@@ -372,13 +372,14 @@ class TestrunResult:
 
 class Environment:
def __init__(self, concurrent=True, execute=True, include_filter=[],
-   exclude_filter=[], valgrind=False):
+   exclude_filter=[], valgrind=False, ignoreStderr=False):
self.concurrent = concurrent
self.execute= execute
self.filter = []
self.exclude_filter = []
self.exclude_tests  = set()
self.valgrind   = valgrind
+   self.ignoreStderr   = ignoreStderr
 

The filter lists that are read in should be a list of string 
objects,
@@ -455,7 +456,7 @@ class Test:
try:
status(running)
time_start = time.time()
-   result = self.run(env.valgrind)
+   result = self.run(env.valgrind, 
env.ignoreStderr)
time_end = time.time()
if 'time' not in result:
result['time'] = time_end - time_start
diff --git a/framework/exectest.py b/framework/exectest.py
index b8d97b8..007cf49 100644
--- a/framework/exectest.py
+++ b/framework/exectest.py
@@ -55,7 +55,7 @@ class ExecTest(Test):
raise NotImplementedError
return out
 
-   def run(self, valgrind):
+   def run(self, valgrind, ignoreStderr):

Run a test.  The return value will be a dictionary with keys
including 'result', 'info', 'returncode' and 'command'.
@@ -161,7 +161,8 @@ class ExecTest(Test):
results['returncode'] = returncode
results['command'] = ' '.join(self.command)
 
-   self.handleErr(results, err)
+   if not ignoreStderr:
+   self.handleErr(results, err)
 
else:
results = TestResult()
diff --git a/piglit-run.py b/piglit-run.py
index 6d6ec77..d6aadf0 100755
--- a/piglit-run.py
+++ b/piglit-run.py
@@ -94,6 +94,10 @@ def main():
parser.add_argument(--valgrind,
action  =  store_true,
help= Run tests in valgrind's memcheck)
+   parser.add_argument(--ignoreStderr,
+   action  = store_true,
+   help= Ignore messages printed to stderr (don't 
report 'warn'
+  for unexpected stderr messages))
parser.add_argument(testProfile,
metavar = Path to test profile,
help= Path to testfile to run)
@@ -155,7 +159,8 @@ def main():
exclude_filter=args.exclude_tests,
include_filter=args.include_tests,
execute=args.execute,
-   valgrind=args.valgrind)
+   valgrind=args.valgrind,
+   ignoreStderr=args.ignoreStderr)
 
# Change working directory to the root of the piglit directory
piglit_dir = path.dirname(path.realpath(sys.argv[0]))
-- 
1.7.3.4

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


[Piglit] [PATCH] add a simple glinfo test program

2013-04-18 Thread Brian Paul
When doing a full piglit run it's helpful to have all the OpenGL
driver version/vendor/extension info.  The piglit framework tries
to run glxinfo/wglinfo and include the output in the results file,
but sometimes those programs aren't installed.
---
 tests/all.tests |1 +
 tests/general/CMakeLists.gl.txt |1 +
 tests/general/glinfo.c  |   92 +++
 3 files changed, 94 insertions(+), 0 deletions(-)
 create mode 100644 tests/general/glinfo.c

diff --git a/tests/all.tests b/tests/all.tests
index daebbd3..4e85a34 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -512,6 +512,7 @@ add_plain_test(gl11, 'fragment-center')
 add_fbo_depthstencil_tests(gl11, 'default_fb')
 add_plain_test(gl11, 'geterror-invalid-enum')
 add_plain_test(gl11, 'geterror-inside-begin')
+add_concurrent_test(gl11, 'glinfo')
 add_plain_test(gl11, 'hiz')
 add_plain_test(gl11, 'infinite-spot-light')
 add_plain_test(gl11, 'line-aa-width')
diff --git a/tests/general/CMakeLists.gl.txt b/tests/general/CMakeLists.gl.txt
index e1eb3e3..0e87baa 100644
--- a/tests/general/CMakeLists.gl.txt
+++ b/tests/general/CMakeLists.gl.txt
@@ -67,6 +67,7 @@ ENDIF (UNIX)
 piglit_add_executable (getactiveattrib getactiveattrib.c)
 piglit_add_executable (geterror-inside-begin geterror-inside-begin.c)
 piglit_add_executable (geterror-invalid-enum geterror-invalid-enum.c)
+piglit_add_executable (glinfo glinfo.c)
 piglit_add_executable (gl30basic gl30basic.c)
 piglit_add_executable (hiz hiz.c)
 if (UNIX)
diff --git a/tests/general/glinfo.c b/tests/general/glinfo.c
new file mode 100644
index 000..b60ae6d
--- /dev/null
+++ b/tests/general/glinfo.c
@@ -0,0 +1,92 @@
+/*
+ * Copyright © 2013 VMware, 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.
+ */
+
+/**
+ * Simply query and print various glGetString() values.
+ * This is helpful when running a complete piglit run since the
+ * results file will have all the pertinant info for the GL driver
+ * that was tested.
+ *
+ * Note that the piglit framework tries to run glxinfo/wglinfo and
+ * put the output in the results file, but sometimes those programs
+ * aren't installed.
+ *
+ * Brian Paul
+ * April 2013
+ */
+
+
+#include piglit-util-gl-common.h
+
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+   config.supports_gl_compat_version = 10;
+   config.window_visual = PIGLIT_GL_VISUAL_RGB;
+PIGLIT_GL_TEST_CONFIG_END
+
+
+enum piglit_result
+piglit_display(void)
+{
+   return PIGLIT_PASS;
+}
+
+
+void
+piglit_init(int argc, char **argv)
+{
+   const char *renderer = (const char *) glGetString(GL_RENDERER);
+   const char *version = (const char *) glGetString(GL_VERSION);
+   const char *vendor = (const char *) glGetString(GL_VENDOR);
+
+   printf(GL_RENDERER = %s\n, renderer);
+   printf(GL_VERSION = %s\n, version);
+   printf(GL_VENDOR = %s\n, vendor);
+
+   if (version[0] = '2') {
+   printf(GL_SHADING_LANGUAGE_VERSION = %s\n, (const char *)
+  glGetString(GL_SHADING_LANGUAGE_VERSION));
+   }
+
+   printf(Extensions:\n);
+   if (version[0] = '3') {
+   GLint numExt, i;
+   glGetIntegerv(GL_NUM_EXTENSIONS, numExt);
+   for (i = 0; i  numExt; i++) {
+   printf(%s\n, (const char *)
+  glGetStringi(GL_EXTENSIONS, i));
+   }
+   }
+   else {
+   const char *ext = (const char *) glGetString(GL_EXTENSIONS);
+   const char *c = ext;
+   for (c = ext; *c; c++) {
+   if (*c == ' ')
+   putchar('\n');
+   else
+   putchar(*c);
+   }
+   }
+
+   piglit_report_result(PIGLIT_PASS);
+}
-- 
1.7.3.4

___
Piglit mailing list

[Piglit] [PATCH 1/1] generated-cl-int-builtins.py:detect and return ints and longs in getValue

2013-04-18 Thread Tom Gall
generated_tests/generate-cl-int-builtins.py in getValue, at the
very end some logic checks for an instance of an int and returns
it.

In the case of a long, this fails and results in a TypeError
killing the build.

Add a check for an instance of a long and return the number just
as is done for an int.

Signed-off-by: Tom Gall tom.g...@linaro.org
---
 generated_tests/generate-cl-int-builtins.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/generated_tests/generate-cl-int-builtins.py 
b/generated_tests/generate-cl-int-builtins.py
index 5b6eaf6..22b0726 100755
--- a/generated_tests/generate-cl-int-builtins.py
+++ b/generated_tests/generate-cl-int-builtins.py
@@ -264,7 +264,7 @@ def getValue(type, val):
 getValue(type, val[3]), getValue(type, val[4]))
 
 #At this point, we should have been passed a number
-if (isinstance(val, int)):
+if ((isinstance(val, int)) or (isinstance(val, long))):
 return val;
 
 print('Invalid value '+val+' encountered in getValue\n')
-- 
1.8.1.2

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


Re: [Piglit] [PATCH 1/1] generated-cl-int-builtins.py:detect and return ints and longs in getValue

2013-04-18 Thread Tom Gall
Bah! Ignore.  Didn't realize my repo was slightly out of date. Sorry about that!

On Thu, Apr 18, 2013 at 3:39 PM, Tom Gall tom.g...@linaro.org wrote:
 generated_tests/generate-cl-int-builtins.py in getValue, at the
 very end some logic checks for an instance of an int and returns
 it.

 In the case of a long, this fails and results in a TypeError
 killing the build.

 Add a check for an instance of a long and return the number just
 as is done for an int.

 Signed-off-by: Tom Gall tom.g...@linaro.org
 ---
  generated_tests/generate-cl-int-builtins.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/generated_tests/generate-cl-int-builtins.py 
 b/generated_tests/generate-cl-int-builtins.py
 index 5b6eaf6..22b0726 100755
 --- a/generated_tests/generate-cl-int-builtins.py
 +++ b/generated_tests/generate-cl-int-builtins.py
 @@ -264,7 +264,7 @@ def getValue(type, val):
  getValue(type, val[3]), getValue(type, val[4]))

  #At this point, we should have been passed a number
 -if (isinstance(val, int)):
 +if ((isinstance(val, int)) or (isinstance(val, long))):
  return val;

  print('Invalid value '+val+' encountered in getValue\n')
 --
 1.8.1.2




-- 
Regards,
Tom

Where's the kaboom!? There was supposed to be an earth-shattering
kaboom! Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] add new piglit-summary.py script for printing summaries of results file(s)

2013-04-18 Thread Brian Paul
If only one result file is specified, just print all the tests
followed by the outcome.  For example:

fbo/FBO blit from missing attachment: pass
fbo/FBO blit to missing attachment: fail
fbo/fbo-1d: pass
fbo/fbo-3d: crash
[...]

If multiple result files are specified, we'll print pass/fail/etc
for each file.  Example:

fbo/FBO blit from missing attachment: pass pass
fbo/FBO blit to missing attachment: fail pass
[...]

If -s (--summary) is specified, only print a summary of the number of
passes, fails, crashes, etc.

if -d (-diff) is specified with multipe result files, only print the
tests which had different outcomes.  Good for spotting regressions.
---
 piglit-summary.py |  158 +
 1 files changed, 158 insertions(+), 0 deletions(-)
 create mode 100755 piglit-summary.py

diff --git a/piglit-summary.py b/piglit-summary.py
new file mode 100755
index 000..ae1e5ca
--- /dev/null
+++ b/piglit-summary.py
@@ -0,0 +1,158 @@
+#!/usr/bin/env python
+#
+# 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:
+#
+# This permission notice 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 AUTHOR(S) 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.
+
+# Print a very simple summary of piglit results file(s).
+# When multiple result files are specified, compare the results
+# of each test run to look for differences/regressions.
+#
+# Brian Paul
+# April 2013
+
+
+from getopt import getopt, GetoptError
+import cgi
+import os, os.path
+import sys
+import string
+
+sys.path.append(os.path.dirname(os.path.realpath(sys.argv[0])))
+import framework.core as core
+import framework.summary
+
+
+#
+# Main program
+#
+def usage():
+   USAGE = \
+Usage: %(progName)s [options] resultsfile [...]
+
+Print path/name of each test and the result.
+When multiple files are specified, count the number of differences in results.
+Tests are sorted by name.
+
+Options:
+  -h, --helpShow this message
+  -s, --summary Only display pass/fail summary
+  -d, --diffOnly display the differences between multiple result 
files
+  -l, --list=listfile   Use test results from a list file
+
+   print USAGE % {'progName': sys.argv[0]}
+   sys.exit(1)
+
+
+def parse_listfile(filename):
+   file = open(filename, r)
+   code = .join([s for s in file])
+   file.close()
+   return eval(code)
+
+def loadresult(descr):
+   result = core.loadTestResults(descr[0])
+   if len(descr)  1:
+   result.__dict__.update(descr[1])
+   return result
+
+def main():
+   try:
+   options, args = getopt(sys.argv[1:], hsdl:, [ help, 
summary, diff, list ])
+   except GetoptError:
+   usage()
+
+   OptionList = []
+   CountsOnly = False
+   DiffOnly = False
+   for name, value in options:
+   if name == -h or name == --help:
+   usage()
+   elif name == -s or name == --summary:
+   CountsOnly = True
+   elif name == -d or name == --diff:
+   DiffOnly = True
+   elif name == -l or name == --list:
+   OptionList += parse_listfile(value)
+
+   OptionList += [[name] for name in args[0:]]
+
+   if len(args)  1 or len(OptionList) == 0:
+   usage()
+
+   # make list of results
+   results = []
+   for result_dir in OptionList:
+   results.append(loadresult(result_dir))
+
+   summary = framework.summary.Summary(results)
+
+   # possible test outcomes
+   possible_results = [ pass, fail, crash, skip, warn ]
+   if len(OptionList)  1:
+   possible_results.append(changes)
+
+   # init the summary counters
+   counts = {}
+   for result in possible_results:
+   counts[result] = 0
+
+   # get all results
+   all = summary.allTests()
+
+   # sort the results list by path
+   all = sorted(all,