tests/fbo: remove unused err, error vars
fbo-missing-attachment-clear: remove unused err var
depth-cube-map: remove useless glFinish and piglit_report_result

Reviewed-by: Brian Paul <brianp@vmware.com>
Generate a html summary of skipped tests

Reviewed-by: Brian Paul <brianp@vmware.com>
tests: Remove all uses of glutBitmapCharacter

I'm trying to transition Piglit from using GLUT to using Waffle. This
requires killing all uses of GLUT functions, one-by-one.

Only three tests used glutBitmapCharacter,
    texturing/getteximage-formats
    texturing/texture-packed-formats
    texturing/texwrap
and the test results were not affected by the function. It was used only
in non-auto mode to print information about the texture format to the
window.

These tests were removed from the build when using Waffle, since
glut_waffle does not implement glutBitmapCharacter. This patch returns
them to the build.

Acked-by: Eric Anholt <eric@anholt.net>
Tested-by: Paul Berry <stereotype441@gmail.com>
Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
texline: Remove test

The texline test did not probe any pixels and was not listed in all.tests.
It was not a test at all.

This patch also removes directory tests/mesa, because the utility
functions defined there were only used by texline.

CC: Eric Anholt <eric@anholt.net>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
tests,util: Wrap glutPostRedisplay with piglit_post_redisplay

I'm trying to transition Piglit from using GLUT to using Waffle. This
requires killing all uses of GLUT functions, one-by-one.

This patch replaces all-but-one instance of glutPostRedisplay with a new
wrapper, piglit_post_redisplay. The sole remaining test that uses
glutPostRedisplay is windowoverlap; but that test doesn't use
piglit-framework, anyway.

Since piglit_escape_exit_key() calls piglit_post_redisplay() which is
defined in piglitutil_gl*, we must now link piglitutil_gl
into piglitglxutil to prevent link errors.

Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
tests,util: Wrap glutKeyboardFunc with piglit_set_keyboard_func

I'm trying to transition Piglit from using GLUT to using Waffle. This
requires killing all uses of GLUT functions, one-by-one.

This patch replaces all-but-one instance of glutKeyboardFunc with a new
wrapper, piglit_set_keyboard_func. The one remaining test that uses
glutKeyboardFunc is windowoverlap; but that tests doesn't use
piglit-framework, anyway.

Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
tests,util: Wrap glutSwapBuffers with piglit_swap_buffers

I'm trying to transition Piglit from using GLUT to using Waffle. This
requires killing all uses of GLUT functions, one-by-one.

Two remaining tests called glutSwapBuffers directly, read-front and
texline, for which piglit_preset_results is unsuitable. These tests call
glReadPixels on the front buffer. This patch replaces those calls with
a new wrapper, piglit_swap_buffers.

Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
tests,util: Wrap glutReshapeFunc with piglit_set_reshape_func

I'm trying to transition Piglit from using GLUT to using Waffle. This
requires killing all uses of GLUT functions, one-by-one.

One remaining test called glutReshapeFunc directly: texline.  This patch
replace that call with a new wrapper, piglit_set_reshape_func.

Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
util,tests: Replace GLUT visual enums with PIGLTI_GL_VISUAL enums (v2)

I'm trying to transition Piglit from using GLUT to using Waffle. That
requires either killing or wrapping all GLUT code.

Define enum piglit_gl_visual in piglit-framework.h, of which each value
matches its corresponding GLUT visual enum.

Do the following substitution in all util and test sources:
    GLUT_RGB            -> PIGLIT_GL_VISUAL_RGB
    GLUT_RGBA           -> PIGLIT_GL_VISUAL_RGBA
    GLUT_DOUBLE         -> PIGLIT_GL_VISUAL_DOUBLE
    GLUT_ACCUM          -> PIGLIT_GL_VISUAL_ACCUM
    GLUT_ALPHA          -> PIGLIT_GL_VISUAL_ALPHA
    GLUT_DEPTH          -> PIGLIT_GL_VISUAL_DEPTH
    GLUT_STENCIL        -> PIGLIT_GL_VISUAL_STENCIL

v2: Remove GLUT_INDEX, for Ken.

Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
framework: Report 'skip' if test executable not found

