util: Warn when we get a window resize during an auto run.

We've got a bunch of instances of this happening intermittently during
runs with gnome-shell.  Because our tests are not generally able to
handle resizes, they would show up as spurious failures that are hard
to reproduce.  Instead, provide a diagnostic message and report WARN.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
framework: When a test catches a spurious window resize, re-run it.

Otherwise, we'd see massive spam of WARN tests, due to the frequency
of the bug (about 2% of testcases on my system).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
oes_standard_derivatives: Add touch tests for the extension

Make sure that all the functions are available when they should be.
This is currently broken in Mesa.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52003
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
remove glsl-fs-sqrt-zero test

This was only testing compile-time evaluation of sqrt(0).
It's more interesting to do render-time testing, which is done
in other tests.

Reviewed-by: Eric Anholt <eric@anholt.net>
remove glsl-vs-sqrt-zero test

As with the previous commit, but VS.

Reviewed-by: Eric Anholt <eric@anholt.net>
util: check for valid file type in piglit_load_text_file()

Piglit would segfault if piglit_load_text_file() was accidentally passed
a directory name instead of a filename.  Now return NULL if the file is
not regular or a symlink.
util: fix MSVC build failure in piglit_ktx.c

Using void pointers for pointer arithmetic doesn't work.  Fixes:
tests\util\piglit_ktx.c(333) : error C2036: 'void *' : unknown size

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53013

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
GL_ARB_ubo/maxblocks: don't use dynamically sized array

To fix MSVC build.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=53062

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
GL_ARB_ubo/maxblocks: fix writing to zero-length string

When get_shader() was called with blocks=0 we were allocating string
buffers of length zero.  Assigning prefix[0] = 0 caused an invalid
memory write (found w/ valgrind).  Adding one to the calloc() length
fixes this.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
draw-buffers-common.cpp: don't use dynamically sized array

This patch is to fix MSVC build errors.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=53102

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Fix swapbuffers timing in arb_seamless_cubemap test.

Prior to this patch, the test would:
1. Draw into the back buffer.
2. glutSwapBuffers
3. Read/probe pixel values...from what used to be the front buffer?

This patch moves the SwapBuffers to after the probing, which should
ensure that draws and reads use the same buffer.  It also switches
from glutSwapBuffers to piglit_present_results().

This may help with bug #46212.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46212
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
shader_runner: Allow uniform setup through a uniform block.
GLSL 1.40: Add some simple UBO rendering tests.
GLSL 1.40: New tests for rendering using UBO aggregate assignment.
GLSL 1.40: Add a nasty test for UBO structure copying.

This is totally hand-written awfulness.
GLSL 1.40: Add tests for UBO structure padding bug in link_uniforms.cpp.
Shut up gcc about c++11 issues.

This isn't c++11 code.
Add tests for glEdgeFlag().
GL_ARB_ubo: Test for the #define being present.

I had missed this at one point in the patch series, so might as well
add tests.
GL_ARB_ubo: Add tests for disabling the extension.