test generators: add templates folder

Also adds a couple of helper functions to the templates __init__.py

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner <mattst88@gmail.com>
gen_shader_bit_encoding_tests.py: split template into separate file

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner <mattst88@gmail.com>
gen_shader_bit_encoding_test.py: use the if __name__ == __main__ pattern

v2: - replace gen_shader_bit_encoding: cleanup some styles issues with
      this patch
    - leaves the camel case function names alone (matt, ilia)
    - leaves block comment in test_data

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner <mattst88@gmail.com>
gen_shader_bit_encoding_tests.py: use builtin operators

This module implements a neg function, which is available in the math
module. Use that to save a whole line of code!

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner <mattst88@gmail.com>
gen_shader_bit_encoding_tests.py: Use with and print_function

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner <mattst88@gmail.com>
gen_shader_bit_encoding_tests.py: Silence or fix pylint warnings

This patch either silences known style problems, or fixes them
explicitly. This both makes the code easier to read, and makes tools
more useful since they are more likely to identify actual problems.

v2: - add this patch

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner <mattst88@gmail.com>
gen_shader_bit_encoding_tests.py: move dirname assignment up in loops

The directory name doesn't depend on values in the inner loops; so we
can generate it once and check for its existence once.

v2: - add this patch

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner <mattst88@gmail.com>
gen_shader_bit_encoding_tests.py: remove unnecessary assignments

This removes the creation of convenience variables that aren't actually
that convenient. They're not much shorter than the dictionary values they
come from, and they're exclusively passed into a template.

v2: - add this patch

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner <mattst88@gmail.com>
gen_shader_bit_encoding_tests.py: silence remaining pylint warnings

v2: - add this patch

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner <mattst88@gmail.com>
gen_texture_lod_tests.py: Split templates

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner <mattst88@gmail.com>
gen_texture_query_lod_tests.py: cleanup style problems

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner <mattst88@gmail.com>
gen_texture_query_lod_tests.py: use with and print_function

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner <mattst88@gmail.com>
gen_texture_query_lod_tests.py: Use if __name__ == __main__ pattern

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner <mattst88@gmail.com>
gen_texture_query_lod_tests.py: move file generation up in loop

This moves the directory name generation and existence checking/creation
out of two loops, and allowing for more reuse.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner <mattst88@gmail.com>
gen_texture_query_lod_tests.py: minor refactors

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner <mattst88@gmail.com>
gen_texture_query_lod_tests.py: Split template into templates folder

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner <mattst88@gmail.com>
gen_const_builtin_equal_tests.py: us os.path.join for directory names

This makes the test generators more OS agnostic.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner <mattst88@gmail.com>
gen_const_builtin_equal_tests.py: put template in templates dir

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner <mattst88@gmail.com>
gen_builtin_packing_tests.py: Fix imports

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner <mattst88@gmail.com>
gen_builtin_packing_tests.py: Make docstring a proper docstring

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner <mattst88@gmail.com>