[Piglit] [PATCH 01/20] Move crash-cubemap-order test from bugs to spec dir.

Fabian Bieler fabianbieler at fastmail.fm
Sat Dec 16 19:21:01 UTC 2017


---
 tests/all.py                                      |  2 +-
 tests/bugs/CMakeLists.gl.txt                      |  1 -
 tests/bugs/crash-cubemap-order.c                  | 52 --------------
 tests/spec/CMakeLists.txt                         |  1 +
 tests/spec/arb_texture_cube_map/CMakeLists.gl.txt | 13 ++++
 tests/spec/arb_texture_cube_map/CMakeLists.txt    |  1 +
 tests/spec/arb_texture_cube_map/unusual-order.c   | 87 +++++++++++++++++++++++
 7 files changed, 103 insertions(+), 54 deletions(-)
 delete mode 100644 tests/bugs/crash-cubemap-order.c
 create mode 100644 tests/spec/arb_texture_cube_map/CMakeLists.gl.txt
 create mode 100644 tests/spec/arb_texture_cube_map/CMakeLists.txt
 create mode 100644 tests/spec/arb_texture_cube_map/unusual-order.c

diff --git a/tests/all.py b/tests/all.py
index 67e78c5..5940928 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -3142,7 +3142,7 @@ with profile.test_list.group_manager(
 with profile.test_list.group_manager(
         PiglitGLTest,
         grouptools.join('spec', 'arb_texture_cube_map')) as g:
-    g(['crash-cubemap-order'], run_concurrent=False)
+    g(['arb_texture_cube_map-unusual-order'], run_concurrent=False)
     g(['cubemap'], run_concurrent=False)
     g(['cubemap-getteximage-pbo'])
     g(['cubemap-mismatch'], run_concurrent=False)
diff --git a/tests/bugs/CMakeLists.gl.txt b/tests/bugs/CMakeLists.gl.txt
index 65a11f2..23e59e4 100644
--- a/tests/bugs/CMakeLists.gl.txt
+++ b/tests/bugs/CMakeLists.gl.txt
@@ -10,7 +10,6 @@ link_libraries (
 	${OPENGL_gl_LIBRARY}
 )
 
-piglit_add_executable (crash-cubemap-order crash-cubemap-order.c)
 piglit_add_executable (crash-texparameter-before-teximage crash-texparameter-before-teximage.c)
 piglit_add_executable (drawbuffer-modes drawbuffer-modes.c)
 piglit_add_executable (fdo10370 fdo10370.c)
diff --git a/tests/bugs/crash-cubemap-order.c b/tests/bugs/crash-cubemap-order.c
deleted file mode 100644
index 7b733be..0000000
--- a/tests/bugs/crash-cubemap-order.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * @file crash-cubemap-order.c
- *
- * Test case for "crash if cubemap faces are loaded in an unusual order".
- *
- * This bug existed in the R300 driver and was triggered by Sauerbraten.
- */
-
-#include "piglit-util-gl.h"
-
-PIGLIT_GL_TEST_CONFIG_BEGIN
-
-	config.supports_gl_compat_version = 10;
-
-	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGB;
-	config.khr_no_error_support = PIGLIT_NO_ERRORS;
-
-PIGLIT_GL_TEST_CONFIG_END
-
-enum piglit_result
-piglit_display(void)
-{
-	return PIGLIT_PASS;
-}
-
-void
-piglit_init(int argc, char **argv)
-{
-	GLubyte data[4096]; /* 32*32*4 */
-
-	piglit_require_extension("GL_ARB_texture_cube_map");
-
-	memset(data, 0, sizeof(data));
-	
-	glViewport(0, 0, piglit_width, piglit_height);
-
-	glBindTexture(GL_TEXTURE_CUBE_MAP, 1);
-	glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, GL_RGBA, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
-	glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, GL_RGBA, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
-	glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, GL_RGBA, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
-	glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0, GL_RGBA, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
-	glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0, GL_RGBA, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
-	glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_RGBA, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
-	
-	glBindTexture(GL_TEXTURE_CUBE_MAP, 2);
-	glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, GL_RGBA, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
-	glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, GL_RGBA, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
-	glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, GL_RGBA, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
-	glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0, GL_RGBA, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
-	glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0, GL_RGBA, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
-	glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_RGBA, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
-}
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index f044efd..92b8351 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -68,6 +68,7 @@ add_subdirectory (arb_tessellation_shader)
 add_subdirectory (arb_texture_buffer_object)
 add_subdirectory (arb_texture_buffer_range)
 add_subdirectory (arb_texture_compression)
+add_subdirectory (arb_texture_cube_map)
 add_subdirectory (arb_texture_cube_map_array)
 add_subdirectory (arb_texture_float)
 add_subdirectory (arb_texture_rectangle)
diff --git a/tests/spec/arb_texture_cube_map/CMakeLists.gl.txt b/tests/spec/arb_texture_cube_map/CMakeLists.gl.txt
new file mode 100644
index 0000000..ae43598
--- /dev/null
+++ b/tests/spec/arb_texture_cube_map/CMakeLists.gl.txt
@@ -0,0 +1,13 @@
+include_directories(
+	${GLEXT_INCLUDE_DIR}
+	${OPENGL_INCLUDE_PATH}
+)
+
+link_libraries (
+	piglitutil_${piglit_target_api}
+	${OPENGL_gl_LIBRARY}
+)
+
+piglit_add_executable (arb_texture_cube_map-unusual-order unusual-order.c)
+
+# vim: ft=cmake:
diff --git a/tests/spec/arb_texture_cube_map/CMakeLists.txt b/tests/spec/arb_texture_cube_map/CMakeLists.txt
new file mode 100644
index 0000000..144a306
--- /dev/null
+++ b/tests/spec/arb_texture_cube_map/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/arb_texture_cube_map/unusual-order.c b/tests/spec/arb_texture_cube_map/unusual-order.c
new file mode 100644
index 0000000..19ac93b
--- /dev/null
+++ b/tests/spec/arb_texture_cube_map/unusual-order.c
@@ -0,0 +1,87 @@
+/*
+ * Copyright © 2009 Nicolai Hähnle
+ *
+ * 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 cubemap-unusual-order.c
+ *
+ * Test case for "crash if cubemap faces are loaded in an unusual order".
+ *
+ * This bug existed in the R300 driver and was triggered by Sauerbraten.
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+	config.supports_gl_compat_version = 10;
+
+	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGB;
+	config.khr_no_error_support = PIGLIT_NO_ERRORS;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+enum piglit_result
+piglit_display(void)
+{
+	return PIGLIT_PASS;
+}
+
+void
+piglit_init(int argc, char **argv)
+{
+	GLubyte data[4096]; /* 32*32*4 */
+
+	piglit_require_extension("GL_ARB_texture_cube_map");
+
+	memset(data, 0, sizeof(data));
+
+	glViewport(0, 0, piglit_width, piglit_height);
+
+	glBindTexture(GL_TEXTURE_CUBE_MAP, 1);
+	glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, GL_RGBA, 32, 32, 0,
+		     GL_RGBA, GL_UNSIGNED_BYTE, data);
+	glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, GL_RGBA, 32, 32, 0,
+		     GL_RGBA, GL_UNSIGNED_BYTE, data);
+	glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, GL_RGBA, 32, 32, 0,
+		     GL_RGBA, GL_UNSIGNED_BYTE, data);
+	glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0, GL_RGBA, 32, 32, 0,
+		     GL_RGBA, GL_UNSIGNED_BYTE, data);
+	glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0, GL_RGBA, 32, 32, 0,
+		     GL_RGBA, GL_UNSIGNED_BYTE, data);
+	glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_RGBA, 32, 32, 0,
+		     GL_RGBA, GL_UNSIGNED_BYTE, data);
+
+	glBindTexture(GL_TEXTURE_CUBE_MAP, 2);
+	glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, GL_RGBA, 32, 32, 0,
+		     GL_RGBA, GL_UNSIGNED_BYTE, 0);
+	glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, GL_RGBA, 32, 32, 0,
+		     GL_RGBA, GL_UNSIGNED_BYTE, 0);
+	glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, GL_RGBA, 32, 32, 0,
+		     GL_RGBA, GL_UNSIGNED_BYTE, 0);
+	glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0, GL_RGBA, 32, 32, 0,
+		     GL_RGBA, GL_UNSIGNED_BYTE, 0);
+	glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0, GL_RGBA, 32, 32, 0,
+		     GL_RGBA, GL_UNSIGNED_BYTE, 0);
+	glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_RGBA, 32, 32, 0,
+		     GL_RGBA, GL_UNSIGNED_BYTE, 0);
+}
-- 
2.7.4



More information about the Piglit mailing list