[Piglit] [PATCH 1/2] Fix recursion in add_shader_test_dir().

Paul Berry stereotype441 at gmail.com
Wed Jul 13 15:28:32 PDT 2011


When attempting to recursively add subdirectories,
add_shader_test_dir() was using the basename, rather than the full
path, to determine whether a directory entry was a subdirectory.

Fortunately, this didn't cause any shader tests to be skipped, because
none of the directories it was attempting to visit recursively
actually contained any subdirectories.
---
 tests/all.tests |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/tests/all.tests b/tests/all.tests
index fcee3e2..d72507e 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -269,20 +269,19 @@ def add_shader_test(group, filepath, test_name):
 def add_shader_test_dir(group, dirpath, recursive=False):
 	"""Add all shader tests in a directory to the given group."""
 	for filename in os.listdir(dirpath):
-		if path.isdir(filename):
+		filepath = path.join(dirpath, filename)
+		if path.isdir(filepath):
 			if not recursive:
 				continue
 			if not filename in group:
 				group[filename] = Group()
-			add_shader_test_dir(group[filename], filename, recursive)
+			add_shader_test_dir(group[filename], filepath, recursive)
 		else:
 			ext = filename.rsplit('.')[-1]
 			if ext != 'shader_test':
 				continue
 			testname = filename[0:-(len(ext) + 1)] # +1 for '.'
-			add_shader_test(group,
-					path.join(dirpath, filename),
-					testname)
+			add_shader_test(group, filepath, testname)
 
 def add_getactiveuniform_count(group, name, expected):
 	path = 'shaders/'
-- 
1.7.6



More information about the Piglit mailing list