diff options
author | Chris Forbes <chrisf@ijw.co.nz> | 2012-09-07 14:20:52 +1200 |
---|---|---|
committer | Chris Forbes <chrisf@ijw.co.nz> | 2012-09-10 20:10:29 +1200 |
commit | 2b53dc1945dbe58b352d30aa2a6c5ccc53babd7e (patch) | |
tree | 3563768333d5f3879f379fd55abdc29e8c2cb6e0 /tests/spec | |
parent | 193993238bfb44740618afd7deb9865f361ce992 (diff) |
Convert simple if(piglit_get_gl_version() < N) { SKIP } to require
Generated from the following semantic patch:
@@
expression VER;
expression MSG;
@@
- if (piglit_get_gl_version() < VER) {
- printf(MSG);
- piglit_report_result(PIGLIT_SKIP);
(
- exit(1);
|
)
- }
+ piglit_require_gl_version(VER);
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Diffstat (limited to 'tests/spec')
28 files changed, 28 insertions, 112 deletions
diff --git a/tests/spec/arb_copy_buffer/copy_buffer_coherency.c b/tests/spec/arb_copy_buffer/copy_buffer_coherency.c index f3dd62d44..76564f8be 100644 --- a/tests/spec/arb_copy_buffer/copy_buffer_coherency.c +++ b/tests/spec/arb_copy_buffer/copy_buffer_coherency.c @@ -71,10 +71,7 @@ do_copy() void piglit_init(int argc, char *argv[]) { - if (piglit_get_gl_version() < 15) { - printf("Requires OpenGL 1.5\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(15); piglit_require_extension("GL_ARB_vertex_buffer_object"); piglit_require_extension("GL_ARB_copy_buffer"); diff --git a/tests/spec/arb_es2_compatibility/arb_es2_compatibility-fixed-type.c b/tests/spec/arb_es2_compatibility/arb_es2_compatibility-fixed-type.c index e281108d2..bb6960550 100644 --- a/tests/spec/arb_es2_compatibility/arb_es2_compatibility-fixed-type.c +++ b/tests/spec/arb_es2_compatibility/arb_es2_compatibility-fixed-type.c @@ -83,10 +83,7 @@ piglit_init(int argc, char **argv) GLuint vs, prog; int i,j; - if (piglit_get_gl_version() < 20) { - printf("Requires OpenGL 2.0\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(20); piglit_require_extension("GL_ARB_ES2_compatibility"); piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE); diff --git a/tests/spec/arb_es2_compatibility/arb_es2_compatibility-getshaderprecisionformat.c b/tests/spec/arb_es2_compatibility/arb_es2_compatibility-getshaderprecisionformat.c index 5767867f2..5d8f95dbc 100644 --- a/tests/spec/arb_es2_compatibility/arb_es2_compatibility-getshaderprecisionformat.c +++ b/tests/spec/arb_es2_compatibility/arb_es2_compatibility-getshaderprecisionformat.c @@ -71,10 +71,7 @@ piglit_init(int argc, char **argv) { GL_HIGH_INT, { 16, 16 }, 0 } }; - if (piglit_get_gl_version() < 20) { - printf("Requires OpenGL 2.0\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(20); if (!piglit_is_extension_supported("GL_ARB_ES2_compatibility")) { printf("Requires ARB_ES2_compatibility\n"); diff --git a/tests/spec/arb_es2_compatibility/arb_es2_compatibility-maxvectors.c b/tests/spec/arb_es2_compatibility/arb_es2_compatibility-maxvectors.c index 7c3204685..139c91540 100644 --- a/tests/spec/arb_es2_compatibility/arb_es2_compatibility-maxvectors.c +++ b/tests/spec/arb_es2_compatibility/arb_es2_compatibility-maxvectors.c @@ -46,10 +46,7 @@ piglit_init(int argc, char **argv) GLboolean pass = GL_TRUE; GLint floats, vecs; - if (piglit_get_gl_version() < 20) { - printf("Requires OpenGL 2.0\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(20); if (!piglit_is_extension_supported("GL_ARB_ES2_compatibility")) { printf("Requires ARB_ES2_compatibility\n"); diff --git a/tests/spec/arb_es2_compatibility/arb_es2_compatibility-releaseshadercompiler.c b/tests/spec/arb_es2_compatibility/arb_es2_compatibility-releaseshadercompiler.c index 69fb69173..e8c5bd024 100644 --- a/tests/spec/arb_es2_compatibility/arb_es2_compatibility-releaseshadercompiler.c +++ b/tests/spec/arb_es2_compatibility/arb_es2_compatibility-releaseshadercompiler.c @@ -123,10 +123,7 @@ piglit_init(int argc, char **argv) +0.0, -1.0, 0.0, 1.0, }; - if (piglit_get_gl_version() < 20) { - printf("Requires OpenGL 2.0\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(20); if (!piglit_is_extension_supported("GL_ARB_ES2_compatibility")) { printf("Requires ARB_ES2_compatibility\n"); diff --git a/tests/spec/arb_es2_compatibility/arb_es2_compatibility-shadercompiler.c b/tests/spec/arb_es2_compatibility/arb_es2_compatibility-shadercompiler.c index b9fb9898e..f0e1dc277 100644 --- a/tests/spec/arb_es2_compatibility/arb_es2_compatibility-shadercompiler.c +++ b/tests/spec/arb_es2_compatibility/arb_es2_compatibility-shadercompiler.c @@ -46,10 +46,7 @@ piglit_init(int argc, char **argv) #ifdef GL_ARB_ES2_compatibility GLint shadercompiler; - if (piglit_get_gl_version() < 20) { - printf("Requires OpenGL 2.0\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(20); if (!piglit_is_extension_supported("GL_ARB_ES2_compatibility")) { printf("Requires ARB_ES2_compatibility\n"); diff --git a/tests/spec/arb_map_buffer_range/map_buffer_range_error_check.c b/tests/spec/arb_map_buffer_range/map_buffer_range_error_check.c index 1e6f69b2c..f09c4a4ab 100644 --- a/tests/spec/arb_map_buffer_range/map_buffer_range_error_check.c +++ b/tests/spec/arb_map_buffer_range/map_buffer_range_error_check.c @@ -47,10 +47,7 @@ piglit_init(int argc, char *argv[]) GLbitfield access = GL_MAP_READ_BIT | GL_MAP_WRITE_BIT; GLuint buffer; - if (piglit_get_gl_version() < 15) { - printf("Requires OpenGL 1.5\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(15); piglit_require_extension("GL_ARB_map_buffer_range"); diff --git a/tests/spec/arb_map_buffer_range/map_buffer_range_test.c b/tests/spec/arb_map_buffer_range/map_buffer_range_test.c index b8a89b0e2..d23f556e7 100644 --- a/tests/spec/arb_map_buffer_range/map_buffer_range_test.c +++ b/tests/spec/arb_map_buffer_range/map_buffer_range_test.c @@ -64,10 +64,7 @@ piglit_init(int argc, char *argv[]) int i; bool ret; - if (piglit_get_gl_version() < 15) { - printf("Requires OpenGL 1.5\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(15); piglit_require_extension("GL_ARB_map_buffer_range"); diff --git a/tests/spec/arb_robustness/draw-vbo-bounds.c b/tests/spec/arb_robustness/draw-vbo-bounds.c index 8256f4e41..cd5e22f17 100644 --- a/tests/spec/arb_robustness/draw-vbo-bounds.c +++ b/tests/spec/arb_robustness/draw-vbo-bounds.c @@ -56,10 +56,7 @@ void piglit_init(int argc, char **argv) { piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE); - if (piglit_get_gl_version() < 15) { - printf("Requires OpenGL 1.5\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(15); glShadeModel(GL_FLAT); glClearColor(0.2, 0.2, 0.2, 1.0); diff --git a/tests/spec/arb_timer_query/timestamp-get.c b/tests/spec/arb_timer_query/timestamp-get.c index 39f1679ed..398f64a21 100644 --- a/tests/spec/arb_timer_query/timestamp-get.c +++ b/tests/spec/arb_timer_query/timestamp-get.c @@ -134,10 +134,7 @@ piglit_init(int argc, char **argv) { piglit_automatic = true; - if (piglit_get_gl_version() < 20) { - printf("Requires OpenGL 2.0\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(20); piglit_require_extension("GL_ARB_timer_query"); } diff --git a/tests/spec/arb_vertex_type_2_10_10_10_rev/draw-vertices-2101010.c b/tests/spec/arb_vertex_type_2_10_10_10_rev/draw-vertices-2101010.c index 6c4f11610..032369908 100644 --- a/tests/spec/arb_vertex_type_2_10_10_10_rev/draw-vertices-2101010.c +++ b/tests/spec/arb_vertex_type_2_10_10_10_rev/draw-vertices-2101010.c @@ -53,10 +53,7 @@ void piglit_init(int argc, char **argv) { piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE); - if (piglit_get_gl_version() < 15) { - printf("Requires OpenGL 1.5\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(15); piglit_require_extension("GL_ARB_vertex_type_2_10_10_10_rev"); glShadeModel(GL_FLAT); diff --git a/tests/spec/ext_timer_query/time-elapsed.c b/tests/spec/ext_timer_query/time-elapsed.c index ce27ce0fa..c473fe5c3 100644 --- a/tests/spec/ext_timer_query/time-elapsed.c +++ b/tests/spec/ext_timer_query/time-elapsed.c @@ -265,10 +265,7 @@ retry: void piglit_init(int argc, char **argv) { - if (piglit_get_gl_version() < 20) { - printf("Requires OpenGL 2.0\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(20); piglit_require_extension("GL_EXT_timer_query"); diff --git a/tests/spec/gl-2.0/vertex-program-two-side.c b/tests/spec/gl-2.0/vertex-program-two-side.c index 5014751e3..82b96a0a0 100644 --- a/tests/spec/gl-2.0/vertex-program-two-side.c +++ b/tests/spec/gl-2.0/vertex-program-two-side.c @@ -152,10 +152,7 @@ piglit_init(int argc, char **argv) piglit_require_GLSL(); - if (piglit_get_gl_version() < 20) { - printf("Requires OpenGL 2.0\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(20); printf("Window quadrants show:\n"); printf("+-------------------------+------------------------+\n"); diff --git a/tests/spec/gl-3.0/required-renderbuffer-attachment-formats.c b/tests/spec/gl-3.0/required-renderbuffer-attachment-formats.c index 4c87a371c..d6896596d 100644 --- a/tests/spec/gl-3.0/required-renderbuffer-attachment-formats.c +++ b/tests/spec/gl-3.0/required-renderbuffer-attachment-formats.c @@ -51,10 +51,7 @@ piglit_init(int argc, char **argv) GLuint rb, fbo; int i; - if (piglit_get_gl_version() < 30) { - printf("Requires GL 3.0\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(30); glGenRenderbuffers(1, &rb); glBindRenderbuffer(GL_RENDERBUFFER, rb); diff --git a/tests/spec/gl-3.0/required-sized-texture-formats.c b/tests/spec/gl-3.0/required-sized-texture-formats.c index 21c7849a1..20bb2e2e4 100644 --- a/tests/spec/gl-3.0/required-sized-texture-formats.c +++ b/tests/spec/gl-3.0/required-sized-texture-formats.c @@ -78,10 +78,7 @@ piglit_init(int argc, char **argv) GLuint tex; int i, c; - if (piglit_get_gl_version() < 30) { - printf("Requires GL 3.0\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(30); glGenTextures(1, &tex); glBindTexture(GL_TEXTURE_2D, tex); diff --git a/tests/spec/gl-3.0/required-texture-attachment-formats.c b/tests/spec/gl-3.0/required-texture-attachment-formats.c index 1850ab397..8a5fa76ac 100644 --- a/tests/spec/gl-3.0/required-texture-attachment-formats.c +++ b/tests/spec/gl-3.0/required-texture-attachment-formats.c @@ -51,10 +51,7 @@ piglit_init(int argc, char **argv) GLuint tex, fbo; int i, c; - if (piglit_get_gl_version() < 30) { - printf("Requires GL 3.0\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(30); glGenTextures(1, &tex); glBindTexture(GL_TEXTURE_2D, tex); diff --git a/tests/spec/nv_conditional_render/begin-while-active.c b/tests/spec/nv_conditional_render/begin-while-active.c index a1363230b..1bd4b7921 100644 --- a/tests/spec/nv_conditional_render/begin-while-active.c +++ b/tests/spec/nv_conditional_render/begin-while-active.c @@ -56,10 +56,7 @@ piglit_init(int argc, char **argv) { GLuint q; - if (piglit_get_gl_version() < 20) { - printf("Requires OpenGL 2.0\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(20); piglit_require_extension("GL_NV_conditional_render"); diff --git a/tests/spec/nv_conditional_render/begin-zero.c b/tests/spec/nv_conditional_render/begin-zero.c index 5a8177522..b7aab6fbd 100644 --- a/tests/spec/nv_conditional_render/begin-zero.c +++ b/tests/spec/nv_conditional_render/begin-zero.c @@ -54,10 +54,7 @@ piglit_display(void) void piglit_init(int argc, char **argv) { - if (piglit_get_gl_version() < 20) { - printf("Requires OpenGL 2.0\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(20); piglit_require_extension("GL_NV_conditional_render"); diff --git a/tests/spec/nv_conditional_render/bitmap.c b/tests/spec/nv_conditional_render/bitmap.c index 2e54d7b33..ceda6558c 100644 --- a/tests/spec/nv_conditional_render/bitmap.c +++ b/tests/spec/nv_conditional_render/bitmap.c @@ -99,10 +99,7 @@ piglit_display(void) void piglit_init(int argc, char **argv) { - if (piglit_get_gl_version() < 20) { - printf("Requires OpenGL 2.0\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(20); piglit_require_extension("GL_NV_conditional_render"); } diff --git a/tests/spec/nv_conditional_render/blitframebuffer.c b/tests/spec/nv_conditional_render/blitframebuffer.c index f45e4c163..5b9d487d5 100644 --- a/tests/spec/nv_conditional_render/blitframebuffer.c +++ b/tests/spec/nv_conditional_render/blitframebuffer.c @@ -131,10 +131,7 @@ piglit_display(void) void piglit_init(int argc, char **argv) { - if (piglit_get_gl_version() < 20) { - printf("Requires OpenGL 2.0\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(20); piglit_require_extension("GL_NV_conditional_render"); piglit_require_extension("GL_EXT_framebuffer_object"); diff --git a/tests/spec/nv_conditional_render/clear.c b/tests/spec/nv_conditional_render/clear.c index 1884ad0be..8bc26b96e 100644 --- a/tests/spec/nv_conditional_render/clear.c +++ b/tests/spec/nv_conditional_render/clear.c @@ -92,10 +92,7 @@ piglit_display(void) void piglit_init(int argc, char **argv) { - if (piglit_get_gl_version() < 20) { - printf("Requires OpenGL 2.0\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(20); piglit_require_extension("GL_NV_conditional_render"); } diff --git a/tests/spec/nv_conditional_render/copypixels.c b/tests/spec/nv_conditional_render/copypixels.c index 4ffd8aff8..f87e81790 100644 --- a/tests/spec/nv_conditional_render/copypixels.c +++ b/tests/spec/nv_conditional_render/copypixels.c @@ -95,10 +95,7 @@ piglit_display(void) void piglit_init(int argc, char **argv) { - if (piglit_get_gl_version() < 20) { - printf("Requires OpenGL 2.0\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(20); piglit_require_extension("GL_NV_conditional_render"); } diff --git a/tests/spec/nv_conditional_render/copyteximage.c b/tests/spec/nv_conditional_render/copyteximage.c index e8d1c7cf2..8fd7dfa06 100644 --- a/tests/spec/nv_conditional_render/copyteximage.c +++ b/tests/spec/nv_conditional_render/copyteximage.c @@ -116,10 +116,7 @@ piglit_display(void) void piglit_init(int argc, char **argv) { - if (piglit_get_gl_version() < 20) { - printf("Requires OpenGL 2.0\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(20); piglit_require_extension("GL_NV_conditional_render"); } diff --git a/tests/spec/nv_conditional_render/copytexsubimage.c b/tests/spec/nv_conditional_render/copytexsubimage.c index 675e4fff7..1a70b5c74 100644 --- a/tests/spec/nv_conditional_render/copytexsubimage.c +++ b/tests/spec/nv_conditional_render/copytexsubimage.c @@ -116,10 +116,7 @@ piglit_display(void) void piglit_init(int argc, char **argv) { - if (piglit_get_gl_version() < 20) { - printf("Requires OpenGL 2.0\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(20); piglit_require_extension("GL_NV_conditional_render"); } diff --git a/tests/spec/nv_conditional_render/dlist.c b/tests/spec/nv_conditional_render/dlist.c index e33ea1299..75286b5d3 100644 --- a/tests/spec/nv_conditional_render/dlist.c +++ b/tests/spec/nv_conditional_render/dlist.c @@ -87,10 +87,7 @@ piglit_display(void) void piglit_init(int argc, char **argv) { - if (piglit_get_gl_version() < 20) { - printf("Requires OpenGL 2.0\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(20); piglit_require_extension("GL_NV_conditional_render"); } diff --git a/tests/spec/nv_conditional_render/drawpixels.c b/tests/spec/nv_conditional_render/drawpixels.c index 371d8e806..d56b6c836 100644 --- a/tests/spec/nv_conditional_render/drawpixels.c +++ b/tests/spec/nv_conditional_render/drawpixels.c @@ -109,10 +109,7 @@ piglit_display(void) void piglit_init(int argc, char **argv) { - if (piglit_get_gl_version() < 20) { - printf("Requires OpenGL 2.0\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(20); piglit_require_extension("GL_NV_conditional_render"); } diff --git a/tests/spec/nv_conditional_render/generatemipmap.c b/tests/spec/nv_conditional_render/generatemipmap.c index 90ce8f6d8..abc8497ca 100644 --- a/tests/spec/nv_conditional_render/generatemipmap.c +++ b/tests/spec/nv_conditional_render/generatemipmap.c @@ -115,10 +115,7 @@ piglit_display(void) void piglit_init(int argc, char **argv) { - if (piglit_get_gl_version() < 20) { - printf("Requires OpenGL 2.0\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(20); piglit_require_extension("GL_NV_conditional_render"); piglit_require_extension("GL_EXT_framebuffer_object"); diff --git a/tests/spec/nv_conditional_render/vertex_array.c b/tests/spec/nv_conditional_render/vertex_array.c index 25b387f19..b5d97dba1 100644 --- a/tests/spec/nv_conditional_render/vertex_array.c +++ b/tests/spec/nv_conditional_render/vertex_array.c @@ -92,10 +92,7 @@ piglit_display(void) void piglit_init(int argc, char **argv) { - if (piglit_get_gl_version() < 20) { - printf("Requires OpenGL 2.0\n"); - piglit_report_result(PIGLIT_SKIP); - } + piglit_require_gl_version(20); piglit_require_extension("GL_NV_conditional_render"); } |