[Piglit] [PATCH 1/2] Fix recursion in add_shader_test_dir().
Ian Romanick
idr at freedesktop.org
Fri Jul 15 12:31:21 PDT 2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 07/13/2011 03:28 PM, Paul Berry wrote:
> 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.
In addition to my Reviewed-by on the tests, this patch gets
Tested-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
> 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/'
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEUEARECAAYFAk4glYkACgkQX1gOwKyEAw9ohACY/I5GdbBGgpdMdK7d5WHoMhxP
dQCePjba7m8FSsfLj417fpEbxvbF4cI=
=gMLi
-----END PGP SIGNATURE-----
More information about the Piglit
mailing list