[Piglit] [PATCH 2/2] util/framework/glut: do more core/compat profile checking

Brian Paul brianp at vmware.com
Wed Jun 25 10:50:51 PDT 2014


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



More information about the Piglit mailing list