Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sven Gestegård Robertz
LabComm
Commits
dadd6d29
Commit
dadd6d29
authored
Mar 30, 2014
by
Sven Gestegård Robertz
Browse files
Merge branch 'voidtest'
parents
9ca60152
e86fc9b2
Changes
22
Hide whitespace changes
Inline
Side-by-side
test/relay_gen_java.py
View file @
dadd6d29
...
...
@@ -16,7 +16,7 @@ if __name__ == '__main__':
f
=
open
(
sys
.
argv
[
1
])
sample
=
[]
for
l
in
map
(
lambda
s
:
s
.
strip
(),
f
):
lang
,
kind
,
func
,
arg
=
l
[
1
:].
split
(
l
[
0
])
lang
,
kind
,
func
,
arg
,
dummy
=
l
[
1
:].
split
(
l
[
0
])
if
lang
==
'Java'
and
kind
==
'sample'
:
sample
.
append
((
func
,
arg
))
pass
...
...
test/test_errors.py
0 → 100755
View file @
dadd6d29
#!/usr/bin/python
import
sys
import
argparse
import
subprocess
# returns true if test fails
def
test_labcomm_compile_OK
(
lc
,
args
):
cmd
=
args
.
labcomm
.
split
()
+
[
lc
]
try
:
res
=
subprocess
.
check_call
(
cmd
)
print
"sucess!"
return
False
except
subprocess
.
CalledProcessError
as
ex
:
print
ex
.
output
print
ex
.
returncode
return
True
def
test_labcomm_compile_fail
(
lc
,
args
):
cmd
=
args
.
labcomm
.
split
()
+
[
lc
]
try
:
res
=
subprocess
.
check_call
(
cmd
)
print
"failed! (should have produced an error)"
return
True
except
subprocess
.
CalledProcessError
as
ex
:
print
"sucess!"
print
ex
.
output
print
ex
.
returncode
return
False
;
if
__name__
==
'__main__'
:
parser
=
argparse
.
ArgumentParser
(
description
=
'Run test of error messages.'
)
parser
.
add_argument
(
'--labcomm'
);
parser
.
add_argument
(
'--testOK'
,
nargs
=
'*'
,
default
=
[])
parser
.
add_argument
(
'--testNOK'
,
nargs
=
'*'
,
default
=
[])
args
=
parser
.
parse_args
()
fail
=
False
;
for
test
in
args
.
testOK
:
fail
=
fail
or
test_labcomm_compile_OK
(
test
,
args
)
pass
for
test
in
args
.
testNOK
:
fail
=
fail
or
test_labcomm_compile_fail
(
test
,
args
)
pass
if
fail
:
print
"*** fail ***"
else
:
print
"*** success ***"
Prev
1
2
Next
Write
Preview
Supports
Markdown
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