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
6700fe73
Commit
6700fe73
authored
Mar 02, 2015
by
Michael Arntzenius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tester.py: require "# should_error" in tests w/ non-0 exit code
parent
d13518f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
6 deletions
+23
-6
tools/tester.py
tools/tester.py
+23
-6
No files found.
tools/tester.py
View file @
6700fe73
...
...
@@ -126,6 +126,7 @@ def run_test(fn, check_stats, run_memcheck):
jit_args
=
[
"-crq"
]
+
EXTRA_JIT_ARGS
collect_stats
=
True
expected
=
"success"
should_error
=
False
allow_warnings
=
[]
for
l
in
open
(
fn
):
l
=
l
.
strip
()
...
...
@@ -141,6 +142,8 @@ def run_test(fn, check_stats, run_memcheck):
jit_args
+=
l
elif
l
.
startswith
(
"# expected:"
):
expected
=
l
[
len
(
"# expected:"
):].
strip
()
elif
l
.
startswith
(
"# should_error"
):
should_error
=
True
elif
l
.
startswith
(
"# fail-if:"
):
condition
=
l
.
split
(
':'
,
1
)[
1
].
strip
()
if
eval
(
condition
):
...
...
@@ -216,13 +219,27 @@ def run_test(fn, check_stats, run_memcheck):
if
expected
==
"fail"
:
r
+=
" Expected failure (got code %d, should be %d)"
%
(
code
,
expected_code
)
return
r
elif
KEEP_GOING
:
r
+=
"
\
033
[%dmFAILED
\
033
[0m (%s)"
%
(
color
,
msg
)
failed
.
append
(
fn
)
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
,
stderr
))
raise
Exception
(
"%s
\
n
%s
\
n
%s"
%
(
msg
,
err
,
stderr
))
elif
should_error
==
(
code
==
0
):
color
=
31
# red
if
code
==
0
:
msg
=
"Exited successfully; remove '# should_error' if this is expected"
else
:
msg
=
"Exited with code %d; add '# should_error' if this is expected"
%
code
if
KEEP_GOING
:
r
+=
"
\
033
[%dmFAILED
\
033
[0m (%s)"
%
(
color
,
msg
)
failed
.
append
(
fn
)
return
r
else
:
raise
Exception
(
msg
)
elif
out
!=
expected_out
:
if
expected
==
"fail"
:
r
+=
" Expected failure (bad output)"
...
...
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