diff options
author | Chad Versace <chad.versace@intel.com> | 2011-01-12 11:22:13 -0800 |
---|---|---|
committer | Chad Versace <chad.versace@intel.com> | 2011-01-12 13:03:58 -0800 |
commit | 82d134995648eccf11bd73f8af68025cfad6c8b7 (patch) | |
tree | 62a59027dfafbd332718e7bab6d7ae2be6af8371 /framework | |
parent | ae2500e3adf684a79111473fe0d3327462cd6891 (diff) |
glsl_parser_test.py: Document import_glsl_parser_tests()
Diffstat (limited to 'framework')
-rwxr-xr-x | framework/glsl_parser_test.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/framework/glsl_parser_test.py b/framework/glsl_parser_test.py index 2fd8a5dd..aff08070 100755 --- a/framework/glsl_parser_test.py +++ b/framework/glsl_parser_test.py @@ -48,8 +48,19 @@ def add_glsl_parser_test(group, filepath, test_name): group[test_name] = GLSLParserTest(filepath) def import_glsl_parser_tests(group, basepath, subdirectories): - # Register each shader source file in the directories below as - # a GLSLParserTest. + """ + Recursively register each shader source file in the given + ``subdirectories`` as a GLSLParserTest . + + :subdirectories: A list of subdirectories under the basepath. + + The name with which each test is registered into the given group is + the shader source file's path relative to ``basepath``. For example, + if:: + import_glsl_parser_tests(group, 'a', ['b1', 'b2']) + is called and the file 'a/b/c/d.frag' exists, then the test is + registered into the group as ``group['b1/c/d.frag']``. + """ for d in subdirectories: walk_dir = path.join(basepath, d) for (dirpath, dirnames, filenames) in os.walk(walk_dir): @@ -60,7 +71,7 @@ def import_glsl_parser_tests(group, basepath, subdirectories): if ext in ['vert', 'geom', 'frag']: filepath = path.join(dirpath, f) # testname := filepath with initial - # 'tests/spec/glsl-1.30' removed + # three directories removed. sep = os.sep testname = sep.join(filepath.split(sep)[3:]) assert(type(testname) is str) |