cmake: Suppress warning on cmake 2.8.12+

cmake 2.8.12 Introduced a new policy (CMP0022). Because there are two
policy options and piglit doesn't explicitly ask for one it defaults to
the OLD setting, but spews warnings. By setting OLD explicitly this
warning goes away.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Revert "cmake: Suppress warning on cmake 2.8.12+"

This reverts commit 43c3d2ab0c44ed53baeebd2ca568922bb34b835a.
tests/gpu: actually make it be a subset of the quick tests

Commit 12cf501da67 (tests/gpu.py: Don't use execfile) accidentally
switched from execfile'ing quick.py to importing tests.all. Change this
to import tests.quick.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
cl: Add test program-scope-arrays.

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Adds piglit framework test to test GleanTest.globalParams bug

This patch adds a framework test to show the problem with
GleanTest.globalParams. It makes use of nose, a python testing
framework, which is simple to write tests for, and is in widespread
usage for testing python code.

Acked-by: Jose Fonseca <jfonseca@vmware.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Fix GleanTest.globalParams

The problem with the way global params work is that they surprise the
user, since they are applied at object initialization time. So the
following code doesn't do what one expects:
   a = GleanTest("basic")
   GleanTest.globalParams = ['--quick']
   b = GleanTest("basic")
   assert a.command == b.command

This would create an assertion failure with the current code, since
global params are applied at instance initialization. Since these params
are supposed to be global, one would expect them to be applied to all
instances, regardless of when the instance was created and the class
variable set.

This patch achieves that by converting Test to a new-type class,
allowing getters and setters to be created. It then creates a getter and
setter for ExecTest.command, and overwrites the getter in GleanTest to
return ``self.command + self.globalParams''. This allows an individual
gleantest to overwrite the global commands, but means that if a instance
hasn't created self.globalParams that the Gleantest.globalParams is
applied when self.command is called.

Acked-by: Jose Fonseca <jfonseca@vmware.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
tests/quick.tests: return to pep8 compliance

commit bab84213 exposed a behvarioral problem in GleanTest, and commit
832e498 worked around this bug by reordering code. While this was a
valid work around it wasn't pep8 compliant. Since the previous patch in
this series fixed the behvaior of GleanTest, there is no reason to keep
this change.

Acked-by: Jose Fonseca <jfonseca@vmware.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework/shader_test.py: fix bug from commit 260f211d

This patch fixes a minor bug. An exception catch calls a function with a
single leading underscore instead of two leading underscores.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework/environment.py: Adds new module

This module contains the testBinDir variable and the Environment class,
and is meant to hold environment settings for piglit

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Replace testBinDir with pep8 compliant TEST_BIN_DIR

This is really a constant, not just a variable, since changing it will
cause undefined behavior. Beyond that lower cammelCase is not allowed
for variable names in pep8, so this should be changed.

This was implemented with the following command:
find . -name '*.py' | xargs -n sed -i -e 's!testBinDir!TEST_BIN_DIR!g'
find . -name '*.tests' | xargs -n sed -i -e 's!testBinDir!TEST_BIN_DIR!g'

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework.environment.py: Replace Environment.collectData static method

First, static methods are ugly, and python's namespaces make them even
less interesting, since a toplevel function is like a static method but
without being part of a class. Second this static method was even worse
since it had nothing to do with the class it was attached.

This is replaced with a toplevel function in the environment module.
This also removed the need for checking what OS piglit is running on,
since it blindly attempts to run all of the possible commands that we
might want using a try/except block to skip the ones that are not
returned.

V2: - Return and iterator from Environment.get_environment() instead of
      a list. This should be more efficient if we add more binaries.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
environment.py: replace loops in constructor with comprehensions

The list comprehensions are easier to read.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
environment.py: replace docstring with block comment

This was incorrectly formatted and should have been using block comments
from the beginning.

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

This patch adds docstrings to the remaining places that are needed.

V3: - spell checking

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