Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lwc
/
compare
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Pipelines
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8acb6b8c
authored
Jul 03, 2019
by
Enrico Pozzobon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
randomized build dirs
parent
709e173a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
get_algos.py
+11
-5
test.py
+1
-1
No files found.
get_algos.py
View file @
8acb6b8c
...
...
@@ -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
=
"
%09
d"
%
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
...
...
test.py
View file @
8acb6b8c
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment