diff options
author | Dave Airlie <airlied@redhat.com> | 2010-08-30 16:47:28 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-08-30 16:48:44 +1000 |
commit | 14a60aad03bf8e7ee9922c81a813ee8d936851eb (patch) | |
tree | 1874907c2e13e1be8603c4126bca16d9046872f3 /generate-glean-tests.py | |
parent | f9c8bc1109e177b187906dc3125ac0e5b3fcf92a (diff) |
piglit/glean: split out fragprog1 and vertProg1 tests.
This makes them a lot easier to see what is going wrong on a test
by test basic, and follows what Eric did for glsl1.
It also generics the genearte-glsl1 script to take a cpp and suffix.
Diffstat (limited to 'generate-glean-tests.py')
-rwxr-xr-x | generate-glean-tests.py | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/generate-glean-tests.py b/generate-glean-tests.py new file mode 100755 index 000000000..c0e497960 --- /dev/null +++ b/generate-glean-tests.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Copyright © 2010 Intel Corporation +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Eric Anholt <eric@anholt.net> + +from getopt import getopt, GetoptError + +import os +import re +import sys + +def usage(): + USAGE = """\ +Usage %(progName) [cppfile] [add_prefix] + +cppfile: path to glean cppfile to parse +add_suffix: prefix to have in test name i.e. glsl1 -> add_glsl1 +""" + print USAGE % {'progName':sys.argv[0]} + sys.exit(1) + +def main(): + + try: + options, args = getopt(sys.argv[1:], "hdt:n:x:", [ "help", "dry-run", "tests=", "name=", "exclude-tests=" ]) + except GetoptError: + usage() + + if len(args) != 2: + usage() + + suffix = args[1] + + fileIN = open(args[0], 'r') + line = fileIN.readline() + next_is_name = False + + while line: + if next_is_name: + name = line.lstrip(" \",") + name = name.rstrip("\n") + if re.match(r'GLint stat', name): + break + if not re.match(r'//', name): + name = re.sub(r'".*', + r'', + name) + print "add_" + suffix + "('" + name + "')" + next_is_name = False + if line == " {\n": + next_is_name = True + line = fileIN.readline() + +if __name__ == "__main__": + main() |