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
64dd645a
authored
5 years ago
by
Enrico Pozzobon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sane build names
parent
519db3c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
compile_all.py
+19
-7
No files found.
compile_all.py
View file @
64dd645a
...
...
@@ -8,9 +8,8 @@ import random
import
subprocess
def
build
(
algo_dir
,
template_dir
):
def
build
(
algo_dir
,
template_dir
,
build_dir
):
# create a new directory for the build
build_dir
=
None
while
build_dir
is
None
:
r
=
"
%09
d"
%
random
.
randint
(
0
,
999999999
)
d
=
os
.
path
.
join
(
"build"
,
r
)
...
...
@@ -121,12 +120,23 @@ def main(argv):
for
file
in
f
:
if
file
==
"api.h"
:
f
=
os
.
path
.
join
(
r
,
file
)
# Source directory d
d
=
os
.
path
.
split
(
f
)[
0
]
assert
os
.
path
.
isdir
(
d
)
print
(
d
)
# Test vectors file t
t
=
find_test_vectors
(
d
)
print
(
t
)
files
.
append
((
t
,
d
))
# base name n
pieces
=
r
.
split
(
os
.
sep
)
n
=
submission
+
"."
+
"."
.
join
(
pieces
[
4
:])
print
(
n
)
# Put all in a tuple and count
files
.
append
((
t
,
d
,
n
))
c
+=
1
if
c
==
0
:
...
...
@@ -150,12 +160,13 @@ def main(argv):
test_script
.
write
(
"#!/bin/sh
\n
"
)
test_script
.
write
(
"mkdir -p logs
\n
"
)
test_script
.
write
(
"mkdir -p measurements
\n
"
)
for
t
,
d
in
files
:
for
i
,
(
t
,
d
,
name
)
in
enumerate
(
files
)
:
print
()
print
(
d
)
try
:
b
=
build
(
d
,
template_dir
)
test_script
.
write
(
"echo
\"
TESTING
%
s
\"\n
"
%
d
)
build_dir
=
os
.
path
.
join
(
"build"
,
name
)
b
=
build
(
d
,
template_dir
,
build_dir
)
test_script
.
write
(
"
\n\n
echo
\"
TEST NUMBER
%03
d: TESTING
%
s
\"\n
"
%
(
i
,
d
))
test_script
.
write
(
"python3 -u ./test.py
%
s
%
s 2>
%
s | tee
%
s
\n
"
%
(
t
,
os
.
path
.
join
(
b
,
'test'
),
...
...
@@ -164,8 +175,9 @@ def main(argv):
)
print
(
"COMPILATION SUCCESS FOR
%
s"
%
d
)
except
Exception
:
except
Exception
as
ex
:
print
(
"COMPILATION FAILED FOR
%
s"
%
d
)
print
(
ex
)
st
=
os
.
stat
(
test_script_path
)
os
.
chmod
(
test_script_path
,
st
.
st_mode
|
stat
.
S_IEXEC
)
...
...
This diff is collapsed.
Click to expand it.
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