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>