diff --git a/get_algos.py b/get_algos.py index 3582b2c..84c4ecd 100755 --- a/get_algos.py +++ b/get_algos.py @@ -3,16 +3,22 @@ import os import sys import shutil +import random import subprocess def bench(algo_dir): print(algo_dir) - build_dir = "build" - assets_dir = "assets" - while os.path.isdir(build_dir): - shutil.rmtree(build_dir) + build_dir = None + while build_dir is None: + r = "%09d" % random.randint(0, 999999999) + d = os.path.join("build", r) + if not os.path.isdir(d): + build_dir = d + shutil.copytree(algo_dir, build_dir) + assets_dir = "assets" + hs = os.path.join(assets_dir, "crypto_aead.h") h = os.path.join(build_dir, "crypto_aead.h") shutil.copy(hs, h) @@ -48,7 +54,7 @@ def bench(algo_dir): os.chdir(wd) # shutil.rmtree(build_dir) - exit(0) # stop immediately for now + #exit(0) # stop immediately for now diff --git a/test.py b/test.py index 2b6f373..8b3b59f 100755 --- a/test.py +++ b/test.py @@ -9,7 +9,7 @@ from subprocess import Popen, PIPE def main(argv): - p = Popen(["build/test"], bufsize=0, stdin=PIPE, stdout=PIPE) + p = Popen(argv[1:], bufsize=0, stdin=PIPE, stdout=PIPE) def write(data): l = p.stdin.write(data)