Commit 16e7fde7 authored by Dylan Baker's avatar Dylan Baker
Browse files

gen_const_builtin_equal_tests.py: put template in templates dir


Signed-off-by: default avatarDylan Baker <dylanx.c.baker@intel.com>
acked-by: Matt Turner's avatarMatt Turner <mattst88@gmail.com>
parent dd5cc5bf
......@@ -32,7 +32,9 @@ piglit_make_generated_tests(
builtin_function.py)
piglit_make_generated_tests(
const_builtin_equal_tests.list
gen_const_builtin_equal_tests.py)
gen_const_builtin_equal_tests.py
templates/gen_const_builtin_equal_tests/template.shader_test.mako
)
piglit_make_generated_tests(
interpolation_tests.list
gen_interpolation_tests.py)
......
......@@ -23,30 +23,11 @@
from __future__ import print_function
import re
import os
import textwrap
import mako.template
TEMPLATE = mako.template.Template(textwrap.dedent("""
[require]
GLSL >= 1.20
[vertex shader]
void main()
{
gl_Position = gl_Vertex;
}
[fragment shader]
void main()
{
const ${expected.split('(')[0]} res = ${func}(${input[0]}, ${input[1]});
gl_FragColor = (res == ${expected})
? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
}
[test]
draw rect -1 -1 2 2
probe all rgb 0.0 1.0 0.0"""))
from templates import template_file
TEMPLATE = template_file(os.path.basename(os.path.splitext(__file__)[0]),
'template.shader_test.mako')
TEST_VECTORS = [
["vec2(3.0, 3.14)",
......
[require]
GLSL >= 1.20
[vertex shader]
void main()
{
gl_Position = gl_Vertex;
}
[fragment shader]
void main()
{
const ${expected.split('(')[0]} res = ${func}(${input[0]}, ${input[1]});
gl_FragColor = (res == ${expected})
? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
}
[test]
draw rect -1 -1 2 2
probe all rgb 0.0 1.0 0.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