This looks good to me:<div><br></div><div>Reviewed-by: Robert Bragg <<a href="mailto:robert@linux.intel.com">robert@linux.intel.com</a>></div><div><br></div><div>thanks,</div><div>- Robert</div><br><div class="gmail_quote">
On Fri, Nov 9, 2012 at 4:56 PM, Neil Roberts <span dir="ltr"><<a href="mailto:neil@linux.intel.com" target="_blank">neil@linux.intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The tests that were using GLSL or 3D textures were directly printing<br>
“Skipped” and then reporting success. Instead of doing this they now<br>
just try to continue without checking for the feature but the<br>
appropriate test requirement flag is now set in test-conform-main so<br>
the table of results will correctly display that is a failure.<br>
---<br>
 tests/conform/test-conform-main.c       | 10 +++----<br>
 tests/conform/test-custom-attributes.c  | 52 +++++++++++++++------------------<br>
 tests/conform/test-just-vertex-shader.c | 15 +++-------<br>
 tests/conform/test-pipeline-uniforms.c  | 50 ++++++++++++++-----------------<br>
 tests/conform/test-snippets.c           | 26 +++++++----------<br>
 tests/conform/test-texture-3d.c         | 34 +++++++++------------<br>
 tests/conform/test-utils.c              |  6 ++++<br>
 tests/conform/test-utils.h              |  3 +-<br>
 8 files changed, 85 insertions(+), 111 deletions(-)<br>
<br>
diff --git a/tests/conform/test-conform-main.c b/tests/conform/test-conform-main.c<br>
index 9e2df06..701581c 100644<br>
--- a/tests/conform/test-conform-main.c<br>
+++ b/tests/conform/test-conform-main.c<br>
@@ -69,7 +69,7 @@ main (int argc, char **argv)<br>
   ADD_TEST (test_sub_texture, 0);<br>
   ADD_TEST (test_pixel_buffer, 0);<br>
   UNPORTED_TEST (test_texture_rectangle);<br>
-  ADD_TEST (test_texture_3d, 0);<br>
+  ADD_TEST (test_texture_3d, TEST_REQUIREMENT_TEXTURE_3D);<br>
   ADD_TEST (test_wrap_modes, 0);<br>
   UNPORTED_TEST (test_texture_pixmap_x11);<br>
   UNPORTED_TEST (test_texture_get_set_data);<br>
@@ -83,10 +83,10 @@ main (int argc, char **argv)<br>
<br>
   ADD_TEST (test_primitive, 0);<br>
<br>
-  ADD_TEST (test_just_vertex_shader, 0);<br>
-  ADD_TEST (test_pipeline_uniforms, 0);<br>
-  ADD_TEST (test_snippets, 0);<br>
-  ADD_TEST (test_custom_attributes, 0);<br>
+  ADD_TEST (test_just_vertex_shader, TEST_REQUIREMENT_GLSL);<br>
+  ADD_TEST (test_pipeline_uniforms, TEST_REQUIREMENT_GLSL);<br>
+  ADD_TEST (test_snippets, TEST_REQUIREMENT_GLSL);<br>
+  ADD_TEST (test_custom_attributes, TEST_REQUIREMENT_GLSL);<br>
<br>
   ADD_TEST (test_bitmask, 0);<br>
