in testcfg.py [0:0]
def ListTests(self, current_path, path, mode, arch):
tests = []
src_dir = join(self.root, "src")
strip = len(src_dir.split(os.path.sep))
for root, dirs, files in os.walk(src_dir):
ignore_dirs = [d for d in dirs if d.startswith('.')]
for d in ignore_dirs:
dirs.remove(d)
for f in [x for x in files if self.IsTest(x)]:
test_path = [] + current_path
test_path.extend(root.split(os.path.sep)[strip:])
test_name = short_name = f
# shotlen test_name
# remove repeats
if short_name.startswith(test_path[-1]):
short_name = short_name[len(test_path[-1]) : ]
# remove suffixes
if short_name.endswith(".dash"):
short_name = short_name[:-5] # Remove .dash suffix.
# now .app suffix discarded at self.IsTest()
#elif short_name.endswith(".app"):
# short_name = short_name[:-4] # Remove .app suffix.
else:
raise Error('Unknown suffix in "%s", fix IsTest() predicate' % f)
while short_name.startswith('_'):
short_name = short_name[1:]
test_path.extend(short_name.split('_'))
# test full name and shorted name matches given path pattern
if self.Contains(path, test_path): pass
elif self.Contains(path, test_path + [test_name]): pass
else:
continue
tests.append(Co19TestCase(test_path,
self.context,
join(root, f),
mode,
arch))
return tests