gl-3.2: Formatting fixes to glDrawBuffers error test

Fix some whitespace issues, use const on the static arrays, use
ARRAY_SIZE instead of hard-coded value, don't clear the window (for no
reason), and execute the test from piglit_init (since there is no
rendering).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: Nicholas Mack <nichmack@gmail.com>
Cc: Paul Berry <stereotype441@gmail.com>
gl-3.1: Move draw-buffers-errors test from 3.2 to 3.1

The exact same spec language appears in the 3.1 spec.  Currently no Mesa
driver supports OpenGL 3.2, but there are drivers that support 3.1.
This allows the test to run now on those drivers.

NOTE: This test currently fails in Mesa.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: Nicholas Mack <nichmack@gmail.com>
Cc: Paul Berry <stereotype441@gmail.com>
framework: Disable mesa's GL API error logging by default.

Otherwise you'd approximately never terminate a run with khronos's
testsuite included in the run.  If you were lucky.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
GL_ARB_vertex_program: Add a tests for Mesa code I was changing.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
arb_internalformat_query-minmax: add more version/ext checking

The valid_formats[] list includes formats supported either by
GL 3.0 or GL_EXT_texture_float and GL_EXT_texture_rg.
ext_texture_array/compressed: check for GL_EXT_texture_array

We obviously should require this extension.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
builtin_functions.py: tweak integer constants

This fixes some misleading fs-op-div-* failures when the driver does
integer arithmetic with floating point.  When we compute the reciprocal
of some integers we wind up with inexact floating point results.  So
expressions like X/X result in 0.9999 or such.

This patch tweaks the generator code to use some "nicer" integers
so that X/X comes out as expected.

Note the GLSL 1.10 spec, section 4.1.3:
"However, there is no requirement that integers in the language map to
an integer type in hardware. It is not expected that underlying hardware
has full support for a wide range of integer operations."
texsubimage: use piglit_get_gl_enum_name()
framework: Fix mis-indentation of the test changes computation.

b66f365f23a5b6b31a1b3f6c5bb13d3983de2443 appears to have accidentally
indented this code, so that we would calculate the changes from the
1st to 2nd result again when looking at the 3rd result.

Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
framework: Make the set of tests per page always be a set.

Starting with appending to the dictionary entry as a list, then making
the entry into a set later is pretty weird.  Just always use a set.

Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
framework_tests/summary.py: Tests Summary.py's assignment of statues

This code tests the way Summary.py assigns statuses to tests.
Specifically it tests regressions, fixes, changes, and problems,
assuring that only the correct permutations of these tests are added to
the list.

It uses python's builtin unittest framework, and a magical decorator to
limit code duplication.

This already reveals ~20 problems in the current implementation

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
piglit-framework-tests.py: Adds a utility for running piglit unit tests

This program gives the option to run the tests. These tests are meant to
test internal features of the piglit framework. Currently there are only
tests for the summary module's handling of regressions, fixes, changes,
and problems.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework/summary.py: Fix problems with status handling

Fixes status hanlding (fixes, regressions, changes) to be compliant with
the status handling in framework_tests/summary.py. Mainly this addresses
notrun -> * and * -> notrun, as well as a few corner cases.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
status.py: Adds a new status class and subclasses

These status classes are intended to replace the string statuses
currently used by piglit summary.

They give a couple of very nice advantages, first, they can be directly
compared to each other to determine whether a status is worse than
another status. These statuses can also be compared to any object
implementing the __int__ magic method.

This will allow us to remove a number of special functions for sorting
representations of statuses.

v2: - Use larger numbers for the statuses, this should make adding
      addtional statuses easier, since there is room between the
      statuses.
    - Add a class for the "Not Run" status
    - Adds classes for dmesg-warn and dmesg-fail
    - Change statuses to match the standard set in the framework test

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
status: Make use of the status objects

This adds code in framework/summary.py and framework/core.py to make use
of the status classes in status.py. This makes comparisons between
statuses much simpler and cleaner

v2: - Instead of importing all of the classes into the local namespace
      use the ``import ... as'' syntax. This means that if additional
      statuses are added they can easily be used without updating
      imports
    - Correct the sorting for fixes and regressions
    - Fix bug in TestResult that caused Fail, Warn, and Crash to be
      assigned the wrong status Objects
    - Adds support for dmesg-warn and dmesg-fail

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>