-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfind_all_files.py
28 lines (21 loc) · 1.02 KB
/
find_all_files.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import os
import argparse
parser = argparse.ArgumentParser(
description='Collects a list of all posible tests, ignoring the directories mentioned in README.md'
)
parser.add_argument('--directory', help='The path to the non-incremental directory', default='..')
parser.add_argument('--output', '-o', help='The output file', default='all-ufnia-files.txt')
parser.add_argument('--ignored-dirs', nargs='*',
default=['vcc-havoc', 'full', 'partial', 'qf'],
help='Subdirectories to ignore')
args = parser.parse_args()
with open(args.output, 'w') as f:
# Walk though all the possible files, use absolute path
for root, dirs, files in os.walk(os.path.abspath(args.directory)):
for file in files:
if str(file).endswith('.smt2') or str(file).endswith('.smttc'):
f.write(os.path.join(root,file) + '\n')
# Ignore skipped directories
for ignored in args.ignored_dirs:
if ignored in dirs:
dirs.remove(ignored)