Commit 34316a9e authored by Dylan Baker's avatar Dylan Baker
Browse files

gen_outerproduct_invalid_params.py: Put template in templates dir


Signed-off-by: default avatarDylan Baker <dylanx.c.baker@intel.com>
parent 4a0fd60b
......@@ -103,7 +103,9 @@ piglit_make_generated_tests(
)
piglit_make_generated_tests(
outerproduct_invalid_params.list
gen_outerproduct_invalid_params.py)
gen_outerproduct_invalid_params.py
templates/gen_outerproduct_invalid_params/template.vert.mako
)
piglit_make_generated_tests(
outerproduct_tests.list
gen_outerproduct_tests.py
......
......@@ -20,25 +20,15 @@
from __future__ import print_function
import os
import textwrap
import mako.template
from templates import template_file
TEMPLATE = template_file(os.path.basename(os.path.splitext(__file__)[0]),
'template.vert.mako')
def main():
""" Generate tests """
template = mako.template.Template(textwrap.dedent("""
/* [config]
* expect_result: fail
* glsl_version: 1.20
* [end config]
*/
#version 120
void main() {
gl_Position = vec4(0);
outerProduct(${type}(0), ${type}(0));
}
"""))
dirname = os.path.join('spec', 'glsl-1.20', 'compiler',
'built-in-functions')
if not os.path.exists(dirname):
......@@ -50,7 +40,7 @@ def main():
name = os.path.join(dirname, 'outerProduct-{0}.vert'.format(type_))
print(name)
with open(name, 'w+') as f:
f.write(template.render_unicode(type=type_))
f.write(TEMPLATE.render_unicode(type=type_))
if __name__ == '__main__':
......
/* [config]
* expect_result: fail
* glsl_version: 1.20
* [end config]
*/
#version 120
void main() {
gl_Position = vec4(0);
outerProduct(${type}(0), ${type}(0));
}
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