ARB_viewport_array: declare array with constant size

And fix some warnings.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71513
Fix improperly-named geometry shader tests.

Several geometry shader tests were improperly added to all.tests with
names like "spec/glsl-1.50/glsl-1.50-geometry-foo" instead of
"spec/glsl-1.50/execution/geometry/foo".  This patch renames the tests
to follow our usual piglit conventions.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
More tests for vs-gs interface block array matching rules.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
More tests for vs-fs interface block matching rules.

Note: as of Mesa 5cb80f0, tests "interface-vs-array-to-fs-unnamed" and
"interface-vs-unnamed-to-fs-array" are known to fail.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
framework: Ignore info/debug dmesg output

i-g-t has a bunch of testcase that cause informational output. In
addition I usually enable drm debugging on my machines, so the
kms tests cause massive amounts of spew.

I've thought whether an option would be useful, but then I didn't
really see any reason why we should ever care about debug/info
messages. Hence the default.

Cc: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
igt: Enable dmesg checking by default

An awful lot of tests rely on in-kernel checks to detect issues. So
we better make them fail properly.

Note that the dmesg check relies on dmesg timestamps to work correctly.
If you don't have them it won't work.

Cc: Paulo Zanoni <przanoni@gmail.com>
igt: re-indent to get rid of tabs

I so failed at my python setup when doing this way back (less than a
year ago).

Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
GL_ARB_copy_buffer: Add a test for syncing with glBufferSubData().

v2: Use non-ARB-decorated names, use supports_gl_compat_version,
    actually upload data instead of getting undefined values.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
GL_ARB_copy_buffer: Add a test for syncing with glBufferData();

Like the subdata test, make sure that we get back the right results
when putting new data in our source or dest after a copy.

v2: Fix wrong data uploaded in the second half of the test, resulting
    in always failing (thanks, Ian!).  Also drop ARB decorations and
    use supports_gl_compat_version.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
GL_ARB_vertex_buffer_object: Test for glBufferSubData() on index buffers.

We already have one for VBOs under general/

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
GL_ARB_vertex_buffer_object: Add test for glBufferData() on the index buffer.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
GL_ARB_texture_buffer_object: Add a test for syncing with glBufferSubData().

v2: Fix broken indentation.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
GL_ARB_texture_buffer_object: Test for a bug in i965 with glBufferData().

v2: Fix broken indentation.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
GL_ARB_vertex_buffer_object: Test many draws using glBufferSubData().

The previous tests tried to get at bad synchronization for unexpected
rendering behaviors (repeatedly glBufferSubData()ing over the same
state), while this tries to get at a more expected rendering behavior
(incrementally glBufferSubData()ing into subsequent areas in a VBO).
It also caught a ton of bugs in my initial implementation of
glBufferSubData GPU stall avoidance.

v2: Fix whitespace, wrapping.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
framework: Add support for a test timeout

i-g-t tests can take a long time, and for a bunch of reasons (bad
tuning on disparate set of platforms, stuck in the kernel which often
can be recovered by interrupting with a signal, ...) that sometimes
extends to a good approximation of forever.

Hence this adds a per-test timeout value and a bit of infrastructure
to adjust the results. Test results adjusting is done after calling
interpretResult so that we don't have to replicate this all over the
place. This might need to be adjusted for the piglit-native subtest
stuff, but otoh igt is a bit special with it's crazy long-running
tests. So I think we can fix this once it's actually needed.

The default timeout is None, so this is purely opt-in.

Note on the implementation: SIG_ALARM doesn't exists on Windows and
stackoverflow overwhelmingly recommended to go with this thread-based
approach here. But only tested on my Linux box here.

I've also timed quick.tests run a bit and the overhead due to the
additional thread we launch seems to be in the wash. So I didn't opt
to make the thread launching optional if there's no timeout limit.

v2: Also add all the boilerplate needed to handle the new test status
in summaries. For the color I've opted for two shades of light blue,
they nicely stick out from the current selection.

v3: Fix GLSLParserTest and ShaderTest. They both derive from
PlainExecTest but only call the __init__ function of the Test
baseclass. I haven't really figured why this is and also not really
what command I should pass to PlainExecTest.__init__, so just
replicated the init code for now.

v4: Initialize timeout earlier for tests where we use the ENOENT
handling to skip them.

Fix up the out, err passing from the thread. Apparently my idea of how
python closures work was completely misguided - like with a function
call a closure captures a copy of of a reference pointing at the
original object. So assinging anything to them won't have any effect
outside of the lambda. Hence we need to jump through hoops and pass an
array around. Nicer fix would be to create a class or something, but
that seems like overkill.

v5: Fixup the fraction setting in status.py

Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
Cc: Dylan Baker <baker.dylan.c@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
igt: timeout tests by default after 20 minutes

I bit gross, we probably need more fine-grained limits for
thrashing/swapping tests vs. others. But at least a start.

Acked-by: Damien Lespiau <damien.lespiau@intel.com>
framework/summary.py: Set constants for directories

This uses python's tempfile module to get a platform dependent place to
put temporary files, which should allow html summary to work even when
installed somewhere read-only.

Tested-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
CMakeLists.txt: Install templates directory

Without this piglit-summary-html will not work when piglit is installed.

Tested-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
summary.py: Treat subtests as groups

This patch causes tests with subtests to be treated as a group, rather
than as a test. This means that the status the test itself stores will
be overwritten by those in the subtest.

There is one oddity about this to be aware of; a test with subtests that
crashes or fails before any of the subtests run will report a fraction
of 0/1 with the appropriate color, even though all of the subtests will
report Not Run.

v2: - Add subtests to the results file as full tests (the internal view
      of the json), without this they will not appear in changes, fixes,
      etc
    - Render the background color of Not Run tests correctly in HTML
    - Apply subtest fractions down the stack
v3: - Don't generate a link for Not Run tests in html page

Tested-by: Ben Widawsky <ben@bwidawsk.net>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
core.py: don't write subtests as full entries

This stops subtests from being written as full entries in the json.
Instead, in the summary code the test with subtests is treated as a
group, and the subtests as real tests. This has the added benefit of
reducing the size of the json by 80%.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>