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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
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
Hide 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
INCLUDE_DIRS = [ d for d in os.getenv('INCLUDE', '').split(os.pathsep) if d ]
CFLAGS = os.getenv('CFLAGS', '').split()
BACKENDS = ['c', 'cpp']
def memoize(f):
uncomputed = object()
f._cache = {}
...
...
@@ -1248,12 +1250,15 @@ def main():
help="
do
not
run
the
Cython
compiler
,
only
the
C
compiler
")
parser.add_option("
--
compiler
", dest="
compiler
", default=None,
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
",
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
",
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
",
action="
store_false
", default=True,
help="
do
not
run
the
unit
tests
")
...
...
@@ -1402,8 +1407,6 @@ def main():
if
WITH_CYTHON
and
options
.
language_level
==
3
:
sys
.
stderr
.
write
(
"Using Cython language level 3.
\
n
"
)
sys
.
stderr
.
write
(
"
\
n
"
)
test_bugs
=
False
if
options
.
tickets
:
for
ticket_number
in
options
.
tickets
:
...
...
@@ -1438,11 +1441,23 @@ def main():
global
COMPILER
if
options
.
compiler
:
COMPILER
=
options
.
compiler
languages
=
[]
if
options
.
use_c
:
languages
.
append
(
'c'
)
if
options
.
use_cpp
:
languages
.
append
(
'cpp'
)
selected_backends
=
[
name
.
strip
()
for
name
in
options
.
backends
.
split
(
','
)
if
name
.
strip
()
]
backends
=
[]
for
backend
in
selected_backends
:
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
()
...
...
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