Check if actually got a core profile.  Then, if the tests requires
a compat profile, skip the test.
---
 .../piglit-framework-gl/piglit_glut_framework.c    |   22 ++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/tests/util/piglit-framework-gl/piglit_glut_framework.c 
b/tests/util/piglit-framework-gl/piglit_glut_framework.c
index 7c872fb..75b8fa6 100644
--- a/tests/util/piglit-framework-gl/piglit_glut_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_glut_framework.c
@@ -226,6 +226,20 @@ check_gl_version(const struct piglit_gl_test_config 
*test_config)
                return false;
        }
 
+       if (piglit_is_core_profile &&
+           test_config->supports_gl_core_version == 0) {
+               /* We have a core profile context but the test needs a
+                * compat profile.  We can't run the test.
+                */
+               printf("Test requires compat version %d.%d or later but "
+                      "context is core profile %d.%d.\n",
+                      test_config->supports_gl_compat_version / 10,
+                      test_config->supports_gl_compat_version % 10,
+                      actual_version / 10,
+                      actual_version % 10);
+               return false;
+       }
+
        return true;
 }
 
@@ -253,6 +267,14 @@ piglit_glut_framework_create(const struct 
piglit_gl_test_config *test_config)
 
        init_glut();
 
+        /* Check if we actually have a core profile */
+       {
+               int actual_version = piglit_get_gl_version();
+               if (actual_version >= 31 &&
+                   !piglit_is_extension_supported("GL_ARB_compatibility"))
+                       piglit_is_core_profile = true;
+       }
+
        if (!check_gl_version(test_config))
                piglit_report_result(PIGLIT_SKIP);
 
-- 
1.7.10.4

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to