<br>
diff --git a/tests/conform/test-custom-attributes.c b/tests/conform/test-custom-attributes.c<br>
index e726488..fce541e 100644<br>
--- a/tests/conform/test-custom-attributes.c<br>
+++ b/tests/conform/test-custom-attributes.c<br>
@@ -270,33 +270,27 @@ paint (TestState *state)<br>
 void<br>
 test_custom_attributes (void)<br>
 {<br>
-  /* If shaders aren't supported then we can't run the test */<br>
-  if (cogl_has_feature (test_ctx, COGL_FEATURE_ID_GLSL))<br>
-    {<br>
-      CoglSnippet *snippet;<br>
-      TestState state;<br>
-<br>
-      cogl_framebuffer_orthographic (test_fb,<br>
-                                     0, 0,<br>
-                                     cogl_framebuffer_get_width (test_fb),<br>
-                                     cogl_framebuffer_get_height (test_fb),<br>
-                                     -1,<br>
-                                     100);<br>
-<br>
-      state.pipeline = cogl_pipeline_new (test_ctx);<br>
-      snippet = cogl_snippet_new (COGL_SNIPPET_HOOK_VERTEX,<br>
-                                  "attribute vec4 color;",<br>
-                                  "cogl_color_out = color;");<br>
-      cogl_pipeline_add_snippet (state.pipeline, snippet);<br>
-<br>
-      paint (&state);<br>
-<br>
-      cogl_object_unref (state.pipeline);<br>
-      cogl_object_unref (snippet);<br>
-<br>
-      if (cogl_test_verbose ())<br>
-        g_print ("OK\n");<br>
-    }<br>
-  else if (cogl_test_verbose ())<br>
-    g_print ("Skipping\n");<br>
+  CoglSnippet *snippet;<br>
+  TestState state;<br>
+<br>
+  cogl_framebuffer_orthographic (test_fb,<br>
+                                 0, 0,<br>
+                                 cogl_framebuffer_get_width (test_fb),<br>
+                                 cogl_framebuffer_get_height (test_fb),<br>
+                                 -1,<br>
+                                 100);<br>
+<br>
+  state.pipeline = cogl_pipeline_new (test_ctx);<br>
+  snippet = cogl_snippet_new (COGL_SNIPPET_HOOK_VERTEX,<br>
+                              "attribute vec4 color;",<br>
+                              "cogl_color_out = color;");<br>
+  cogl_pipeline_add_snippet (state.pipeline, snippet);<br>
+<br>
+  paint (&state);<br>
+<br>
+  cogl_object_unref (state.pipeline);<br>
+  cogl_object_unref (snippet);<br>
+<br>
+  if (cogl_test_verbose ())<br>
+    g_print ("OK\n");<br>
 }<br>
diff --git a/tests/conform/test-just-vertex-shader.c b/tests/conform/test-just-vertex-shader.c<br>
index a87b4cf..26f5072 100644<br>
--- a/tests/conform/test-just-vertex-shader.c<br>
+++ b/tests/conform/test-just-vertex-shader.c<br>
@@ -95,16 +95,9 @@ test_just_vertex_shader (void)<br>
                                  -1,<br>
                                  100);<br>
<br>
-  /* If GLSL isn't supported then we can't run the test */<br>
-  if (cogl_has_feature (test_ctx, COGL_FEATURE_ID_GLSL))<br>
-    {<br>
-      paint (&state);<br>
-      validate_result (test_fb);<br>
+  paint (&state);<br>
+  validate_result (test_fb);<br>
<br>
-      if (cogl_test_verbose ())<br>
-        g_print ("OK\n");<br>
-    }<br>
-  else if (cogl_test_verbose ())<br>
-    g_print ("Skipping\n");<br>
+  if (cogl_test_verbose ())<br>
+    g_print ("OK\n");<br>
 }<br>
