*.tests: set __all__ = ['profile']

This makes the only publicly declared object in the .tests files the
profile object. This is groundwork for importing the profile rather than
running it via execfile().

Acked-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Add support to load multiple test profiles

This patch gives piglit run the ability to take one or more test
proflies as arguments rather than just one. It loads the profiles,
merging them from left to right, overwriting conflicting results. This
will allow the oglconform and es3conform loaders to be taken out of
all.tests.

Acked-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
all.tests: Remove execfile(es3conform.tests)

This option is now redundant, since it can be given explicitly at the
command-line.

Acked-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
tests/all.tests: Remove unused blacklist feature

This feature is never used (nor does it seem like it should ever have
been used), so lets get rid of it.

V2: - split this out of the next patch

Acked-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
tests/all.py: load glean glsl, frag, and vert tests internally

This patch converts the glean glsl1, fragPrgo1, and vertProg1 tests from
external files that are called by execfile into lists of arguments, and
uses a loop to add the tests.

This removes test files that are not in fact loadable test files, and
lack a TestProfile instance, which means they will not be importable.

V2: - rename glean_glsl1_tests to glean_glsl_tests
    - rename glean_frag_tests to glean_fp_tests
    - rename glean_vert_Tests to glean_vp_tests
    - split removal of blacklist out of this patch

Acked-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Rename all tests files from .tests to .py

This patch renames the .tests files to .py files; which is required for
the python interpreter to allow importing them.

Acked-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
tests: treat the tests folder as part of the python package

By adding __init__.py to tests folder python can search that folder for
modules to import.

Acked-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
tests/sanity.tests: Make sanity.tests importable

This allows sanity.py to export a profile instance, meaning it can be
used as an import instead of an execfile.

Acked-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
quick.tests: Make quick.tests import all.tests

Acked-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
tests/gpu.py: Don't use execfile

This uses import rather than execfile. It requires a few additional
changes since gpu.py uses some hacky behavior to remove shader_tests

Acked-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
tests/r300.py: use import instead of execfile

Acked-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
tests/r500.py use import instead of execfile

Acked-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
core.py: rewrite loadTestProfile to remove execfile()

This patch removes execfile, replacing it with import instead.

This isn't a prefect solution, but it provides feature parity with the
execfile() approach, while being python3 safe.

With this patch a user can require a test profile as tests/<your
profile>.* since, the code actually drops the '.*' , so scripts that
wrap piglit and use (ie) quick.tests will continue to work. It also
works without a '.', so the following examples will work after this
patch:
    tests/quick.tests
    tests/quick.py
    tests/quick

V2: - add explanation of new acceptable names for tests.

Acked-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
fbo-drawbuffers-none: test drawbuffer configurations with GL_NONE

Reviewed-by: Brian Paul <brianp@vmware.com>
egl-create-context-valid-flag-debug: build separate gl and gles binaries

Currently we are building a single binary for both GL and GLES.
However, it can only be added by either CMakelists.gl or .gles, but not
both.

Instead, build two differente binaries, install each in the respective
CMakelists, and add them both to tests/all.py.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
asmparsertest: Silence uninitialized variable warning.

Fix GCC maybe-uninitialized warning.

asmparsertest.c: In function 'piglit_init':
asmparsertest.c:243:10: warning: 'target' may be used uninitialized in this function [-Wmaybe-uninitialized]
   compile(argv[i], target, use_ARB);
          ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
fbo-rg: Silence uninitialized variable warning.

Fix GCC maybe-uninitialized warning.

fbo-rg.c:485:34: warning: 'internal_format' may be used uninitialized in this function [-Wmaybe-uninitialized]
  pass = render_and_check_textures(internal_format);
                                  ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
fbo-scissor-blit: Silence uninitialized variable warning.

Fix GCC maybe-uninitialized warning.

fbo-scissor-blit.c:109:5: warning: 'blit_to_fbo' may be used uninitialized in this function [-Wmaybe-uninitialized]
  if (blit_to_fbo)
     ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
fbo-stencil: Silence uninitialized warning.

Fix GCC maybe-uninitialized warning.

fbo-stencil.c:332:2: warning: 'res' may be used uninitialized in this function [-Wmaybe-uninitialized]
  return res;
  ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
glsl-link-test: Silence uninitialized variable warning.

Fix GCC maybe-uninitialized warning.

glsl-link-test.c: In function 'piglit_init':
glsl-link-test.c:124:10: warning: 'expect' may be used uninitialized in this function [-Wmaybe-uninitialized]
   fprintf(stderr,
          ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>