Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
4e2592b0
Commit
4e2592b0
authored
May 29, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable warning output in tests (currently unused)
parent
24635506
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
runtests.py
runtests.py
+19
-6
No files found.
runtests.py
View file @
4e2592b0
...
...
@@ -17,20 +17,31 @@ CFLAGS = os.getenv('CFLAGS', '').split()
class
ErrorWriter
(
object
):
match_error
=
re
.
compile
(
'(?:.*:)?([-0-9]+):([-0-9]+):(.*)'
).
match
match_error
=
re
.
compile
(
'(
warning:)?(
?:.*:)?([-0-9]+):([-0-9]+):(.*)'
).
match
def
__init__
(
self
):
self
.
output
=
[]
self
.
write
=
self
.
output
.
append
def
geterrors
(
self
):
def
_collect
(
self
,
collect_errors
,
collect_warnings
):
s
=
''
.
join
(
self
.
output
)
errors
=
[]
result
=
[]
for
line
in
s
.
split
(
'
\
n
'
):
match
=
self
.
match_error
(
line
)
if
match
:
line
,
column
,
message
=
match
.
groups
()
errors
.
append
(
"%d:%d:%s"
%
(
int
(
line
),
int
(
column
),
message
.
strip
())
)
return
errors
is_warning
,
line
,
column
,
message
=
match
.
groups
()
if
(
is_warning
and
collect_warnings
)
or
\
(
not
is_warning
and
collect_errors
):
result
.
append
(
"%d:%d:%s"
%
(
int
(
line
),
int
(
column
),
message
.
strip
())
)
return
result
def
geterrors
(
self
):
return
self
.
_collect
(
True
,
False
)
def
getwarnings
(
self
):
return
self
.
_collect
(
False
,
True
)
def
getall
(
self
):
return
self
.
_collect
(
True
,
True
)
class
TestBuilder
(
object
):
def
__init__
(
self
,
rootdir
,
workdir
,
selectors
,
annotate
,
cleanup_workdir
):
...
...
@@ -259,6 +270,8 @@ if __name__ == '__main__':
CompilationOptions
,
\
default_options
as
pyrex_default_options
,
\
compile
as
cython_compile
from
Cython.Compiler
import
Errors
Errors
.
LEVEL
=
0
# show all warnings
# RUN ALL TESTS!
ROOTDIR
=
os
.
path
.
join
(
os
.
getcwd
(),
os
.
path
.
dirname
(
sys
.
argv
[
0
]),
'tests'
)
...
...
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