glx: Add a testcase for GLX_EXT_buffer_age

v2: Indent according to piglit style, fix copyright message, drop
    redundant glReadBuffer() setting. (changes by anholt).

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adel Gadllah <adel.gadllah@gmail.com> (v2)
glx-buffer-age: Test each frame rendered, and render enough frames.

An implementation might have up to 4 (!) buffers in its queue, so
render a bunch of frames and make sure each frame has a valid age.

Reviewed-by: Adel Gadllah <adel.gadllah@gmail.com>
glx-buffer-age: Test with vblank_mode=0.

Revealed a problem with the Mesa patches.  Interestingly,
glXSwapIntervalMESA(0) doesn't produce the same behavior.

Reviewed-by: Adel Gadllah <adel.gadllah@gmail.com>
framework/status.py: Update some docstrings

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework/tests/status_tests.py: add initialization tests

Just a few simple tests to ensure that the various status classes
initialize.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework/status.py: Replace subclasses with constants

This patch replaces the flyweight children of Status with a single class
that is initialized with arguments, and provides constants. These
constants are mostly immutable in the cleanest way possible (they're not
if you really want to go after them, but short of Cython or a native C
extension it's impossible to make a truly immutable object in python).

What this provides for us is a simple, clean interface, a massive
reduction in code, and better compatibility for python 3 (the previous
implementation relied on a behavior of __slots__ that changed in python
3), and minimal API changes.

v2: - Replace patch that used abc.ABCMeta with this constant aproach

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

Due to changes in the way Status works the previous initialization tests
now only test lookup. This adds a new test that does a simple
initialization on Status()

v2: - Add this patch

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework/tests/status.py: Add test for status in list syntax

Currently a comparison like this will raise an error:
framework.status.PASS in ['pass']

This test currently fails, and is fixed by another patch in this series

v2: - update this test to work with constant statuses

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework/status.py: Fix bug in Status.__eq__

Because Status.__eq__ didn't have the ability to compare str or unicode
instances, using Pass() in ['pass'] would raise an exception. With this
patch that is no longer the case, and that syntax works fine.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework/tests/status_tests.py: remove equivalency tests

These tests are not actually relevant, they were for testing the
definition of a docstring that was incorrect. That docstring was
updated, but the corresponding tests where not completely removed, which
means these tests ended up testing pass == pass, skip == skip, etc. Not
very useful

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework/tests/status_tests.py: Pretty up the output

This makes the changes cosmetically more pleasing, but doesn't affect
the functionality of the tests at all.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
edgeflag-const: test constant (zero-stride) edge flag
ARB_explicit_uniform_location: test for uniform location boundary values

v2: fix style issues, use asprintf (Topi, Anuj)
v3: more cleanups (Topi, Ian)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
ARB_explicit_uniform_location: test sequential array elements

v2: set values directly to shader, simplify overall (Topi)
    fix style issues, use asprintf (Anuj)
v3: more cleanups (Topi, Ian)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
junit: Update for framework.status refactoring.

With commit 8455927c4ef0fcf310ea7ed1e97ae2ff75fec80c status are
instances as opposed to classes.

Trivial.
gl-2.0: Test edgeflag in immediate mode with shader.

This is just a copy of the test edgeflag.c with client side arrays replaced
by immediate mode calls.
glsl-1.20: Access constant array of structs.

Add two tests:
Test reading from a constant array of structs.
Test reading from a constant array of structs with an array member.

This test provokes failed assertions in st/mesa: glsl_to_tgsi.
ARB_explicit_uniform_location: Remove unused variables.
CL: Add basic mapped memory tests

Tests blocking map for read/write by:
- Creating host/device src/dst buffers
- Map device src buffer for writing, and memcpy to it before unmapping
- enqueueCopyBuffer from src to dst
- Map device dst buffer for read, and memcpy from it before unmapping
- Compare host src/dst buffers for equality

v2: Add closing curly brace

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
util: add piglit_probe_texel_volume_rgba()

This is similar to piglit_probe_texel_rect_rgba except it allows
for probing a subvolume of a 3D texture, or slices of a 2D array
texture.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>