Commit 8acb6b8c by Enrico Pozzobon

randomized build dirs

parent 709e173a
......@@ -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
......
......@@ -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)
......
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