diff options
author | Chad Versace <chad.versace@linux.intel.com> | 2012-09-28 06:13:10 -0700 |
---|---|---|
committer | Chad Versace <chad.versace@linux.intel.com> | 2012-10-09 19:08:31 -0700 |
commit | 973db3e1743682c6ac8f58301c5e8f97588f6520 (patch) | |
tree | 1cda2236128063df45f52809b4219e41a1e2d7ae /tests/spec/arb_copy_buffer | |
parent | 8ed4af46b76cb7fe74ed6d228302141f66d49dc4 (diff) |
util: Convert GL tests to use PIGLIT_GL_CONFIG_BEGIN/END
This patch has two components.
1. In tests/util/piglit-framework-gl.h, replace the definition of
PIGLIT_GL_TEST_MAIN with the macro block PIGLIT_GL_CONFIG_BEGIN/END.
The macro PIGLIT_GL_TEST_MAIN was very restrictive. It was a fixed-arity
macro function that allowed a test to set only set 3 values: window width,
height, and visual. It would have been difficult to shoehorn optional test
attributes into such a fixed-arity macro function. Allowing optional
attributes is an essential feature because a following commit adds
optional fields to struct piglit_gl_test_config.
The macro block PIGLIT_GL_TEST_CONFIG_BEGIN/END is more flexible. Within
it the test is allowed to arbitrarilty modify the piglit_gl_test_config
structure.
2. In each GL test source, replace PIGLIT_GL_TEST_MAIN with
a PIGLIT_GL_TEST_CONFIG_BEGIN/END block.
Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Diffstat (limited to 'tests/spec/arb_copy_buffer')
-rw-r--r-- | tests/spec/arb_copy_buffer/copy_buffer_coherency.c | 11 | ||||
-rw-r--r-- | tests/spec/arb_copy_buffer/copybuffersubdata.c | 11 | ||||
-rw-r--r-- | tests/spec/arb_copy_buffer/dlist.c | 11 | ||||
-rw-r--r-- | tests/spec/arb_copy_buffer/get.c | 11 | ||||
-rw-r--r-- | tests/spec/arb_copy_buffer/negative-bound-zero.c | 11 | ||||
-rw-r--r-- | tests/spec/arb_copy_buffer/negative-bounds.c | 11 | ||||
-rw-r--r-- | tests/spec/arb_copy_buffer/negative-mapped.c | 11 | ||||
-rw-r--r-- | tests/spec/arb_copy_buffer/overlap.c | 11 | ||||
-rw-r--r-- | tests/spec/arb_copy_buffer/targets.c | 11 |
9 files changed, 63 insertions, 36 deletions
diff --git a/tests/spec/arb_copy_buffer/copy_buffer_coherency.c b/tests/spec/arb_copy_buffer/copy_buffer_coherency.c index e219e29ec..75b943d1e 100644 --- a/tests/spec/arb_copy_buffer/copy_buffer_coherency.c +++ b/tests/spec/arb_copy_buffer/copy_buffer_coherency.c @@ -31,10 +31,13 @@ uint8_t src_data[COPY_BUFFER_SIZE]; uint8_t dest_data[COPY_BUFFER_SIZE]; -PIGLIT_GL_TEST_MAIN( - 400 /*window_width*/, - 300 /*window_height*/, - PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE) +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.window_width = 400; + config.window_height = 300; + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END enum piglit_result piglit_display(void) diff --git a/tests/spec/arb_copy_buffer/copybuffersubdata.c b/tests/spec/arb_copy_buffer/copybuffersubdata.c index e4e17dc70..b429a5aa8 100644 --- a/tests/spec/arb_copy_buffer/copybuffersubdata.c +++ b/tests/spec/arb_copy_buffer/copybuffersubdata.c @@ -30,10 +30,13 @@ #include "piglit-util-gl-common.h" -PIGLIT_GL_TEST_MAIN( - 100 /*window_width*/, - 100 /*window_height*/, - PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE) +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.window_width = 100; + config.window_height = 100; + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END static bool test_copy(void) diff --git a/tests/spec/arb_copy_buffer/dlist.c b/tests/spec/arb_copy_buffer/dlist.c index 3f6b5a557..f6ba09cde 100644 --- a/tests/spec/arb_copy_buffer/dlist.c +++ b/tests/spec/arb_copy_buffer/dlist.c @@ -33,10 +33,13 @@ #include "piglit-util-gl-common.h" -PIGLIT_GL_TEST_MAIN( - 100 /*window_width*/, - 100 /*window_height*/, - PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE) +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.window_width = 100; + config.window_height = 100; + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END enum piglit_result piglit_display(void) diff --git a/tests/spec/arb_copy_buffer/get.c b/tests/spec/arb_copy_buffer/get.c index 938aa3338..fdb9fa97e 100644 --- a/tests/spec/arb_copy_buffer/get.c +++ b/tests/spec/arb_copy_buffer/get.c @@ -28,10 +28,13 @@ #include "piglit-util-gl-common.h" -PIGLIT_GL_TEST_MAIN( - 100 /*window_width*/, - 100 /*window_height*/, - PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE) +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.window_width = 100; + config.window_height = 100; + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END enum piglit_result piglit_display(void) diff --git a/tests/spec/arb_copy_buffer/negative-bound-zero.c b/tests/spec/arb_copy_buffer/negative-bound-zero.c index a8b82b184..f8db59ffe 100644 --- a/tests/spec/arb_copy_buffer/negative-bound-zero.c +++ b/tests/spec/arb_copy_buffer/negative-bound-zero.c @@ -31,10 +31,13 @@ #include "piglit-util-gl-common.h" -PIGLIT_GL_TEST_MAIN( - 100 /*window_width*/, - 100 /*window_height*/, - PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE) +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.window_width = 100; + config.window_height = 100; + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END enum piglit_result piglit_display(void) diff --git a/tests/spec/arb_copy_buffer/negative-bounds.c b/tests/spec/arb_copy_buffer/negative-bounds.c index 3f2c4f378..eeaa70d68 100644 --- a/tests/spec/arb_copy_buffer/negative-bounds.c +++ b/tests/spec/arb_copy_buffer/negative-bounds.c @@ -37,10 +37,13 @@ #include "piglit-util-gl-common.h" -PIGLIT_GL_TEST_MAIN( - 100 /*window_width*/, - 100 /*window_height*/, - PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE) +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.window_width = 100; + config.window_height = 100; + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END enum piglit_result piglit_display(void) diff --git a/tests/spec/arb_copy_buffer/negative-mapped.c b/tests/spec/arb_copy_buffer/negative-mapped.c index acfdf3c45..fcc952ee6 100644 --- a/tests/spec/arb_copy_buffer/negative-mapped.c +++ b/tests/spec/arb_copy_buffer/negative-mapped.c @@ -31,10 +31,13 @@ #include "piglit-util-gl-common.h" -PIGLIT_GL_TEST_MAIN( - 100 /*window_width*/, - 100 /*window_height*/, - PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE) +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.window_width = 100; + config.window_height = 100; + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END enum piglit_result piglit_display(void) diff --git a/tests/spec/arb_copy_buffer/overlap.c b/tests/spec/arb_copy_buffer/overlap.c index 7ddf70b72..703a71f98 100644 --- a/tests/spec/arb_copy_buffer/overlap.c +++ b/tests/spec/arb_copy_buffer/overlap.c @@ -36,10 +36,13 @@ #include "piglit-util-gl-common.h" -PIGLIT_GL_TEST_MAIN( - 100 /*window_width*/, - 100 /*window_height*/, - PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE) +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.window_width = 100; + config.window_height = 100; + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END static void test_copy(GLenum usage, int data_size, int src, int dst, int size) diff --git a/tests/spec/arb_copy_buffer/targets.c b/tests/spec/arb_copy_buffer/targets.c index 30cba2cfc..e2fce3c50 100644 --- a/tests/spec/arb_copy_buffer/targets.c +++ b/tests/spec/arb_copy_buffer/targets.c @@ -47,10 +47,13 @@ #include "piglit-util-gl-common.h" -PIGLIT_GL_TEST_MAIN( - 100 /*window_width*/, - 100 /*window_height*/, - PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE) +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.window_width = 100; + config.window_height = 100; + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END enum piglit_result piglit_display(void) |