glslparsertest: Support geometry and compute shader in {compile, link} status

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
framework/tests/status_tests.py: remove timeout

The timeout status has not been supported since commit e17a0eb71dbe, but
the revert left them in the re-factored tests. This patch is very
trivial, in that it removes Timeout testing from the test generator.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
cl-program-tester: Fix GCC format-security warning.

This patch fixes this GCC format-security warning.

program-tester.c: In function ‘piglit_cl_test’:
program-tester.c:1978:3: warning: format not a string literal and no format arguments [-Wformat-security]
   piglit_report_subtest_result(test_result, tests[i].name);
   ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
piglit-fbo: Add variable color_format to configure non-multisample fbo

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
arb_sample_shading: Use integer texture to simplify the test

Also, case of non-multisample color buffer is not handled correctly
in the test. Move it inside the shader program.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
builtin-gl-sample-id: Add testing for fbo with renderbuffer attachment

Existing test only covers the drawing to texture attachment with a
sample mask. This patch extends the test to include drawing to
renderbuffer attachment. This might help capture the bugs where
drawing to a texture differ from drawing to a renderbuffer.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
builtin-gl-sample-mask: Add testing for fbo with renderbuffer attachment

Existing test only covers the drawing to texture attachment with a
sample mask. This patch extends the test to include drawing to
renderbuffer attachment. This might help capture the bugs where
drawing to a texture differ from drawing to a renderbuffer.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Rename oglconfirm.py to oglconform.py.

Botched in commit cdfbf724df8c01eb4d7723abe73985594dd46550.
arb_gpu_shader5: test setting the invocations count in a separate GS

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
line-flat-clip-color: test flat-shaded line clipping color

This exercises a bug found in Mesa with softpipe, llvmpipe and swrast

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Add test to verify interpolation at sample position

ARB_sample_shading extension says:
 "When the sample shading fraction is 1.0, a separate set of colors
  and other associated data are evaluated for each sample, each set
  of values are evaluated at the sample location."

Test passes on intel hardware with mesa patch: 'i965: Use sample
barycentric coordinates with per sample shading'.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Add test to verify 'centroid' qualifier is ignored in case of persample shading

Here is what it tests:
Enable sample shading for the whole fragment shader using OpenGL API
glEnable(GL_SAMPLE_SHADING);
glMinSampleShading(1.0);

fragment shader:
centroid in vec4 b;
main()
{
  ...
}

Variable 'b' should be interpolated at sample's location.

V2: Use just one 'in' variable with the 'centroid' qualifier.
Another test already covers the interpolation of 'in' variable
without any 'qualifier'. This change also captures the mesa bug
reported on i965 driver:
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73915

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Logical operators 'and' and 'or' are supported until OpenCL version 1.2.

According to spec 1.1 Chapter 6.3 bullet g:
The logical operators and (&&), or (||) operate on all scalar and vector built-in types except
the built-in scalar and vector float types.

Signed-off-by: Yi Sun <yi.sun@intel.com>
Signed-off-by: Yangwei Shui <yangweix.shui@intel.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
framework/core: Fix performance regression from e4c9a3621a

There is a sort of corner case regression caused by this patch, if the
number of tests are less than 50 they are effectively always run
serially. This can have a pretty big performance impact, especially if
any of those tests takes a long time to run. Reducing this to 1 results
in a very slight performance reduction of very long runs (~2 seconds
difference on quick.tests), but the trade off for short runs is much
more significant.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
framework/dmesg: Adds a new module for dmesg

This modules implements two classes and a helper function. The two
classes are both dmesg wrapper classes, one, PosixDmesg is used on posix
systems when requested to actually do checks on dmesg. The second class,
DummyDmesg, is used to reduce code complexity by providing dummy
versions of the methods in PosixDmesg. This means that we don't need
separate code paths for Posix systems wanting to check dmesg, Posix
systems not wanting to check dmesg, and non-posix systems which lack
dmesg.

Beyond reducing complexity this module also gives better isolation,
dmesg is only used in Test.execute(), no where else. Additional classes
don't need to worry about dmesg that way, it's just available.

v2: - Remove unnecessary assert from PosixDmesg.update_result()
    - simplify replace helper in PoixDmesg.update_result()
    - replace try/except with if check
    - Change PosixDmesg.update_dmesg() to work even if dmesg 'wraps'
v3: - Try/Except assignment of PosixDmesg._last_message in update_dmesg()
    - Set the dmesg levels the same as the previous implementation
    - Change PosixDmesg into LinuxDmesg and enforce that dmesg has
      timestamps
v4: - Add check in LinuxDmesg.__init__ to ensure there is something in
      dmesg before doing the timestamp check. This should make problems
      clearer
    - Refactor some code in LinuxDmesg.update_result()
v5: - Replace exception with warning.
    - add break to loop in dmesg.update_dmesg

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Adds unit tests for the dmesg module

This adds a few tests for the dmesg class.

It also adds a test hook into core.Test. This is a little ugly, but I
just couldn't come up with any other solution that didn't involve
making the dmesg code more invasive or harder to read.

v2: - Adds tests to simulate dmesg 'wrapping'
v3: - Replace assert with nose.test assert helpers. These have the
      advantage of providing the option to add a message explaining what
      when wrong.
    - Adds test for LinuxDmesg's enforcement of timestamps
v4: - Remove timestamp error check test. It was polluting the entire
      environment's LinuxDmesg.DMESG_COMMAND in some cases
    - Refactor a few tests as a result of refactoring in framework/dmesg
    - Make the error message in the dmesg_wrap tests more helpful
    - Reduce test_dmesg_performance from .025 to .015 seconds.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Use the new dmesg class

This actually makes use of the new dmesg class rather than the dmesg
functions. It touches a lot of files, but almost all of these changes
are code removal rather than code addition.

v5: - Fix dmesg handling in resume

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> (v4)
piglit-run.py: Restrict dmesg to serial runs

Dmesg reporting has always been inaccurate with concurrent runs, and the
solution to concurrent runs would be to have each run take out a lock,
removing the chance that another test generated an error in dmesg while
it was running. But this effectively makes them a serial run, and at the
cost of greater code complexity. With that in mind it makes more sense
to just force --dmesg to imply -1.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Test that "continue" works properly inside a do-while loop.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Test that "continue" works in a switch statement within a do-while loop.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>