diff options
author | Jordan Justen <jordan.l.justen@intel.com> | 2013-02-15 16:36:13 -0800 |
---|---|---|
committer | Jordan Justen <jordan.l.justen@intel.com> | 2013-02-22 22:27:10 -0800 |
commit | 698361c740566173c1c69a3279e835671ea352fd (patch) | |
tree | e53ad2c345a74036bccb9f39382d9ec71f0aa9e5 | |
parent | 2bac8d3e5ee7debe73170fb22fdd140274bc75c5 (diff) |
shader_runner: add support for a link-error command for negative tests
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
-rw-r--r-- | tests/shaders/shader_runner.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c index c2f45dce..5b084cb2 100644 --- a/tests/shaders/shader_runner.c +++ b/tests/shaders/shader_runner.c @@ -1641,12 +1641,11 @@ piglit_display(void) const char *line; bool pass = true; GLbitfield clear_bits = 0; + bool link_error_expected = false; if (test_start == NULL) return PIGLIT_PASS; - program_must_be_in_use(); - line = test_start; while (line[0] != '\0') { float c[32]; @@ -1671,11 +1670,13 @@ piglit_display(void) } glClipPlane(GL_CLIP_PLANE0 + x, d); } else if (string_match("draw rect", line)) { + program_must_be_in_use(); get_floats(line + 9, c, 4); piglit_draw_rect(c[0], c[1], c[2], c[3]); } else if (string_match("draw instanced rect", line)) { int primcount; + program_must_be_in_use(); sscanf(line + 19, "%d %f %f %f %f", &primcount, c + 0, c + 1, c + 2, c + 3); @@ -1684,6 +1685,7 @@ piglit_display(void) GLenum mode = decode_drawing_mode(s); int first = x; size_t count = (size_t) y; + program_must_be_in_use(); if (first < 0) { printf("draw arrays 'first' must be >= 0\n"); piglit_report_result(PIGLIT_FAIL); @@ -1878,9 +1880,18 @@ piglit_display(void) } else if (string_match("texparameter ", line)) { handle_texparameter(line + strlen("texparameter ")); } else if (string_match("uniform", line)) { + program_must_be_in_use(); set_uniform(line + 7); } else if (string_match("parameter ", line)) { set_parameter(line + strlen("parameter ")); + } else if (string_match("link error", line)) { + link_error_expected = true; + if (link_ok) { + printf("shader link error expected, but it was sucessful!\n"); + piglit_report_result(PIGLIT_FAIL); + } + } else if (string_match("link success", line)) { + program_must_be_in_use(); } else if ((line[0] != '\n') && (line[0] != '\0') && (line[0] != '#')) { printf("unknown command \"%s\"", line); @@ -1892,6 +1903,10 @@ piglit_display(void) line++; } + if (!link_ok && !link_error_expected) { + program_must_be_in_use(); + } + piglit_present_results(); if (piglit_automatic) { |