summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2011-01-07 15:08:14 -0800
committerIan Romanick <ian.d.romanick@intel.com>2011-01-07 15:41:56 -0800
commit0d48bff983f658cdcbdc2dfd26929f9be6f8e125 (patch)
treea53be7d92f11c9f895622752604b6bd867db706b
parent8eca0f638ab4c67823b724837937bebc545dad86 (diff)
Use import_glsl_parser_tests instead of open coding it
-rwxr-xr-xframework/glsl_parser_test.py4
-rw-r--r--tests/all.tests12
-rw-r--r--tests/spec/glsl-1.10/tests27
-rw-r--r--tests/spec/glsl-1.30/tests27
4 files changed, 11 insertions, 59 deletions
diff --git a/framework/glsl_parser_test.py b/framework/glsl_parser_test.py
index 93b52cd5..66c435c1 100755
--- a/framework/glsl_parser_test.py
+++ b/framework/glsl_parser_test.py
@@ -47,11 +47,11 @@ def add_glsl_parser_test(group, filepath, test_name):
"""Add an instance of GLSLParserTest to the given group."""
group[test_name] = GLSLParserTest(filepath)
-def import_glsl_parser_tests(group, filepath, subdirectories):
+def import_glsl_parser_tests(group, basepath, subdirectories):
# Register each shader source file in the directories below as
# a GLSLParserTest.
for d in subdirectories:
- walk_dir = path.join(filepath, d)
+ walk_dir = path.join(basepath, d)
for (dirpath, dirnames, filenames) in os.walk(walk_dir):
# Ignore dirnames.
for f in filenames:
diff --git a/tests/all.tests b/tests/all.tests
index 39f84c90..f0f0e6d8 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -10,7 +10,7 @@ import subprocess
from framework.core import *
from framework.exectest import *
from framework.gleantest import *
-from framework.glsl_parser_test import GLSLParserTest, add_glsl_parser_test
+from framework.glsl_parser_test import GLSLParserTest, add_glsl_parser_test, import_glsl_parser_tests
######
# Collecting all tests
@@ -906,10 +906,16 @@ add_texwrap_test3(gl20, '3D', 'npot', 'proj')
add_texwrap_test3(gl20, '3D', 'npot', 'border')
# Group spec/glsl-1.10
-execfile(os.path.dirname(__file__) + '/spec/glsl-1.10/tests')
+spec['glsl-1.10'] = Group()
+import_glsl_parser_tests(spec['glsl-1.10'],
+ os.path.dirname(__file__) + '/spec/glsl-1.10',
+ ['preprocessor', 'compiler'])
# Group spec/glsl-1.30
-execfile(os.path.dirname(__file__) + '/spec/glsl-1.30/tests')
+spec['glsl-1.30'] = Group()
+import_glsl_parser_tests(spec['glsl-1.30'],
+ os.path.dirname(__file__) + '/spec/glsl-1.30',
+ ['preprocessor', 'compiler'])
arb_texture_rectangle = Group()
spec['ARB_texture_rectangle'] = arb_texture_rectangle;
diff --git a/tests/spec/glsl-1.10/tests b/tests/spec/glsl-1.10/tests
deleted file mode 100644
index eaafc8a6..00000000
--- a/tests/spec/glsl-1.10/tests
+++ /dev/null
@@ -1,27 +0,0 @@
-# All tests here are registered into the 'spec_glsl_110' group.
-spec_glsl_110 = Group()
-spec['glsl-1.10'] = spec_glsl_110
-
-# Register each shader source file in the directories below as
-# a GLSLParserTest. The test names adhere to the pattern
-# 'glsl-1.10/.../filename'.
-for d in ['preprocessor', 'compiler']:
- walk_dir = path.join('tests', 'spec', 'glsl-1.10', d)
- for (dirpath, dirnames, filenames) in os.walk(walk_dir):
- # Ignore dirnames.
- for f in filenames:
- # Add f as a test if its file extension is good.
- ext = f.rsplit('.')[-1]
- if ext in ['vert', 'frag']:
- filepath = path.join(dirpath, f)
- # testname := filepath with initial
- # 'tests/spec/glsl-1.10' removed
- sep = os.sep
- testname = sep.join(filepath.split(sep)[3:])
- assert(type(testname) is str)
- add_glsl_parser_test(
- spec_glsl_110,
- filepath,
- testname)
-
-# vim: ft=python noet ts=8 sw=8:
diff --git a/tests/spec/glsl-1.30/tests b/tests/spec/glsl-1.30/tests
deleted file mode 100644
index 47644f85..00000000
--- a/tests/spec/glsl-1.30/tests
+++ /dev/null
@@ -1,27 +0,0 @@
-# All tests here are registered into the 'spec_glsl_130' group.
-spec_glsl_130 = Group()
-spec['glsl-1.30'] = spec_glsl_130
-
-# Register each shader source file in the directories below as
-# a GLSLParserTest. The test names adhere to the pattern
-# 'glsl-1.30/.../filename'.
-for d in ['preprocessor', 'compiler']:
- walk_dir = path.join('tests', 'spec', 'glsl-1.30', d)
- for (dirpath, dirnames, filenames) in os.walk(walk_dir):
- # Ignore dirnames.
- for f in filenames:
- # Add f as a test if its file extension is good.
- ext = f.rsplit('.')[-1]
- if ext in ['vert', 'geo', 'frag']:
- filepath = path.join(dirpath, f)
- # testname := filepath with initial
- # 'tests/spec/glsl-1.30' removed
- sep = os.sep
- testname = sep.join(filepath.split(sep)[3:])
- assert(type(testname) is str)
- add_glsl_parser_test(
- spec_glsl_130,
- filepath,
- testname)
-
-# vim: ft=python noet ts=8 sw=8: