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
Kirill Smelkov
cython
Commits
87a575a7
Commit
87a575a7
authored
Jun 17, 2011
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow opt-in option '--backends=...' in test runner instead of requiring opt-out '--no-...' options
parent
ca43ebff
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
9 deletions
+24
-9
runtests.py
runtests.py
+24
-9
No files found.
runtests.py
View file @
87a575a7
...
@@ -204,6 +204,8 @@ COMPILER = None
...
@@ -204,6 +204,8 @@ COMPILER = None
INCLUDE_DIRS = [ d for d in os.getenv('INCLUDE', '').split(os.pathsep) if d ]
INCLUDE_DIRS = [ d for d in os.getenv('INCLUDE', '').split(os.pathsep) if d ]
CFLAGS = os.getenv('CFLAGS', '').split()
CFLAGS = os.getenv('CFLAGS', '').split()
BACKENDS = ['c', 'cpp']
def memoize(f):
def memoize(f):
uncomputed = object()
uncomputed = object()
f._cache = {}
f._cache = {}
...
@@ -1248,12 +1250,15 @@ def main():
...
@@ -1248,12 +1250,15 @@ def main():
help="
do
not
run
the
Cython
compiler
,
only
the
C
compiler
")
help="
do
not
run
the
Cython
compiler
,
only
the
C
compiler
")
parser.add_option("
--
compiler
", dest="
compiler
", default=None,
parser.add_option("
--
compiler
", dest="
compiler
", default=None,
help="
C
compiler
type
")
help="
C
compiler
type
")
backend_list = ','.join(BACKENDS)
parser.add_option("
--
backends
", dest="
backends
", default=backend_list,
help="
select
backends
to
test
(
default
:
%
s
)
" % backend_list)
parser.add_option("
--
no
-
c
", dest="
use_c
",
parser.add_option("
--
no
-
c
", dest="
use_c
",
action="
store_false
", default=True,
action="
store_false
", default=True,
help="
do
not
test
C
compilation
")
help="
do
not
test
C
compilation
backend
")
parser.add_option("
--
no
-
cpp
", dest="
use_cpp
",
parser.add_option("
--
no
-
cpp
", dest="
use_cpp
",
action="
store_false
", default=True,
action="
store_false
", default=True,
help="
do
not
test
C
++
compilation
")
help="
do
not
test
C
++
compilation
backend
")
parser.add_option("
--
no
-
unit
", dest="
unittests
",
parser.add_option("
--
no
-
unit
", dest="
unittests
",
action="
store_false
", default=True,
action="
store_false
", default=True,
help="
do
not
run
the
unit
tests
")
help="
do
not
run
the
unit
tests
")
...
@@ -1402,8 +1407,6 @@ def main():
...
@@ -1402,8 +1407,6 @@ def main():
if
WITH_CYTHON
and
options
.
language_level
==
3
:
if
WITH_CYTHON
and
options
.
language_level
==
3
:
sys
.
stderr
.
write
(
"Using Cython language level 3.
\
n
"
)
sys
.
stderr
.
write
(
"Using Cython language level 3.
\
n
"
)
sys
.
stderr
.
write
(
"
\
n
"
)
test_bugs
=
False
test_bugs
=
False
if
options
.
tickets
:
if
options
.
tickets
:
for
ticket_number
in
options
.
tickets
:
for
ticket_number
in
options
.
tickets
:
...
@@ -1438,11 +1441,23 @@ def main():
...
@@ -1438,11 +1441,23 @@ def main():
global
COMPILER
global
COMPILER
if
options
.
compiler
:
if
options
.
compiler
:
COMPILER
=
options
.
compiler
COMPILER
=
options
.
compiler
languages
=
[]
if
options
.
use_c
:
selected_backends
=
[
name
.
strip
()
for
name
in
options
.
backends
.
split
(
','
)
if
name
.
strip
()
]
languages
.
append
(
'c'
)
backends
=
[]
if
options
.
use_cpp
:
for
backend
in
selected_backends
:
languages
.
append
(
'cpp'
)
if
backend
==
'c'
and
not
options
.
use_c
:
continue
elif
backend
==
'cpp'
and
not
options
.
use_cpp
:
continue
elif
backend
not
in
BACKENDS
:
sys
.
stderr
.
write
(
"Unknown backend requested: '%s' not one of [%s]
\
n
"
%
(
backend
,
','
.
join
(
BACKENDS
)))
sys
.
exit
(
1
)
backends
.
append
(
backend
)
sys
.
stderr
.
write
(
"Backends: %s
\
n
"
%
','
.
join
(
backends
))
languages
=
backends
sys
.
stderr
.
write
(
"
\
n
"
)
test_suite
=
unittest
.
TestSuite
()
test_suite
=
unittest
.
TestSuite
()
...
...
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