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
1192e11d
Commit
1192e11d
authored
Aug 13, 2008
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added --cython-only switch to runtests.py
parent
a19e36ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
runtests.py
runtests.py
+17
-8
No files found.
runtests.py
View file @
1192e11d
...
...
@@ -46,7 +46,7 @@ class ErrorWriter(object):
class
TestBuilder
(
object
):
def
__init__
(
self
,
rootdir
,
workdir
,
selectors
,
annotate
,
cleanup_workdir
,
cleanup_sharedlibs
,
with_pyregr
):
cleanup_workdir
,
cleanup_sharedlibs
,
with_pyregr
,
cythononly
):
self
.
rootdir
=
rootdir
self
.
workdir
=
workdir
self
.
selectors
=
selectors
...
...
@@ -54,6 +54,7 @@ class TestBuilder(object):
self
.
cleanup_workdir
=
cleanup_workdir
self
.
cleanup_sharedlibs
=
cleanup_sharedlibs
self
.
with_pyregr
=
with_pyregr
self
.
cythononly
=
cythononly
def
build_suite
(
self
):
suite
=
unittest
.
TestSuite
()
...
...
@@ -102,21 +103,23 @@ class TestBuilder(object):
path
,
workdir
,
module
,
annotate
=
self
.
annotate
,
cleanup_workdir
=
self
.
cleanup_workdir
,
cleanup_sharedlibs
=
self
.
cleanup_sharedlibs
)
cleanup_sharedlibs
=
self
.
cleanup_sharedlibs
,
cythononly
=
self
.
cythononly
)
else
:
test
=
CythonCompileTestCase
(
path
,
workdir
,
module
,
expect_errors
=
expect_errors
,
annotate
=
self
.
annotate
,
cleanup_workdir
=
self
.
cleanup_workdir
,
cleanup_sharedlibs
=
self
.
cleanup_sharedlibs
)
cleanup_sharedlibs
=
self
.
cleanup_sharedlibs
,
cythononly
=
self
.
cythononly
)
suite
.
addTest
(
test
)
return
suite
class
CythonCompileTestCase
(
unittest
.
TestCase
):
def
__init__
(
self
,
directory
,
workdir
,
module
,
expect_errors
=
False
,
annotate
=
False
,
cleanup_workdir
=
True
,
cleanup_sharedlibs
=
True
):
cleanup_sharedlibs
=
True
,
cythononly
=
False
):
self
.
directory
=
directory
self
.
workdir
=
workdir
self
.
module
=
module
...
...
@@ -124,6 +127,7 @@ class CythonCompileTestCase(unittest.TestCase):
self
.
annotate
=
annotate
self
.
cleanup_workdir
=
cleanup_workdir
self
.
cleanup_sharedlibs
=
cleanup_sharedlibs
self
.
cythononly
=
cythononly
unittest
.
TestCase
.
__init__
(
self
)
def
shortDescription
(
self
):
...
...
@@ -247,7 +251,8 @@ class CythonCompileTestCase(unittest.TestCase):
unexpected_error
=
errors
[
len
(
expected_errors
)]
self
.
assertEquals
(
None
,
unexpected_error
)
else
:
self
.
run_distutils
(
module
,
workdir
,
incdir
)
if
not
self
.
cythononly
:
self
.
run_distutils
(
module
,
workdir
,
incdir
)
class
CythonRunTestCase
(
CythonCompileTestCase
):
def
shortDescription
(
self
):
...
...
@@ -259,7 +264,8 @@ class CythonRunTestCase(CythonCompileTestCase):
result
.
startTest
(
self
)
try
:
self
.
runCompileTest
()
doctest
.
DocTestSuite
(
self
.
module
).
run
(
result
)
if
not
self
.
cythononly
:
doctest
.
DocTestSuite
(
self
.
module
).
run
(
result
)
except
Exception
:
result
.
addError
(
self
,
sys
.
exc_info
())
result
.
stopTest
(
self
)
...
...
@@ -370,7 +376,10 @@ if __name__ == '__main__':
help
=
"do not run the file based tests"
)
parser
.
add_option
(
"--no-pyregr"
,
dest
=
"pyregr"
,
action
=
"store_false"
,
default
=
True
,
help
=
"do not run the regression tests of CPython in tests/pyregr/"
)
help
=
"do not run the regression tests of CPython in tests/pyregr/"
)
parser
.
add_option
(
"--cython-only"
,
dest
=
"cythononly"
,
action
=
"store_true"
,
default
=
False
,
help
=
"only compile pyx to c, do not run C compiler or run the tests"
)
parser
.
add_option
(
"-C"
,
"--coverage"
,
dest
=
"coverage"
,
action
=
"store_true"
,
default
=
False
,
help
=
"collect source coverage data for the Compiler"
)
...
...
@@ -433,7 +442,7 @@ if __name__ == '__main__':
if
options
.
filetests
:
filetests
=
TestBuilder
(
ROOTDIR
,
WORKDIR
,
selectors
,
options
.
annotate_source
,
options
.
cleanup_workdir
,
options
.
cleanup_sharedlibs
,
options
.
pyregr
)
options
.
cleanup_sharedlibs
,
options
.
pyregr
,
options
.
cythononly
)
test_suite
.
addTests
([
filetests
.
build_suite
()])
unittest
.
TextTestRunner
(
verbosity
=
options
.
verbosity
).
run
(
test_suite
)
...
...
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