Commit e1cb31aa authored by Dylan Baker's avatar Dylan Baker
Browse files

gen_outerproduct_tests.py: Move template to templates dir


Signed-off-by: default avatarDylan Baker <dylanx.c.baker@intel.com>
parent 84e06633
......@@ -98,7 +98,8 @@ piglit_make_generated_tests(
piglit_make_generated_tests(
outerproduct_tests.list
gen_outerproduct_tests.py
gen_outerproduct_template.mako)
templates/gen_outerproduct_tests/template.shader_test.mako
)
piglit_make_generated_tests(
builtin_uniform_tests_fp64.list
......
......@@ -24,7 +24,11 @@ from __future__ import print_function
import os
import itertools
import collections
import mako.template
from templates import template_file
TEMPLATE = template_file(os.path.splitext(os.path.basename(__file__))[0],
'template.shader_test.mako')
Parameters = collections.namedtuple(
'Paramters', ['columns', 'rows', 'vec_type', 'matrix'])
......@@ -40,10 +44,6 @@ def main():
name = ('spec/glsl-1.20/execution/'
'{shader}-outerProduct-{type}{mat}{vec}.shader_test')
template = mako.template.Template(filename=
os.path.join(os.path.dirname(__file__),
'gen_outerproduct_template.mako'))
for c, r in itertools.product(xrange(2, 5), repeat=2):
vecs = [
Parameters(c, r, 'vec', 'mat{0}x{1}'.format(r, c)),
......@@ -67,9 +67,10 @@ def main():
print(_name)
with open(_name, 'w+') as f:
f.write(template.render_unicode(params=params,
f.write(TEMPLATE.render_unicode(params=params,
type=type,
shader=shader))
if __name__ == '__main__':
main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment