[Piglit] [PATCH 4/4] egl_khr_create_context: Build ES tests only when ES 1 and ES 2 are available.

Matt Turner mattst88 at gmail.com
Fri Jul 26 16:34:36 PDT 2013


This was, and still is, kind of broken. Previously we were building ES
tests without linking to libGLES* which lead to the tests being skipped.

Now we're requiring ES 1 and ES 2 for tests that can run with ES 1 or ES
2; or ES 1, ES 2, or Desktop GL. There is potential for build problems if
building with ES but without Desktop GL.

tests/egl/spec/egl_khr_create_context must have CMakeLists.gles2.txt
(as opposed to CMakeLists.gles1.txt) since piglit dispatch isn't
implemented for ES 1, and we need dispatch.

tests/egl contains CMakeLists.gles1.txt so that the tests are only built
when we have ES 1 *and* ES 2.
---
 tests/egl/CMakeLists.gles2.txt                     |  5 ++++
 .../spec/egl_khr_create_context/CMakeLists.gl.txt  | 11 +-------
 .../egl_khr_create_context/CMakeLists.gles2.txt    | 31 ++++++++++++++++++++++
 .../default-minor-version-gles.c                   |  4 +++
 4 files changed, 41 insertions(+), 10 deletions(-)
 create mode 100644 tests/egl/CMakeLists.gles2.txt
 create mode 100644 tests/egl/spec/egl_khr_create_context/CMakeLists.gles2.txt

diff --git a/tests/egl/CMakeLists.gles2.txt b/tests/egl/CMakeLists.gles2.txt
new file mode 100644
index 0000000..11c27c6
--- /dev/null
+++ b/tests/egl/CMakeLists.gles2.txt
@@ -0,0 +1,5 @@
+IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+	add_subdirectory(spec)
+ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+
+# vim: ft=cmake:
diff --git a/tests/egl/spec/egl_khr_create_context/CMakeLists.gl.txt b/tests/egl/spec/egl_khr_create_context/CMakeLists.gl.txt
index 4063e3b..b8ca492 100644
--- a/tests/egl/spec/egl_khr_create_context/CMakeLists.gl.txt
+++ b/tests/egl/spec/egl_khr_create_context/CMakeLists.gl.txt
@@ -7,27 +7,18 @@ include_directories(
 
 link_libraries (
 	${OPENGL_gl_LIBRARY}
-	${OPENGL_glu_LIBRARY}
-	${X11_X11_LIB}
+	${OPENGL_egl_LIBRARY}
 )
 
-piglit_add_executable (egl-create-context-default-major-version-gles default-major-version-gles.c common.c)
 piglit_add_executable (egl-create-context-default-major-version-gl default-major-version-gl.c common.c)
-piglit_add_executable (egl-create-context-default-minor-version-gles default-minor-version-gles.c common.c)
 piglit_add_executable (egl-create-context-default-minor-version-gl default-minor-version-gl.c common.c)
-piglit_add_executable (egl-create-context-valid-attribute-empty-gles valid-attribute-empty-gles.c common.c)
 piglit_add_executable (egl-create-context-valid-attribute-empty-gl valid-attribute-empty-gl.c common.c)
-piglit_add_executable (egl-create-context-valid-attribute-null-gles valid-attribute-null-gles.c common.c)
 piglit_add_executable (egl-create-context-valid-attribute-null-gl valid-attribute-null-gl.c common.c)
-piglit_add_executable (egl-create-context-invalid-gl-version invalid-gl-version.c common.c)
-piglit_add_executable (egl-create-context-invalid-attribute-gles invalid-attribute-gles.c common.c)
 piglit_add_executable (egl-create-context-invalid-attribute-gl invalid-attribute-gl.c common.c)
-piglit_add_executable (egl-create-context-invalid-flag-gles invalid-flag-gles.c common.c)
 piglit_add_executable (egl-create-context-invalid-flag-gl invalid-flag-gl.c common.c)
 piglit_add_executable (egl-create-context-invalid-profile invalid-profile.c common.c)
 piglit_add_executable (egl-create-context-pre-GL32-profile pre-GL32-profile.c common.c)
 piglit_add_executable (egl-create-context-valid-flag-forward-compatible-gl valid-flag-forward-compatible-gl.c common.c)
 piglit_add_executable (egl-create-context-core-profile core-profile.c common.c)
-piglit_add_executable (egl-create-context-verify-gl-flavor verify-gl-flavor.c common.c)
 
 # vim: ft=cmake:
diff --git a/tests/egl/spec/egl_khr_create_context/CMakeLists.gles2.txt b/tests/egl/spec/egl_khr_create_context/CMakeLists.gles2.txt
new file mode 100644
index 0000000..80e6380
--- /dev/null
+++ b/tests/egl/spec/egl_khr_create_context/CMakeLists.gles2.txt
@@ -0,0 +1,31 @@
+
+include_directories(
+	${GLEXT_INCLUDE_DIR}
+	${OPENGL_INCLUDE_PATH}
+	${GLPROTO_INCLUDE_DIRS}
+)
+
+link_libraries (
+	piglitutil_${piglit_target_api}
+	${OPENGL_gles1_LIBRARY}
+	${OPENGL_gles2_LIBRARY}
+	${OPENGL_gl_LIBRARY}
+	${OPENGL_egl_LIBRARY}
+)
+
+# Tests that use ES 1.
+piglit_add_executable (egl-create-context-default-major-version-gles default-major-version-gles.c common.c)
+piglit_add_executable (egl-create-context-valid-attribute-empty-gles valid-attribute-empty-gles.c common.c)
+piglit_add_executable (egl-create-context-valid-attribute-null-gles valid-attribute-null-gles.c common.c)
+
+# Tests that use ES 1 and ES 2.
+piglit_add_executable (egl-create-context-default-minor-version-gles default-minor-version-gles.c common.c)
+piglit_add_executable (egl-create-context-invalid-attribute-gles invalid-attribute-gles.c common.c)
+piglit_add_executable (egl-create-context-invalid-flag-gles invalid-flag-gles.c common.c)
+
+
+# Tests that use ES 1, ES 2, and Desktop GL.
+piglit_add_executable (egl-create-context-invalid-gl-version invalid-gl-version.c common.c)
+piglit_add_executable (egl-create-context-verify-gl-flavor verify-gl-flavor.c common.c)
+
+# vim: ft=cmake:
diff --git a/tests/egl/spec/egl_khr_create_context/default-minor-version-gles.c b/tests/egl/spec/egl_khr_create_context/default-minor-version-gles.c
index 6101ad7..521780f 100644
--- a/tests/egl/spec/egl_khr_create_context/default-minor-version-gles.c
+++ b/tests/egl/spec/egl_khr_create_context/default-minor-version-gles.c
@@ -31,6 +31,7 @@ int main(int argc, char **argv)
 	const char *version_string;
 	int major;
 	int minor;
+	GLenum ret;
 
 	if (!EGL_KHR_create_context_setup(EGL_OPENGL_ES_BIT)) {
 		attribs[1] = 2;
@@ -71,6 +72,9 @@ int main(int argc, char **argv)
 		piglit_dispatch_default_init(PIGLIT_DISPATCH_ES2);
 	}
 
+	ret = glFramebufferCheckStatus(0);
+	printf("%#x\n", ret);
+
 	version_string = (char *) glGetString(GL_VERSION);
 
 	if (!parse_version_string(version_string, &major, &minor)) {
-- 
1.8.1.5



More information about the Piglit mailing list