Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
c1a5affd
Commit
c1a5affd
authored
Apr 15, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add 'expected: fail' annotations to tests that are currently failing; tests pass now!
parent
2b4b3737
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
18 deletions
+50
-18
test/tests/listcomp.py
test/tests/listcomp.py
+1
-0
test/tests/listcomp_assigning.py
test/tests/listcomp_assigning.py
+2
-0
test/tests/osr_maybe_undefined.py
test/tests/osr_maybe_undefined.py
+2
-0
test/tests/polymorphism_small.py
test/tests/polymorphism_small.py
+2
-0
tools/tester.py
tools/tester.py
+43
-18
No files found.
test/tests/listcomp.py
View file @
c1a5affd
# expected: fail
print
[(
i
,
j
)
for
i
in
range
(
4
)
for
j
in
range
(
4
)]
print
[(
i
,
j
)
for
i
in
range
(
4
)
for
j
in
range
(
4
)]
...
...
test/tests/listcomp_assigning.py
View file @
c1a5affd
# expected: fail
i
=
"global"
i
=
"global"
def
f
(
n
):
def
f
(
n
):
i
=
"hello"
i
=
"hello"
...
...
test/tests/osr_maybe_undefined.py
View file @
c1a5affd
# expected: fail
# Regression test to make sure we can do an OSR if one of the live variables
# Regression test to make sure we can do an OSR if one of the live variables
# is potentially-undefined.
# is potentially-undefined.
...
...
test/tests/polymorphism_small.py
View file @
c1a5affd
# expected: fail
class
Union
(
object
):
class
Union
(
object
):
def
__init__
(
self
,
subs
):
def
__init__
(
self
,
subs
):
self
.
subs
=
subs
self
.
subs
=
subs
...
...
tools/tester.py
View file @
c1a5affd
...
@@ -68,15 +68,20 @@ def run_test(fn, check_stats, run_memcheck):
...
@@ -68,15 +68,20 @@ def run_test(fn, check_stats, run_memcheck):
statchecks
=
[]
statchecks
=
[]
jit_args
=
[
"-csr"
]
+
EXTRA_JIT_ARGS
jit_args
=
[
"-csr"
]
+
EXTRA_JIT_ARGS
expected
=
"success"
for
l
in
open
(
fn
):
for
l
in
open
(
fn
):
if
not
l
.
startswith
(
"#"
):
if
not
l
.
startswith
(
"#"
):
break
;
break
if
l
.
startswith
(
"# statcheck:"
):
if
l
.
startswith
(
"# statcheck:"
):
l
=
l
[
len
(
"# statcheck:"
):].
strip
()
l
=
l
[
len
(
"# statcheck:"
):].
strip
()
statchecks
.
append
(
l
)
statchecks
.
append
(
l
)
if
l
.
startswith
(
"# run_args:"
):
el
if
l
.
startswith
(
"# run_args:"
):
l
=
l
[
len
(
"# run_args:"
):].
split
()
l
=
l
[
len
(
"# run_args:"
):].
split
()
jit_args
+=
l
jit_args
+=
l
elif
l
.
startswith
(
"# expected:"
):
expected
=
l
[
len
(
"# run_args:"
):].
strip
()
assert
expected
in
(
"success"
,
"fail"
),
expected
run_args
=
[
"./%s"
%
IMAGE
]
+
jit_args
+
[
"-q"
,
fn
]
run_args
=
[
"./%s"
%
IMAGE
]
+
jit_args
+
[
"-q"
,
fn
]
start
=
time
.
time
()
start
=
time
.
time
()
...
@@ -111,27 +116,47 @@ def run_test(fn, check_stats, run_memcheck):
...
@@ -111,27 +116,47 @@ def run_test(fn, check_stats, run_memcheck):
else
:
else
:
msg
=
"Exited with code %d (expected code %d)"
%
(
code
,
expected_code
)
msg
=
"Exited with code %d (expected code %d)"
%
(
code
,
expected_code
)
if
expected
==
"fail"
:
r
+=
" Expected failure (got code %d, should be %d)"
%
(
code
,
expected_code
)
return
r
else
:
if
KEEP_GOING
:
r
+=
"
\
033
[%dmFAILED
\
033
[0m (%s)"
%
(
color
,
msg
)
failed
.
append
(
fn
)
return
r
else
:
raise
Exception
(
"%s
\
n
%s
\
n
%s"
%
(
msg
,
err
,
full_err
))
elif
out
!=
expected_out
:
if
expected
==
"fail"
:
r
+=
" Expected failure (bad output)"
return
r
else
:
if
KEEP_GOING
:
r
+=
"
\
033
[31mFAILED
\
033
[0m (bad output)"
failed
.
append
(
fn
)
return
r
exp_fd
,
exp_fn
=
tempfile
.
mkstemp
()
out_fd
,
out_fn
=
tempfile
.
mkstemp
()
os
.
fdopen
(
exp_fd
,
'w'
).
write
(
expected_out
)
os
.
fdopen
(
out_fd
,
'w'
).
write
(
out
)
p
=
subprocess
.
Popen
([
"diff"
,
"-a"
,
exp_fn
,
out_fn
],
stdout
=
subprocess
.
PIPE
,
preexec_fn
=
set_ulimits
)
diff
=
p
.
stdout
.
read
()
assert
p
.
wait
()
in
(
0
,
1
)
raise
Exception
(
"Failed on %s:
\
n
%s"
%
(
fn
,
diff
))
elif
err
!=
expected_err
:
if
KEEP_GOING
:
if
KEEP_GOING
:
r
+=
"
\
033
[
%dmFAILED
\
033
[0m (%s)"
%
(
color
,
msg
)
r
+=
"
\
033
[
31mFAILED
\
033
[0m (bad stderr)"
failed
.
append
(
fn
)
failed
.
append
(
fn
)
return
r
return
r
else
:
else
:
raise
Exception
(
"%s
\
n
%s
\
n
%s"
%
(
msg
,
err
,
full
_err
))
raise
Exception
(
(
err
,
expected
_err
))
elif
out
!=
expected_out
:
elif
expected
==
"fail"
:
if
KEEP_GOING
:
if
KEEP_GOING
:
r
+=
"
\
033
[31mFAILED
\
033
[0m (
bad output
)"
r
+=
"
\
033
[31mFAILED
\
033
[0m (
unexpected success
)"
failed
.
append
(
fn
)
failed
.
append
(
fn
)
return
r
return
r
exp_fd
,
exp_fn
=
tempfile
.
mkstemp
()
raise
Exception
(
"Unexpected success on %s"
%
fn
)
out_fd
,
out_fn
=
tempfile
.
mkstemp
()
os
.
fdopen
(
exp_fd
,
'w'
).
write
(
expected_out
)
os
.
fdopen
(
out_fd
,
'w'
).
write
(
out
)
p
=
subprocess
.
Popen
([
"diff"
,
"-a"
,
exp_fn
,
out_fn
],
stdout
=
subprocess
.
PIPE
,
preexec_fn
=
set_ulimits
)
diff
=
p
.
stdout
.
read
()
assert
p
.
wait
()
in
(
0
,
1
)
raise
Exception
(
"Failed on %s:
\
n
%s"
%
(
fn
,
diff
))
elif
err
!=
expected_err
:
raise
Exception
((
err
,
expected_err
))
r
+=
" Correct output (%5.1fms)"
%
(
elapsed
*
1000
,)
r
+=
" Correct output (%5.1fms)"
%
(
elapsed
*
1000
,)
if
check_stats
:
if
check_stats
:
...
@@ -270,8 +295,8 @@ if __name__ == "__main__":
...
@@ -270,8 +295,8 @@ if __name__ == "__main__":
nostat
=
functools
.
partial
(
_addto
,
IGNORE_STATS
)
nostat
=
functools
.
partial
(
_addto
,
IGNORE_STATS
)
if
'-O'
in
EXTRA_JIT_ARGS
:
if
'-O'
in
EXTRA_JIT_ARGS
:
# OSR test, doesn't make sense with -O
# OSR test
s
, doesn't make sense with -O
skip
([
"30"
])
skip
([
"30"
,
"listcomp_osr"
])
if
datetime
.
datetime
.
now
()
<
datetime
.
datetime
(
2014
,
4
,
28
):
if
datetime
.
datetime
.
now
()
<
datetime
.
datetime
(
2014
,
4
,
28
):
nostat
([
"nondirectly_callable_ics"
])
# WIP
nostat
([
"nondirectly_callable_ics"
])
# WIP
...
...
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