V9: replace array index magic numbers with enums
V8: make sure all each object is available in the OpenGL
implementation before doing get/set tests
fix copy and paste mistake with framebuffer/renderbuffer tests
V7: be defensive when testing max label, use fprintf for errors,
code tidy ups, and added get/set tests for each object type
V6: fix spelling of generated in multiple places
V5: Removed unneeded assignment that was also out of bounds
V4: Removed failure test that will never be true
V3: changed indentation to tabs, use test label constants
and remove unused variable
V2: fixed whitespaces, broke tests into subtests,
added missing build dir, and tidied up fail messages
Signed-off-by: Timothy Arceri t_arc...@yahoo.com.au
---
tests/all.tests |5 +
tests/spec/CMakeLists.txt |1 +
tests/spec/khr_debug/CMakeLists.gl.txt| 14 +
tests/spec/khr_debug/CMakeLists.txt |1 +
tests/spec/khr_debug/debug-object-label.c | 473 +
5 files changed, 494 insertions(+)
create mode 100644 tests/spec/khr_debug/CMakeLists.gl.txt
create mode 100644 tests/spec/khr_debug/CMakeLists.txt
create mode 100644 tests/spec/khr_debug/debug-object-label.c
diff --git a/tests/all.tests b/tests/all.tests
index de33501..91fa27b 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -1274,6 +1274,11 @@ arb_debug_output = Group()
spec['ARB_debug_output'] = arb_debug_output
add_plain_test(arb_debug_output, 'arb_debug_output-api_error')
+# Group KHR_debug
+khr_debug = Group()
+spec['KHR_debug'] = khr_debug
+add_plain_test(khr_debug, 'khr_debug-object-label')
+
# Group ARB_occlusion_query2
arb_occlusion_query2 = Group()
spec['ARB_occlusion_query2'] = arb_occlusion_query2
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index 3bd8e9c..3ea148b 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -1,6 +1,7 @@
add_subdirectory (amd_performance_monitor)
add_subdirectory (arb_color_buffer_float)
add_subdirectory (arb_debug_output)
+add_subdirectory (khr_debug)
add_subdirectory (arb_depth_clamp)
add_subdirectory (arb_draw_instanced)
add_subdirectory (arb_es2_compatibility)
diff --git a/tests/spec/khr_debug/CMakeLists.gl.txt
b/tests/spec/khr_debug/CMakeLists.gl.txt
new file mode 100644
index 000..b0079df
--- /dev/null
+++ b/tests/spec/khr_debug/CMakeLists.gl.txt
@@ -0,0 +1,14 @@
+include_directories(
+ ${GLEXT_INCLUDE_DIR}
+ ${OPENGL_INCLUDE_PATH}
+)
+
+link_libraries (
+ piglitutil_${piglit_target_api}
+ ${OPENGL_gl_LIBRARY}
+ ${OPENGL_glu_LIBRARY}
+)
+
+piglit_add_executable (khr_debug-object-label debug-object-label.c)
+
+# vim: ft=cmake:
diff --git a/tests/spec/khr_debug/CMakeLists.txt
b/tests/spec/khr_debug/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/khr_debug/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/khr_debug/debug-object-label.c
b/tests/spec/khr_debug/debug-object-label.c
new file mode 100644
index 000..6905619
--- /dev/null
+++ b/tests/spec/khr_debug/debug-object-label.c
@@ -0,0 +1,473 @@
+/*
+ * Copyright (c) 2013 Timothy Arceri t_arc...@yahoo.com.au
+ *
+ * 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
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, 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
+ * NON-INFRINGEMENT. IN NO EVENT SHALL AUTHORS AND/OR THEIR SUPPLIERS
+ * 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.
+ */
+
+#include piglit-util-gl-common.h
+
+static const char *TestLabel = Test Label;
+static const int TestLabelLen = 10;
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+ config.supports_gl_compat_version = 11;
+
+ config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+enum piglit_result
+piglit_display(void)
+{
+ return PIGLIT_PASS;
+}
+
+static bool
+test_object_ptr_label()
+{
+ GLsync sync;
+ GLsizei length;
+ GLchar label[TestLabelLen + 1];
+ bool pass = true;
+
+ puts(Test ObjectPtrLabel);
+
+ /* basic check to see