Drop defines of _GNU_SOURCE in tests.

The build system defines it globally.

Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
glean: Use piglit-dispatch instead of calling piglit_get_proc_address().

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
python: Convert from print statement to function

One of the biggest changes between python2 and python3 is that print
changed from a statement to a function. This change was backported to
python2 in the __future__ module, and this patch makes that conversation
to ease the transition from python2 to python3.

This patch does add a dictionary comprehension to
Summary.generate_text(), but dictionary comprehensions are available in
python3, and is fixed in the next patch.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
tests: replace tabs with spaces

This is achieved with the following command:
find tests -name '*.py' | xargs sed -i -e 's!\t!        !g'

In python2 its a warning to mix spaces and tabs, in python3 it's a
runtime error. So no more tabs in python files, just spaces.
Convert from python2 to python3

This is one big ugly patch, but I don't really see a way to make a
working transition without this ugliness, since any splitting of these
changes would cause the framework to raise a runtime exception.

This is the output of the 2to3 tool provided by python, with a few
manual edits for style and to replace list(iterator) with plain
iterators, which are fine for our use

It also does the following:
- replace #!/usr/bin/python with #!/usr/bin/python3
- Fix changes to hanging indents
- fix slots operator in status.py:
  - In python3 __slots__ behaves slightly differently than in python2,
    in that a class attribute does not fulfill a slot, but actually
    conflicts with it. For more information see:
    http://bugs.python.org/issue12766
- Fix bytes, strings and unicode
  - In python2 regex strings are usually of the raw type: r'(foo|bar)',
    but in python3 they need to be of the same type as the strings they
    are to be applied to. In dmesg this is bytes, so b'(foo|bar)'
  - One of the huge advantages to moving to python3 is that there is no
    ambiguity between unicode and byte strings. Bytes are explicitly
    marked as such and everything else is unicode.
- Fix functions that have moved from modules or been renamed
  - A number of types have been moved into the global namespace in
    python3, among them types.IntType and types.LongType have been
    replaced with int and types.FloatType have been replaced with float.

What it doesn't fix:
- junit
generated_tests: Convert to python3

This uses python3 for generating tests. This was generated by the 2to3
tool, with a few hand tuned changes, mainly around print statements that
already used grouping parens.
CMakeLists: Change python 2 dependency to python 3