-<br>
diff --git a/tests/conform/test-pipeline-uniforms.c b/tests/conform/test-pipeline-uniforms.c<br>
index d174550..3b41af0 100644<br>
--- a/tests/conform/test-pipeline-uniforms.c<br>
+++ b/tests/conform/test-pipeline-uniforms.c<br>
@@ -374,39 +374,33 @@ validate_long_pipeline_result (void)<br>
 void<br>
 test_pipeline_uniforms (void)<br>
 {<br>
-  /* If shaders aren't supported then we can't run the test */<br>
-  if (cogl_has_feature (test_ctx, COGL_FEATURE_ID_GLSL))<br>
-    {<br>
-      TestState state;<br>
+  TestState state;<br>
<br>
-      init_state (&state);<br>
+  init_state (&state);<br>
<br>
-      cogl_framebuffer_orthographic (test_fb,<br>
-                                     0, 0,<br>
-                                     cogl_framebuffer_get_width (test_fb),<br>
-                                     cogl_framebuffer_get_height (test_fb),<br>
-                                     -1,<br>
-                                     100);<br>
+  cogl_framebuffer_orthographic (test_fb,<br>
+                                 0, 0,<br>
+                                 cogl_framebuffer_get_width (test_fb),<br>
+                                 cogl_framebuffer_get_height (test_fb),<br>
+                                 -1,<br>
+                                 100);<br>
<br>
-      paint (&state);<br>
-      validate_result ();<br>
+  paint (&state);<br>
+  validate_result ();<br>
<br>
-      /* Try the test again after querying the location of a large<br>
-         number of uniforms. This should verify that the bitmasks<br>
-         still work even if they have to allocate a separate array to<br>
-         store the bits */<br>
+  /* Try the test again after querying the location of a large<br>
+     number of uniforms. This should verify that the bitmasks<br>
+     still work even if they have to allocate a separate array to<br>
+     store the bits */<br>
<br>
-      init_long_pipeline_state (&state);<br>
-      paint (&state);<br>
-      paint_long_pipeline (&state);<br>
-      validate_result ();<br>
-      validate_long_pipeline_result ();<br>
+  init_long_pipeline_state (&state);<br>
+  paint (&state);<br>
+  paint_long_pipeline (&state);<br>
+  validate_result ();<br>
+  validate_long_pipeline_result ();<br>
<br>
-      destroy_state (&state);<br>
+  destroy_state (&state);<br>
<br>
-      if (cogl_test_verbose ())<br>
-        g_print ("OK\n");<br>
-    }<br>
-  else if (cogl_test_verbose ())<br>
-    g_print ("Skipping\n");<br>
+  if (cogl_test_verbose ())<br>
+    g_print ("OK\n");<br>
 }<br>
diff --git a/tests/conform/test-snippets.c b/tests/conform/test-snippets.c<br>
index c14ed58..51bd090 100644<br>
--- a/tests/conform/test-snippets.c<br>
+++ b/tests/conform/test-snippets.c<br>
@@ -691,23 +691,17 @@ run_tests (TestState *state)<br>
 void<br>
 test_snippets (void)<br>
 {<br>
-  /* If shaders aren't supported then we can't run the test */<br>
-  if (cogl_has_feature (test_ctx, COGL_FEATURE_ID_GLSL))<br>
-    {<br>
-      TestState state;<br>
+  TestState state;<br>
<br>
-      cogl_framebuffer_orthographic (test_fb,<br>
-                                     0, 0,<br>
-                                     cogl_framebuffer_get_width (test_fb),<br>
-                                     cogl_framebuffer_get_height (test_fb),<br>
-                                     -1,<br>
-                                     100);<br>
+  cogl_framebuffer_orthographic (test_fb,<br>
+                                 0, 0,<br>
+                                 cogl_framebuffer_get_width (test_fb),<br>
+                                 cogl_framebuffer_get_height (test_fb),<br>
+                                 -1,<br>
+                                 100);<br>
<br>
-      run_tests (&state);<br>
+  run_tests (&state);<br>
<br>
-      if (cogl_test_verbose ())<br>
-        g_print ("OK\n");<br>
-    }<br>
-  else if (cogl_test_verbose ())<br>
-    g_print ("Skipping\n");<br>
+  if (cogl_test_verbose ())<br>
+    g_print ("OK\n");<br>
 }<br>
