1
0
forked from Mirror/wren

Update metrics script to new file layout.

This commit is contained in:
Bob Nystrom
2015-03-15 22:07:06 -07:00
parent 287c611260
commit b7081c36b4

View File

@ -26,7 +26,8 @@ num_benchmark_todos = 0
num_benchmark_empty = 0
num_benchmark = 0
files = itertools.chain(glob.iglob("src/*.[ch]"), glob.iglob("include/*.[ch]"))
files = itertools.chain(glob.iglob("src/vm/*.[ch]"),
glob.iglob("src/include/*.[ch]"))
for source_path in files:
num_files += 1
with open(source_path, "r") as input:
@ -68,21 +69,6 @@ for dir_path, dir_names, file_names in os.walk("test"):
num_expects += 1
continue
for dir_path, dir_names, file_names in os.walk("benchmark"):
for file_name in fnmatch.filter(file_names, "*.wren"):
num_benchmark_files += 1
with open(os.path.join(dir_path, file_name), "r") as input:
for line in input:
if (line.strip() == ""):
num_benchmark_empty += 1
else:
num_benchmark += 1
match = TODO_PATTERN.match(line)
if match:
num_benchmark_todos += 1
continue
print("source:")
print(" files " + str(num_files))
print(" semicolons " + str(num_semicolons))