[Piglit] [PATCH 1/2] ARB_multisample/beginend: New test for spec requirement.
Eric Anholt
eric at anholt.net
Mon Feb 13 16:57:30 PST 2012
---
tests/all.tests | 4 ++
tests/spec/CMakeLists.txt | 1 +
tests/spec/arb_multisample/CMakeLists.gl.txt | 14 ++++++
tests/spec/arb_multisample/CMakeLists.txt | 1 +
tests/spec/arb_multisample/beginend.c | 63 ++++++++++++++++++++++++++
5 files changed, 83 insertions(+), 0 deletions(-)
create mode 100644 tests/spec/arb_multisample/CMakeLists.gl.txt
create mode 100644 tests/spec/arb_multisample/CMakeLists.txt
create mode 100644 tests/spec/arb_multisample/beginend.c
diff --git a/tests/all.tests b/tests/all.tests
index eac9667..16cd327 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -1570,6 +1570,10 @@ spec['ARB_map_buffer_range'] = arb_map_buffer_range
add_plain_test(arb_map_buffer_range, 'map_buffer_range_error_check')
add_plain_test(arb_map_buffer_range, 'map_buffer_range_test')
+arb_multisample = Group()
+spec['ARB_multisample'] = arb_multisample
+arb_multisample['beginend'] = concurrent_test('arb_multisample-beginend')
+
arb_seamless_cube_map = Group()
spec['ARB_seamless_cube_map'] = arb_seamless_cube_map
add_plain_test(arb_seamless_cube_map, 'arb_seamless_cubemap')
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index aee6433..451ff43 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -3,6 +3,7 @@ add_subdirectory (arb_es2_compatibility)
add_subdirectory (arb_framebuffer_object)
add_subdirectory (arb_instanced_arrays)
add_subdirectory (arb_map_buffer_range)
+add_subdirectory (arb_multisample)
add_subdirectory (arb_robustness)
add_subdirectory (arb_sampler_objects)
add_subdirectory (arb_seamless_cube_map)
diff --git a/tests/spec/arb_multisample/CMakeLists.gl.txt b/tests/spec/arb_multisample/CMakeLists.gl.txt
new file mode 100644
index 0000000..4020caf
--- /dev/null
+++ b/tests/spec/arb_multisample/CMakeLists.gl.txt
@@ -0,0 +1,14 @@
+include_directories(
+ ${OPENGL_INCLUDE_PATH}
+ ${GLUT_INCLUDE_DIR}
+ ${piglit_SOURCE_DIR}/tests/util
+)
+
+link_libraries (
+ piglitutil
+ ${OPENGL_gl_LIBRARY}
+ ${OPENGL_glu_LIBRARY}
+ ${GLUT_glut_LIBRARY}
+)
+
+add_executable (arb_multisample-beginend beginend.c)
diff --git a/tests/spec/arb_multisample/CMakeLists.txt b/tests/spec/arb_multisample/CMakeLists.txt
new file mode 100644
index 0000000..144a306
--- /dev/null
+++ b/tests/spec/arb_multisample/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/arb_multisample/beginend.c b/tests/spec/arb_multisample/beginend.c
new file mode 100644
index 0000000..221896a
--- /dev/null
+++ b/tests/spec/arb_multisample/beginend.c
@@ -0,0 +1,63 @@
+/*
+ * Copyright © 2011 Intel Corporation
+ *
+ * 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.
+ */
+
+#include "piglit-util.h"
+
+/**
+ * @file beginend.c
+ *
+ * From the EXT_framebuffer_multisample spec:
+ *
+ * "INVALID_OPERATION is generated if SampleCoverageARB is called
+ * between the execution of Begin and the execution of the
+ * corresponding End."
+ */
+
+int piglit_width = 32;
+int piglit_height = 32;
+int piglit_window_mode = GLUT_DOUBLE | GLUT_RGB | GLUT_ALPHA;
+
+enum piglit_result
+piglit_display(void)
+{
+ /* UNREACHED */
+ return PIGLIT_FAIL;
+}
+
+void
+piglit_init(int argc, char **argv)
+{
+ bool pass = true;
+
+ piglit_require_extension("GL_ARB_multisample");
+
+ glSampleCoverageARB(1.0, false);
+ pass = pass && piglit_check_gl_error(0);
+
+ glBegin(GL_TRIANGLES);
+ glSampleCoverageARB(0.5, false);
+ glEnd();
+ pass = pass && piglit_check_gl_error(GL_INVALID_OPERATION);
+
+ piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
+}
--
1.7.9
More information about the Piglit
mailing list