Previously, Piglit reported 'fail'.

Different sets of tests are built under different build configurations. If
a developer chooses to not build a test, Piglit shouldn't report failure.
Otherwise, it appears as a regression.

Now that 'returncode' may be None, any string formatting that references
it must be converted from Python2-style (%) to Python3-style (str.format).

Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
tests: Remove direct includes of piglit-framework.h

This prepares for the next commit, which renames piglit-framework.h. All
modified files included piglit-framework.h transitively.

Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
util: Rename piglit-framework.[ch] -> piglit-framework-gl.[ch]

This imposes naming consistency with other util and framework sources:
piglit-util-cl-*, piglit-util-gl-*, and piglit-framework-cl-*.

Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cmake: Prefix cmake options and feature macros with PIGLIT

Some cmake options and features macros had form USE_${feature}, others
BUILD_${category}_TESTS. This patch consistently prefixes all such options
and macros with PIGLIT.

Piglit, be a good code citizen. Namespace your variables.

This patch was created with
  find . -type f  | xargs sed -i \
    -e 's/\(^\|[^_]\)\(USE_\(GLX\|GLUT\|WAFFLE\|OPENGL\|OPENGL_ES1\|OPENGL_ES2\)\)\($\|[^_]\)/\1PIGLIT_\2\4/g' \
    -e 's/\(^\|[^_]\)\(BUILD_\(CL\|GLX\|GLES1\|GLES2\)_TESTS\)\($\|[^_]\)/\1PIGLIT_\2\4/g' \

Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
util: Add Waffle utility functions

Add utilitiy functions to log Waffle error messages.  And add
error-checking wrappers for some Waffle functions.

The functions are not yet used.

Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cmake: Define cmake flags and feature macros for X11, GLX, EGL

On Linux, unconditionally set the following internal CMake flags to true:
    PIGLIT_HAS_X11
    PIGLIT_HAS_GLX
Also define feature macros with the same names.

On all systems, if libEGL is found, then do the same for PIGLIT_HAS_EGL.

The CMake flags will allow us to selectively add certain files to
libpiglitutil_gl*. The flags and macros are used in a following commit.

Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
util: Rename piglit_gl_test_info -> piglit_gl_test_config

This structure's name didn't reflect its purpose well. Does it contain
information about the test file? Analysis of the testrun postmortem?

This rename also prepares for the next commit, which converts use of
PIGLIT_GL_TEST_MAIN to a set of new macros,
PIGLIT_GL_TEST_CONFIG_BEGIN/END. It's nice to have the structure modified
by PIGLIT_GL_TEST_CONFIG_BEGIN to actually be named 'config'.

Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
util: Convert GL tests to use PIGLIT_GL_CONFIG_BEGIN/END

This patch has two components.

1. In tests/util/piglit-framework-gl.h, replace the definition of
PIGLIT_GL_TEST_MAIN with the macro block PIGLIT_GL_CONFIG_BEGIN/END.

The macro PIGLIT_GL_TEST_MAIN was very restrictive. It was a fixed-arity
macro function that allowed a test to set only set 3 values: window width,
height, and visual. It would have been difficult to shoehorn optional test
attributes into such a fixed-arity macro function. Allowing optional
attributes is an essential feature because a following commit adds
optional fields to struct piglit_gl_test_config.

The macro block PIGLIT_GL_TEST_CONFIG_BEGIN/END is more flexible. Within
it the test is allowed to arbitrarilty modify the piglit_gl_test_config
structure.

2. In each GL test source, replace PIGLIT_GL_TEST_MAIN with
a PIGLIT_GL_TEST_CONFIG_BEGIN/END block.

Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
util: Add new GL test frameworks

This patch adds three major types of GL test frameworks, listed below.
They are described in detail in this patch's README.txt.
    piglit_glut_framework   (uses GLUT)
    piglit_winsys_framework (uses Waffle)
    piglit_fbo_framework    (uses Waffle)

This patch only adds and builds the source for new frameworks; they are
not yet used anywhere. Subsequent commits switch Piglit over to use the
new frameworks and delete the sources for the old framework code.

For details about the new frameworks, see this patch's README.txt.

Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>