gen_const_builtin_equal_tests.py: Use mako

This uses mako to render tests. It's faster than the previous method,
and is much easier to understand.

v2: - set write mode to 'w' instead of 'w+'. w+ is a development
      artifact and should have been set to 'w' before submission

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
gen_const_builtin_equal_tests.py: Wrap main in a function

This creates main() function and puts things in it. This is good python
style.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
gen_const_builtin_equal_tests.py: use enumerate instead of a flag

This combines the two loops into a single loop using enumerate. This
should be a little faster since we loop over the data only once, and
since it uses enumerate instead of math.

v2: - explicitly name enumerate's start parameter to make it clearer

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
gen_const_builtin_equal_tests.py: cleanup a few pylint errors

v2: - fix one additional pylint warning for long lines
    - reformat the TEST_VECTORS list to have better whitespace between
      the groups.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
egl/utils: Prepare egl_util_run to be called from piglit subtests.

For future EGL tests, I want to be able to use Chad's new piglit EGL
subtest infrastructure, and use the EGL utilities convenience functions
to set up a window, surface, and context.

Currently, egl_util_run calls piglit_report_result() after calling
test.draw.  This means no other subtests get run.  Add a new field in
egl_test to specify whether piglit_report_result() should be called, and
another field to store the result returned from test.draw.

Make sure that egl_util_run() tears down the window, surface, and
context.  Previously it was relying on cleanup being done when the
process died, which won't work if we want to run a second subtest in the
same thread.

TODO:

There's still some work that could be done here to ensure the
initialization steps in egl_util_run aren't done twice (e.g. calling
XOpenDisplay, eglInitialize, etc.)  However, the tests pass in their
current state, so there's no reason they shouldn't be merged.

Thanks a bunch to Chad Versace and Rob Bradford, who helped me debug
this code!

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: Rob Bradford <rob@linux.intel.com>
EGL_CHROMIUM_sync_control: Add initial tests.

Test the EGL_CHROMIUM_sync_control extension, which is similar to
the GLX_OML_sync_control extension:

http://www.opengl.org/registry/specs/OML/glx_sync_control.txt

The extension only defines one new function,
EGL_CHROMIUM_get_sync_values, which is equivalent to the
glXGetSyncValuesOML function.

It's difficult to test the Media Stream Counter (MSC) without the
equivalent function to get the MSC rate (glXGetMscRateOML).  The test at
least makes sure MSC and SBC increment after two SwapBuffers() calls.
UST is system-dependent, so it may behave differently on Windows, Linux,
and Apple.  The test just makes sure it increments monotonically.

The test uses Chad's new subtest infrastructure and the EGL convenience
functions from egl-util.c.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: Rob Bradford <rob@linux.intel.com>
arb_draw_instanced: use default window size, set viewport

Reviewed-by: Matt Turner <mattst88@gmail.com>
arb_draw_instanced: move and rename drawarrays test

Move tests/general/draw-instanced.c to
tests/spec/arb_draw_instanced/drawarrays.c

Reviewed-by: Matt Turner <mattst88@gmail.com>
arb_instanced_arrays: move and rename test

Move tests/general/draw-instanced-divisor.c to
tests/spec/arb_instanced_arrays/drawarrays.c

Reviewed-by: Matt Turner <mattst88@gmail.com>
arb_instanced_arrays: put extension prefix on executables

Prefix the executables with "arb_instanced_arrays" to be more
consistent.

Reviewed-by: Matt Turner <mattst88@gmail.com>
arb_draw_elements_base_vertex: rename dlist test

Reviewed-by: Matt Turner <mattst88@gmail.com>
arb_draw_elements_base_vertex: rename instanced drawelements test

Reviewed-by: Matt Turner <mattst88@gmail.com>
arb_draw_elements_base_vertex: rename drawrangeelements test

Reviewed-by: Matt Turner <mattst88@gmail.com>
arb_draw_elements_base_vertex: rename multidrawelements test

Reviewed-by: Matt Turner <mattst88@gmail.com>
arb_draw_elements_base_vertex: move bounds checking test

Reviewed-by: Matt Turner <mattst88@gmail.com>
arb_draw_elements_base_vertex: move the drawelements test

Reviewed-by: Matt Turner <mattst88@gmail.com>
arb_draw_elements_base_vertex: rename/move negative index test

Reviewed-by: Matt Turner <mattst88@gmail.com>
cl/api: Fix uninitialized read in cl/api/create_buffer.c

valgrind was giving:
Conditional jump or move depends on uninitialised value(s)
    at 0x4023B8: piglit_cl_test (create-buffer.c:226)
    by 0x4E40CF2: piglit_cl_api_test_run (piglit-framework-cl-api.c:198)
    by 0x4E3FD1C: piglit_cl_framework_run (piglit-framework-cl.c:264)
    by 0x401E3B: main (create-buffer.c:47)

Test passes on evergreen before/after the change.

Signed-off-by: Aaron Watry <awatry@gmail.com>
glean: Remove the getString test.

This test always passes, so all it does is make sure glGetString doesn't
crash.  But essentially every Piglit test that does extension checks
already does that.
glean/glsl1: Delete duplicated built-in function tests.

I've less "cross() function, in-place" because we don't have an
equivalent test for it elsewhere.