Commit a30e8696 authored by Christian Dietrich's avatar Christian Dietrich
Browse files

run-tests: directories as arguments

From now on, directories are also possible as arguments.
parent 899f47ca
......@@ -336,15 +336,22 @@ def usage():
print "%s [-c] [-t threads] [-q] [-v] [test-cases...]" % sys.argv[0]
print " if no test-cases are given, all in current directory are run"
def get_testcases():
def get_testcases(paths = ["."]):
all_files = []
for root, subFolders, files in os.walk("."):
for file in files:
path = os.path.join(root, file)
if fnmatch.fnmatch(path, testcase_pattern) and not "var.c" in file:
for path in paths:
if os.path.isfile(path):
for root, subFolders, files in os.walk(path):
for file in files:
path = os.path.join(root, file)
ret = []
for fn in all_files:
if fnmatch.fnmatch(fn, testcase_pattern) and not "var.c" in fn:
return sorted(all_files)
return sorted(ret)
if __name__ == '__main__':
opts, args = getopt.getopt(sys.argv[1:], "ht:qcv")
......@@ -373,10 +380,7 @@ if __name__ == '__main__':
print "unkown option"
assert False
if len(args) > 0:
ret = run_test_suite(args)
ret = run_test_suite(get_testcases())
ret = run_test_suite(get_testcases(args))
if ret:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment