Commit 8acb6b8c by Enrico Pozzobon

randomized build dirs

parent 709e173a
...@@ -3,16 +3,22 @@ ...@@ -3,16 +3,22 @@
import os import os
import sys import sys
import shutil import shutil
import random
import subprocess import subprocess
def bench(algo_dir): def bench(algo_dir):
print(algo_dir) print(algo_dir)
build_dir = "build" build_dir = None
assets_dir = "assets" while build_dir is None:
while os.path.isdir(build_dir): r = "%09d" % random.randint(0, 999999999)
shutil.rmtree(build_dir) d = os.path.join("build", r)
if not os.path.isdir(d):
build_dir = d
shutil.copytree(algo_dir, build_dir) shutil.copytree(algo_dir, build_dir)
assets_dir = "assets"
hs = os.path.join(assets_dir, "crypto_aead.h") hs = os.path.join(assets_dir, "crypto_aead.h")
h = os.path.join(build_dir, "crypto_aead.h") h = os.path.join(build_dir, "crypto_aead.h")
shutil.copy(hs, h) shutil.copy(hs, h)
...@@ -48,7 +54,7 @@ def bench(algo_dir): ...@@ -48,7 +54,7 @@ def bench(algo_dir):
os.chdir(wd) os.chdir(wd)
# shutil.rmtree(build_dir) # 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 ...@@ -9,7 +9,7 @@ from subprocess import Popen, PIPE
def main(argv): 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): def write(data):
l = p.stdin.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