diff --git a/tests/conform/test-texture-3d.c b/tests/conform/test-texture-3d.c<br>
index 3ca1aa5..3891c31 100644<br>
--- a/tests/conform/test-texture-3d.c<br>
+++ b/tests/conform/test-texture-3d.c<br>
@@ -256,30 +256,22 @@ test_multi_texture (TestState *state)<br>
 void<br>
 test_texture_3d (void)<br>
 {<br>
-  /* Check whether GL supports the rectangle extension. If not we'll<br>
-     just assume the test passes */<br>
-  if (cogl_has_feature (test_ctx, COGL_FEATURE_ID_TEXTURE_3D))<br>
-    {<br>
-      TestState state;<br>
+  TestState state;<br>
<br>
-      state.fb_width = cogl_framebuffer_get_width (test_fb);<br>
-      state.fb_height = cogl_framebuffer_get_height (test_fb);<br>
+  state.fb_width = cogl_framebuffer_get_width (test_fb);<br>
+  state.fb_height = cogl_framebuffer_get_height (test_fb);<br>
<br>
-      cogl_framebuffer_orthographic (test_fb,<br>
-                                     0, 0, /* x_1, y_1 */<br>
-                                     state.fb_width, /* x_2 */<br>
-                                     state.fb_height /* y_2 */,<br>
-                                     -1, 100 /* near/far */);<br>
+  cogl_framebuffer_orthographic (test_fb,<br>
+                                 0, 0, /* x_1, y_1 */<br>
+                                 state.fb_width, /* x_2 */<br>
+                                 state.fb_height /* y_2 */,<br>
+                                 -1, 100 /* near/far */);<br>
<br>
-      draw_frame (&state);<br>
-      validate_result ();<br>
+  draw_frame (&state);<br>
+  validate_result ();<br>
<br>
-      test_multi_texture (&state);<br>
+  test_multi_texture (&state);<br>
<br>
-      if (cogl_test_verbose ())<br>
-        g_print ("OK\n");<br>
-    }<br>
-  else if (cogl_test_verbose ())<br>
-    g_print ("Skipping\n");<br>
+  if (cogl_test_verbose ())<br>
+    g_print ("OK\n");<br>
 }<br>
-<br>
diff --git a/tests/conform/test-utils.c b/tests/conform/test-utils.c<br>
index c11b678..4ee0856 100644<br>
--- a/tests/conform/test-utils.c<br>
+++ b/tests/conform/test-utils.c<br>
@@ -88,6 +88,12 @@ test_utils_init (TestFlags flags)<br>
       missing_requirement = TRUE;<br>
     }<br>
<br>
+  if (flags & TEST_REQUIREMENT_GLSL &&<br>
+      !cogl_has_feature (test_ctx, COGL_FEATURE_ID_GLSL))<br>
+    {<br>
+      missing_requirement = TRUE;<br>
+    }<br>
+<br>
   if (flags & TEST_KNOWN_FAILURE)<br>
     {<br>
       missing_requirement = TRUE;<br>
diff --git a/tests/conform/test-utils.h b/tests/conform/test-utils.h<br>
index 6ab278f..acd4fad 100644<br>
--- a/tests/conform/test-utils.h<br>
+++ b/tests/conform/test-utils.h<br>
@@ -15,7 +15,8 @@ typedef enum _TestFlags<br>
   TEST_REQUIREMENT_TEXTURE_3D    = 1<<3,<br>
   TEST_REQUIREMENT_POINT_SPRITE  = 1<<4,<br>
   TEST_REQUIREMENT_GLES2_CONTEXT = 1<<5,<br>
-  TEST_REQUIREMENT_MAP_WRITE     = 1<<6<br>
+  TEST_REQUIREMENT_MAP_WRITE     = 1<<6,<br>
+  TEST_REQUIREMENT_GLSL          = 1<<7<br>
 } TestFlags;<br>
<br>
 extern CoglContext *test_ctx;<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.11.3.g3c3efa5<br>
<br>
_______________________________________________<br>
Cogl mailing list<br>
<a href="mailto:Cogl@lists.freedesktop.org">Cogl@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/cogl" target="_blank">http://lists.freedesktop.org/mailman/listinfo/cogl</a><br>
</font></span></blockquote></div><br>