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
f5e3ddee
Commit
f5e3ddee
authored
Nov 02, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix language level setting in test runner
parent
9b59fa8d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
runtests.py
runtests.py
+10
-7
No files found.
runtests.py
View file @
f5e3ddee
...
...
@@ -117,7 +117,7 @@ class ErrorWriter(object):
class TestBuilder(object):
def __init__(self, rootdir, workdir, selectors, exclude_selectors, annotate,
cleanup_workdir, cleanup_sharedlibs, with_pyregr, cython_only,
languages, test_bugs, fork):
languages, test_bugs, fork
, language_level
):
self.rootdir = rootdir
self.workdir = workdir
self.selectors = selectors
...
...
@@ -130,6 +130,7 @@ class TestBuilder(object):
self.languages = languages
self.test_bugs = test_bugs
self.fork = fork
self.language_level = language_level
def build_suite(self):
suite = unittest.TestSuite()
...
...
@@ -220,12 +221,14 @@ class TestBuilder(object):
cleanup_workdir
=
self
.
cleanup_workdir
,
cleanup_sharedlibs
=
self
.
cleanup_sharedlibs
,
cython_only
=
self
.
cython_only
,
fork
=
self
.
fork
)
fork
=
self
.
fork
,
language_level
=
self
.
language_level
)
class
CythonCompileTestCase
(
unittest
.
TestCase
):
def
__init__
(
self
,
test_directory
,
workdir
,
module
,
language
=
'c'
,
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
):
self
.
test_directory
=
test_directory
self
.
workdir
=
workdir
self
.
module
=
module
...
...
@@ -236,6 +239,7 @@ class CythonCompileTestCase(unittest.TestCase):
self
.
cleanup_sharedlibs
=
cleanup_sharedlibs
self
.
cython_only
=
cython_only
self
.
fork
=
fork
self
.
language_level
=
language_level
unittest
.
TestCase
.
__init__
(
self
)
def
shortDescription
(
self
):
...
...
@@ -339,6 +343,7 @@ class CythonCompileTestCase(unittest.TestCase):
annotate
=
annotate
,
use_listing_file
=
False
,
cplus
=
self
.
language
==
'cpp'
,
language_level
=
self
.
language_level
,
generate_pxi
=
False
,
evaluate_tree_assertions
=
True
,
)
...
...
@@ -944,8 +949,6 @@ if __name__ == '__main__':
if
WITH_CYTHON
and
options
.
language_level
==
3
:
sys
.
stderr
.
write
(
"Using Cython language level 3.
\
n
"
)
from
Cython.Compiler
import
Options
Options
.
directive_defaults
[
'language_level'
]
=
3
sys
.
stderr
.
write
(
"
\
n
"
)
...
...
@@ -999,7 +1002,7 @@ if __name__ == '__main__':
options
.
annotate_source
,
options
.
cleanup_workdir
,
options
.
cleanup_sharedlibs
,
options
.
pyregr
,
options
.
cython_only
,
languages
,
test_bugs
,
options
.
fork
)
options
.
fork
,
options
.
language_level
)
test_suite
.
addTest
(
filetests
.
build_suite
())
if
options
.
system_pyregr
and
languages
:
...
...
@@ -1007,7 +1010,7 @@ if __name__ == '__main__':
options
.
annotate_source
,
options
.
cleanup_workdir
,
options
.
cleanup_sharedlibs
,
True
,
options
.
cython_only
,
languages
,
test_bugs
,
options
.
fork
)
options
.
fork
,
options
.
language_level
)
test_suite
.
addTest
(
filetests
.
handle_directory
(
os
.
path
.
join
(
sys
.
prefix
,
'lib'
,
'python'
+
sys
.
version
[:
3
],
'test'
),
...
...
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