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
Boxiang Sun
cython
Commits
48901ea3
Commit
48901ea3
authored
Apr 13, 2011
by
Vitja Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtests: add werror tag
parent
2b0c3461
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
runtests.py
runtests.py
+17
-4
No files found.
runtests.py
View file @
48901ea3
...
@@ -290,6 +290,11 @@ class TestBuilder(object):
...
@@ -290,6 +290,11 @@ class TestBuilder(object):
return
suite
return
suite
def
build_tests
(
self
,
test_class
,
path
,
workdir
,
module
,
expect_errors
,
tags
):
def
build_tests
(
self
,
test_class
,
path
,
workdir
,
module
,
expect_errors
,
tags
):
if
'werror'
in
tags
[
'tags'
]:
warning_errors
=
True
else
:
warning_errors
=
False
if
expect_errors
:
if
expect_errors
:
if
'cpp'
in
tags
[
'tag'
]
and
'cpp'
in
self
.
languages
:
if
'cpp'
in
tags
[
'tag'
]
and
'cpp'
in
self
.
languages
:
languages
=
[
'cpp'
]
languages
=
[
'cpp'
]
...
@@ -301,12 +306,12 @@ class TestBuilder(object):
...
@@ -301,12 +306,12 @@ class TestBuilder(object):
languages
=
list
(
languages
)
languages
=
list
(
languages
)
languages
.
remove
(
'c'
)
languages
.
remove
(
'c'
)
tests
=
[
self
.
build_test
(
test_class
,
path
,
workdir
,
module
,
tests
=
[
self
.
build_test
(
test_class
,
path
,
workdir
,
module
,
language
,
expect_errors
)
language
,
expect_errors
,
warning_errors
)
for
language
in
languages
]
for
language
in
languages
]
return
tests
return
tests
def
build_test
(
self
,
test_class
,
path
,
workdir
,
module
,
def
build_test
(
self
,
test_class
,
path
,
workdir
,
module
,
language
,
expect_errors
):
language
,
expect_errors
,
warning_errors
):
workdir
=
os
.
path
.
join
(
workdir
,
language
)
workdir
=
os
.
path
.
join
(
workdir
,
language
)
if
not
os
.
path
.
exists
(
workdir
):
if
not
os
.
path
.
exists
(
workdir
):
os
.
makedirs
(
workdir
)
os
.
makedirs
(
workdir
)
...
@@ -318,13 +323,14 @@ class TestBuilder(object):
...
@@ -318,13 +323,14 @@ class TestBuilder(object):
cleanup_sharedlibs
=
self
.
cleanup_sharedlibs
,
cleanup_sharedlibs
=
self
.
cleanup_sharedlibs
,
cython_only
=
self
.
cython_only
,
cython_only
=
self
.
cython_only
,
fork
=
self
.
fork
,
fork
=
self
.
fork
,
language_level
=
self
.
language_level
)
language_level
=
self
.
language_level
,
warning_errors
=
warning_errors
)
class
CythonCompileTestCase
(
unittest
.
TestCase
):
class
CythonCompileTestCase
(
unittest
.
TestCase
):
def
__init__
(
self
,
test_directory
,
workdir
,
module
,
language
=
'c'
,
def
__init__
(
self
,
test_directory
,
workdir
,
module
,
language
=
'c'
,
expect_errors
=
False
,
annotate
=
False
,
cleanup_workdir
=
True
,
expect_errors
=
False
,
annotate
=
False
,
cleanup_workdir
=
True
,
cleanup_sharedlibs
=
True
,
cython_only
=
False
,
fork
=
True
,
cleanup_sharedlibs
=
True
,
cython_only
=
False
,
fork
=
True
,
language_level
=
2
):
language_level
=
2
,
warning_errors
=
False
):
self
.
test_directory
=
test_directory
self
.
test_directory
=
test_directory
self
.
workdir
=
workdir
self
.
workdir
=
workdir
self
.
module
=
module
self
.
module
=
module
...
@@ -336,16 +342,23 @@ class CythonCompileTestCase(unittest.TestCase):
...
@@ -336,16 +342,23 @@ class CythonCompileTestCase(unittest.TestCase):
self
.
cython_only
=
cython_only
self
.
cython_only
=
cython_only
self
.
fork
=
fork
self
.
fork
=
fork
self
.
language_level
=
language_level
self
.
language_level
=
language_level
self
.
warning_errors
=
warning_errors
unittest
.
TestCase
.
__init__
(
self
)
unittest
.
TestCase
.
__init__
(
self
)
def
shortDescription
(
self
):
def
shortDescription
(
self
):
return
"compiling (%s) %s"
%
(
self
.
language
,
self
.
module
)
return
"compiling (%s) %s"
%
(
self
.
language
,
self
.
module
)
def
setUp
(
self
):
def
setUp
(
self
):
from
Cython.Compiler
import
Options
Options
.
warning_errors
=
self
.
warning_errors
if
self
.
workdir
not
in
sys
.
path
:
if
self
.
workdir
not
in
sys
.
path
:
sys
.
path
.
insert
(
0
,
self
.
workdir
)
sys
.
path
.
insert
(
0
,
self
.
workdir
)
def
tearDown
(
self
):
def
tearDown
(
self
):
from
Cython.Compiler
import
Options
Options
.
warning_errors
=
False
try
:
try
:
sys
.
path
.
remove
(
self
.
workdir
)
sys
.
path
.
remove
(
self
.
workdir
)
except
ValueError
:
except
ValueError
:
...
...
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