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): ...@@ -95,13 +95,19 @@ def find_test_vectors(d):
def main(argv): def main(argv):
submissions_dir = "all-lwc-submission-files" submissions_dir = "all-lwc-submission-files"
template_dir = "templates/linux" template_dir = "templates/linux"
include_list = None
if len(argv) > 1: if len(argv) > 1:
template_dir = 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) print("Using template %s" % template_dir)
subs = os.listdir(submissions_dir) subs = os.listdir(submissions_dir)
# get all the submissions by looking for files named "api.h" # get all the submissions by looking for files named "api.h"
files = [] subfiles = []
for submission in subs: for submission in subs:
implementations_dir = os.path.join(submissions_dir, submission, "Implementations", "crypto_aead") implementations_dir = os.path.join(submissions_dir, submission, "Implementations", "crypto_aead")
...@@ -120,32 +126,45 @@ def main(argv): ...@@ -120,32 +126,45 @@ def main(argv):
for file in f: for file in f:
if file == "api.h": if file == "api.h":
f = os.path.join(r, file) f = os.path.join(r, file)
subfiles.append(f)
c += 1
if c == 0:
raise Exception("No implementations found")
# Source directory d if include_list is not None:
d = os.path.split(f)[0] print("Include list has %d entries" % len(include_list))
assert os.path.isdir(d)
print(d)
# Test vectors file t files = []
t = find_test_vectors(d) for f in subfiles:
print(t)
# base name n # Source directory d
pieces = r.split(os.sep) d = os.path.split(f)[0]
n = submission + "." + ".".join(pieces[4:]) assert os.path.isdir(d)
print(n) print(d)
# Put all in a tuple and count # Test vectors file t
files.append((t, d, n)) t = find_test_vectors(d)
c += 1 print(t)
if c == 0: # base name n
raise Exception("No implementations found") 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 # For testing, we only do the first 1
#files = files[: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 # Clear the build directory as it is a leftover from the previous execution
if os.path.isdir('build'): 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