[Piglit] [PATCH] fp64: add test for aligning doubles in transform feedback

2015-02-22 Thread Dave Airlie
From: Dave Airlie 

The spec states we must manually align using ARB_transform_feedback3
skips if necessary, so test that works by forcing a double after a
float + a skip.

Signed-off-by: Dave Airlie 
---
 .../execution/CMakeLists.gl.txt|   2 +
 .../execution/tf-interleaved-aligned.c | 194 +
 2 files changed, 196 insertions(+)
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/execution/tf-interleaved-aligned.c

diff --git a/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt 
b/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt
index 64b9bcf..749e546 100644
--- a/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt
+++ b/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt
@@ -10,6 +10,8 @@ link_libraries (
${OPENGL_glu_LIBRARY}
 )
 
+
 piglit_add_executable (arb_gpu_shader_fp64-tf-separate tf-separate.c)
 piglit_add_executable (arb_gpu_shader_fp64-tf-interleaved tf-interleaved.c)
+piglit_add_executable (arb_gpu_shader_fp64-tf-interleaved-aligned 
tf-interleaved-aligned.c)
 piglit_add_executable (arb_gpu_shader_fp64-double-gettransformfeedbackvarying 
double-gettransformfeedbackvarying.c)
diff --git a/tests/spec/arb_gpu_shader_fp64/execution/tf-interleaved-aligned.c 
b/tests/spec/arb_gpu_shader_fp64/execution/tf-interleaved-aligned.c
new file mode 100644
index 000..4615e3c
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/execution/tf-interleaved-aligned.c
@@ -0,0 +1,194 @@
+/*
+ * Copyright © 2011 Marek Olšák 
+ * Copyright © 2015 Red Hat
+ *
+ * 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.
+ */
+
+/**
+ * ARB_gpu_shader_fp64 + ARB_transform_feedback3  test.
+ *
+ * Test writing interleaved vertex attribs into a buffer object.
+ * Writing unaligned doubles is undefined so if we want to have a float
+ * follow a double we need to use ARB_tf3
+ *
+ * "If capturing a mix of single- and double-precision components, it might
+ *  be necessary to use the "gl_SkipComponents1" variable from
+ *  ARB_transform_feedback3 to force proper alignment."
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_core_version = 32;
+   config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+static const char *vstext = {
+   "#version 150\n"
+   "#extension GL_ARB_gpu_shader_fp64 : require\n"
+   "in vec4 vertex;"
+   "out vec4 color;"
+   "out float tf;"
+   "out dvec3 v3;"
+   "out dvec2 v2;"
+   "void main() {"
+   "  gl_Position = vertex;"
+   "  color = vec4(1.0, 0.9, 0.8, 0.7);"
+   "  tf = 0.5;"
+   "  v2 = dvec2(0.2lf, 0.7lf);"
+   "  v3 = dvec3(0.55lf, 0.66lf, 0.77lf);"
+   "}"
+};
+
+static const char *varyings[] = {"tf", "gl_SkipComponents1", "v3", "color", 
"v2"};
+GLuint buf;
+GLuint prog;
+GLuint vao, vbo;
+
+#define NUM_COMPONENTS 16
+#define TOTAL_BUF_COMPONENTS (NUM_COMPONENTS*6)
+
+static uint32_t dbl_components = (0x3f << 2) | (0xf << 12);
+void piglit_init(int argc, char **argv)
+{
+   GLuint vs, i;
+   GLint maxcomps;
+   float *ptr;
+
+   /* Check the driver. */
+   piglit_require_transform_feedback();
+   piglit_require_extension("GL_ARB_gpu_shader_fp64");
+   piglit_require_extension("GL_ARB_transform_feedback3");
+
+   glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT, 
&maxcomps);
+   if (maxcomps < 18) {
+   fprintf(stderr, "Not enough interleaved components supported by 
transform feedback.\n");
+   piglit_report_result(PIGLIT_SKIP);
+   }
+
+   /* Create shaders. */
+   vs = piglit_compile_shader_text(GL_VERTEX_SHADER, vstext);
+   prog = glCreateProgram();
+   glAttachShader(prog, vs);
+   glTransformFeedbackVaryings(prog, sizeof(varyings)/sizeof(varyings[0]),
+   varyings,

[Piglit] [PATCH] fp64: check GetTransformFeedbackVaryings returns the correct types

2015-02-22 Thread Dave Airlie
From: Dave Airlie 

This just tests we get back the correct GL types from the query.

This passes on mesa currently.

Signed-off-by: Dave Airlie 
---
 .../execution/CMakeLists.gl.txt|   1 +
 .../execution/double-gettransformfeedbackvarying.c | 133 +
 2 files changed, 134 insertions(+)
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c

diff --git a/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt 
b/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt
index af7df11..68d0b07 100644
--- a/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt
+++ b/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt
@@ -11,3 +11,4 @@ link_libraries (
 )
 
 piglit_add_executable (arb_gpu_shader_fp64-tf-separate tf-separate.c)
+piglit_add_executable (arb_gpu_shader_fp64-double-gettransformfeedbackvarying 
double-gettransformfeedbackvarying.c)
diff --git 
a/tests/spec/arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c 
b/tests/spec/arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c
new file mode 100644
index 000..ff4b0e0
--- /dev/null
+++ 
b/tests/spec/arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c
@@ -0,0 +1,133 @@
+/*
+ * Copyright © 2015 Red Hat
+ *
+ * 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 double-gettransformfeedbackvarying.c
+ *
+ * Verify that transform feedback on double varyings returns
+ * the correct types.
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+config.supports_gl_core_version = 32;
+   config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGB;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+#define MAX_EXPECTED_OUTPUT_COMPONENTS 8
+
+static const char *vstext = {
+   "#version 150\n"
+   "#extension GL_ARB_gpu_shader_fp64 : require\n"
+   "in vec4 vertex;"
+   "out %s tfout;"
+   "void main() {"
+   "  gl_Position = vertex;"
+   "  tfout = %s(0.2lf);"
+   "}"
+};
+
+static struct get_tests {
+   GLenum type;
+   const char *glsltype;
+   int size;
+} tests[] = {
+   { GL_DOUBLE, "double", 1 },
+   { GL_DOUBLE_VEC2 , "dvec2", 1 },
+   { GL_DOUBLE_VEC3 , "dvec3", 1 },
+   { GL_DOUBLE_VEC4 , "dvec4", 1 },
+   { GL_DOUBLE_MAT2 , "dmat2", 1 },
+   { GL_DOUBLE_MAT2x3 , "dmat2x3", 1 },
+   { GL_DOUBLE_MAT2x4 , "dmat2x4", 1 },
+   { GL_DOUBLE_MAT3 , "dmat3", 1 },
+   { GL_DOUBLE_MAT3x2 , "dmat3x2", 1 },
+   { GL_DOUBLE_MAT3x4 , "dmat3x4", 1 },
+   { GL_DOUBLE_MAT4 , "dmat4", 1 },
+   { GL_DOUBLE_MAT4x2 , "dmat4x2", 1 },
+   { GL_DOUBLE_MAT4x3 , "dmat4x3", 1 },
+};
+   
+static bool size_and_type_ok = true;
+static const char *varyings[] = { "tfout" };
+
+void run_test(struct get_tests *test)
+{
+   GLsizei size;
+   GLenum type;
+   GLuint vs;
+   GLuint prog;
+   char vstest[1024];
+
+   snprintf(vstest, 1024, vstext, test->glsltype, test->glsltype);
+
+   vs = piglit_compile_shader_text(GL_VERTEX_SHADER, vstest);
+   prog = glCreateProgram();
+   glAttachShader(prog, vs);
+   glBindAttribLocation(prog, 0, "vertex");
+   glTransformFeedbackVaryings(prog, ARRAY_SIZE(varyings),
+   varyings,
+   GL_INTERLEAVED_ATTRIBS_EXT);
+   glLinkProgram(prog);
+   if (!piglit_link_check_status(prog)) {
+   glDeleteProgram(prog);
+   piglit_report_result(PIGLIT_FAIL);
+   }
+
+   glGetTransformFeedbackVarying(prog, 0, 0, NULL, &size,
+ &type, NULL);
+   if (size != test->size) {
+   printf("For %s, size %d vs %d\n", test->glsltype, size, 
test->size);
+   size_and_type_ok = false;
+   }
+   if (type != test->type) {
+   pri

[Piglit] [PATCH 1/2] piglit/util: add support for probing doubles in a buffer.

2015-02-22 Thread Dave Airlie
From: Dave Airlie 

This is needed to test transform feedback with FP64.

Signed-off-by: Dave Airlie 
---
 tests/util/piglit-util-gl.c | 23 +++
 tests/util/piglit-util-gl.h |  4 +++-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index aae6df0..1b54045 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -1814,6 +1814,29 @@ bool piglit_probe_buffer(GLuint buf, GLenum target, 
const char *label,
return status;
 }
 
+bool piglit_probe_buffer_doubles(GLuint buf, GLenum target, const char *label,
+unsigned n, unsigned num_components,
+const double *expected)
+{
+   double *ptr;
+   unsigned i;
+   bool status = true;
+
+   glBindBuffer(target, buf);
+   ptr = glMapBuffer(target, GL_READ_ONLY);
+
+   for (i = 0; i < n * num_components; i++) {
+   if (fabs(ptr[i] - expected[i % num_components]) > 0.01) {
+   printf("%s[%i]: %f, Expected: %f\n", label, i, ptr[i],
+   expected[i % num_components]);
+   status = false;
+   }
+   }
+
+   glUnmapBuffer(target);
+
+   return status;
+}
 GLint piglit_ARBfp_pass_through = 0;
 
 int piglit_use_fragment_program(void)
diff --git a/tests/util/piglit-util-gl.h b/tests/util/piglit-util-gl.h
index 0f8eb81..3c7d8da 100644
--- a/tests/util/piglit-util-gl.h
+++ b/tests/util/piglit-util-gl.h
@@ -165,7 +165,9 @@ int piglit_probe_rect_halves_equal_rgba(int x, int y, int 
w, int h);
 bool piglit_probe_buffer(GLuint buf, GLenum target, const char *label,
 unsigned n, unsigned num_components,
 const float *expected);
-
+bool piglit_probe_buffer_doubles(GLuint buf, GLenum target, const char *label,
+unsigned n, unsigned num_components,
+const double *expected);
 int piglit_use_fragment_program(void);
 int piglit_use_vertex_program(void);
 void piglit_require_fragment_program(void);
-- 
1.9.3

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


[Piglit] [PATCH 2/2] fp64: add separate transform feedback test.

2015-02-22 Thread Dave Airlie
From: Dave Airlie 

Based on the current EXT_transform_feedback/separate.c test
this just adds some doubles to the mix.

Signed-off-by: Dave Airlie 
---
 tests/spec/arb_gpu_shader_fp64/CMakeLists.txt  |   1 +
 .../execution/CMakeLists.gl.txt|  13 ++
 .../arb_gpu_shader_fp64/execution/CMakeLists.txt   |   1 +
 .../arb_gpu_shader_fp64/execution/tf-separate.c| 174 +
 4 files changed, 189 insertions(+)
 create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt
 create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.txt
 create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/tf-separate.c

diff --git a/tests/spec/arb_gpu_shader_fp64/CMakeLists.txt 
b/tests/spec/arb_gpu_shader_fp64/CMakeLists.txt
index 144a306..e4126fc 100644
--- a/tests/spec/arb_gpu_shader_fp64/CMakeLists.txt
+++ b/tests/spec/arb_gpu_shader_fp64/CMakeLists.txt
@@ -1 +1,2 @@
+add_subdirectory (execution)
 piglit_include_target_api()
diff --git a/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt 
b/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt
new file mode 100644
index 000..af7df11
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt
@@ -0,0 +1,13 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+   ${piglit_SOURCE_DIR}/tests/util
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+   ${OPENGL_glu_LIBRARY}
+)
+
+piglit_add_executable (arb_gpu_shader_fp64-tf-separate tf-separate.c)
diff --git a/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.txt 
b/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/arb_gpu_shader_fp64/execution/tf-separate.c 
b/tests/spec/arb_gpu_shader_fp64/execution/tf-separate.c
new file mode 100644
index 000..7f2bf33
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/execution/tf-separate.c
@@ -0,0 +1,174 @@
+/*
+ * Copyright © 2011 Marek Olšák 
+ * Copyright © 2015 Red Hat
+ *
+ * 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.
+ *
+ * Authors:
+ *   Dave Airlie
+ */
+
+/**
+ * ARB_gpu_shader_fp64 + EXT_transform_feedback test.
+ *
+ * Test writing separate double vertex attribs into a buffer object.
+ * this is based on Marek's separate.c test for EXT_transform_feedback
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+config.supports_gl_core_version = 32;
+   config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+static const char *vstext = {
+   "#version 150\n"
+   "#extension GL_ARB_gpu_shader_fp64 : require\n"
+   "in vec4 vertex;"
+   "out vec4 color;"
+   "out vec4 texcoord[2];"
+   "out dvec3 v3;"
+   "out dvec2 v2;"
+   "void main() {"
+   "  gl_Position = vertex;"
+   "  color = vec4(1.0, 0.9, 0.8, 0.7);"
+   "  texcoord[0] = vec4(0.5);"
+   "  texcoord[1] = vec4(0.6, 0.0, 0.1, 0.6);"
+   "  v2 = dvec2(0.2lf, 0.7lf);"
+   "  v3 = dvec3(0.55lf, 0.66lf, 0.77lf);"
+   "}"
+};
+
+static const char *varyings[] = {"v3", "color", "v2", "texcoord[1]"};
+GLuint buf[4];
+GLuint prog;
+GLuint vbo, vao;
+
+#define NUM_OUT_VERTICES 6
+
+void piglit_init(int argc, char **argv)
+{
+   GLuint vs;
+   GLint maxcomps, maxattrs;
+   unsigned i;
+
+   /* Check the driver. */
+   piglit_require_transform_feedback();
+   piglit_require_extension("GL_ARB_gpu_shader_fp64");
+
+   glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT, 
&maxattrs);
+   if (maxattrs < 4) {
+   fprintf(stderr, "Not enough separate attribs supported by 
transform feedback.\n");
+   piglit_

[Piglit] [rfc/rft] transform feedback doubles test

2015-02-22 Thread Dave Airlie
Just sending this out now, I haven't verified it on anything as I
don't have easy access to the binary drivers currently. It fails
on mesa I need to work out if its the test or mesa now.

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


[Piglit] [PATCH] util: Add check for aligned_alloc.

2015-02-22 Thread Vinson Lee
glibc < 2.16 does not have aligned_alloc.

Signed-off-by: Vinson Lee 
---
 CMakeLists.txt   | 1 +
 tests/util/config.h.in   | 1 +
 tests/util/piglit-util.c | 6 +++---
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index db5f718..dc5e92e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -400,6 +400,7 @@ if(NOT MINGW)
 check_function_exists(fopen_s   HAVE_FOPEN_S)
 endif()
 check_function_exists(setrlimit HAVE_SETRLIMIT)
+check_function_exists(aligned_alloc HAVE_ALIGNED_ALLOC)
 
 check_include_file(sys/time.h  HAVE_SYS_TIME_H)
 check_include_file(sys/types.h HAVE_SYS_TYPES_H)
diff --git a/tests/util/config.h.in b/tests/util/config.h.in
index c6e23db..5fab0e6 100644
--- a/tests/util/config.h.in
+++ b/tests/util/config.h.in
@@ -4,6 +4,7 @@
 #cmakedefine HAVE_FOPEN_S
 #cmakedefine HAVE_SETRLIMIT
 #cmakedefine HAVE_STRNDUP
+#cmakedefine HAVE_ALIGNED_ALLOC
 
 #cmakedefine HAVE_FCNTL_H
 #cmakedefine HAVE_SYS_STAT_H
diff --git a/tests/util/piglit-util.c b/tests/util/piglit-util.c
index 4c5e389..4d8291d 100644
--- a/tests/util/piglit-util.c
+++ b/tests/util/piglit-util.c
@@ -829,14 +829,14 @@ piglit_alloc_aligned(size_t size, size_t alignment)
 {
 #if defined(_WIN32)
return _aligned_malloc(size, alignment);
-#elif defined(__APPLE__)
+#elif defined(HAVE_ALIGNED_ALLOC)
+   return aligned_alloc(alignment, size);
+#else
void *p;
if (posix_memalign(&p, alignment, size) != 0) {
return NULL;
}
return p;
-#else
-   return aligned_alloc(alignment, size);
 #endif
 }
 
-- 
2.3.0

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


Re: [Piglit] [PATCH 31/34] genclbuiltins.py: add MIT header

2015-02-22 Thread Matt Turner
On Fri, Feb 20, 2015 at 6:18 PM, Dylan Baker  wrote:
> presumably this was always available under the MIT license, but I think
> its worthwhile to add the header.
>
> Signed-off-by: Dylan Baker 
> ---
>  generated_tests/genclbuiltins.py | 22 --

This file was originally split from
generated_tests/generate-cl-int-builtins.py, so I went to see what
license it had... none as well. We should add a license there at the
same time.

Aaron, Tom: okay to add an MIT license header to both of these files?
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] junit.py: Fix handling of special test names.

2015-02-22 Thread Jose Fonseca



On 21/02/15 02:00, Dylan Baker wrote:

This looks fine to me, and fixes our problem.

Jose, is this going to break your setup?

Assuming Jose says that is good:
Reviewed-by: Dylan Baker 

On Fri, Feb 20, 2015 at 05:51:34PM -0800, Mark Janes wrote:

In junit.py, the testname variable is used by a closure within the
write_test() scope.  Modifying it breaks the filtering of expected
failures.


That's subtle. I did search whether testname were used elsewhere, but 
missed this.



---
  framework/backends/junit.py | 9 +
  1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/framework/backends/junit.py b/framework/backends/junit.py
index ddaf826..d4b5041 100644
--- a/framework/backends/junit.py
+++ b/framework/backends/junit.py
@@ -166,16 +166,17 @@ class JUnitBackend(FileBackend):
  # set different root names.
  classname = 'piglit.' + classname

-testname += self._test_suffix
-
  # Jenkins will display special pages when the test has certain names.
  # 
https://urldefense.proofpoint.com/v2/url?u=https-3A__jenkins-2Dci.org_issue_18062&d=AwIFAg&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=zfmBZnnVGHeYde45pMKNnVyzeaZbdIqVLprmZCM2zzE&m=seHXT-vNhxoMsHbvPnVAJ13Oa_dx281dugC1MaN1uew&s=1af7XzZZFlcd2-04Wal262nqO5o9N3URGyOSLdDI7mA&e=
  # 
https://urldefense.proofpoint.com/v2/url?u=https-3A__jenkins-2Dci.org_issue_19810&d=AwIFAg&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=zfmBZnnVGHeYde45pMKNnVyzeaZbdIqVLprmZCM2zzE&m=seHXT-vNhxoMsHbvPnVAJ13Oa_dx281dugC1MaN1uew&s=jtIsqFvKdOW8zjnk3uXyHSfW0EG-Jk40y45JjTb7EBU&e=
-if testname in ('api', 'search'):
+# If there is a suffix, then the test link will not be one of
+# the reserved names.  Don't modify testname, as it is used in
+# the calculate_result closure.
+if not self._test_suffix and testname in ('api', 'search'):


Maybe

  if (testname + self._test_suffix) in  ('api', 'search'):

or use a different variable for the `testname + self._test_suffix` 
sub-expression.


Either way,

Reviewed-by: Jose Fonseca 





  testname += '_'

  # Create the root element
-element = etree.Element('testcase', name=testname,
+element = etree.Element('testcase', name=testname + self._test_suffix,
  classname=classname,
  time=str(data['time']),
  status=str(data['result']))
--
2.1.4



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