Commit c3ec46da by Enrico Pozzobon

compile all has now an argument for choosing which tests to perform

parent 04c5f18d
......@@ -95,13 +95,19 @@ def find_test_vectors(d):
def main(argv):
submissions_dir = "all-lwc-submission-files"
template_dir = "templates/linux"
include_list = None
if len(argv) > 1:
template_dir = argv[1]
if len(argv) > 2:
with open(argv[2], 'r') as includes:
include_list = []
for line in includes.readlines():
include_list.append(line.strip())
print("Using template %s" % template_dir)
subs = os.listdir(submissions_dir)
# get all the submissions by looking for files named "api.h"
files = []
subfiles = []
for submission in subs:
implementations_dir = os.path.join(submissions_dir, submission, "Implementations", "crypto_aead")
......@@ -120,32 +126,45 @@ def main(argv):
for file in f:
if file == "api.h":
f = os.path.join(r, file)
subfiles.append(f)
c += 1
if c == 0:
raise Exception("No implementations found")
# Source directory d
d = os.path.split(f)[0]
assert os.path.isdir(d)
print(d)
if include_list is not None:
print("Include list has %d entries" % len(include_list))
# Test vectors file t
t = find_test_vectors(d)
print(t)
files = []
for f in subfiles:
# base name n
pieces = r.split(os.sep)
n = submission + "." + ".".join(pieces[4:])
print(n)
# Source directory d
d = os.path.split(f)[0]
assert os.path.isdir(d)
print(d)
# Put all in a tuple and count
files.append((t, d, n))
c += 1
# Test vectors file t
t = find_test_vectors(d)
print(t)
if c == 0:
raise Exception("No implementations found")
# base name n
pieces = f.split(os.sep)
n = pieces[1] + "." + ".".join(pieces[4:-1])
print(n)
# if include_list was provided, skip elements not in the list
if include_list is not None:
if not n in include_list:
continue
# Put all in a tuple and count
files.append((t, d, n))
# For testing, we only do the first 1
#files = files[:1]
print("%d algorithms will be compiled" % len(files))
# Clear the build directory as it is a leftover from the previous execution
if os.path.isdir('build'):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment