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
5d9bb12b
Commit
5d9bb12b
authored
Nov 03, 2009
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optional forking in runtests.py
parent
ac24781e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
runtests.py
runtests.py
+14
-6
No files found.
runtests.py
View file @
5d9bb12b
...
...
@@ -99,7 +99,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
):
languages
,
test_bugs
,
fork
):
self
.
rootdir
=
rootdir
self
.
workdir
=
workdir
self
.
selectors
=
selectors
...
...
@@ -111,6 +111,7 @@ class TestBuilder(object):
self
.
cython_only
=
cython_only
self
.
languages
=
languages
self
.
test_bugs
=
test_bugs
self
.
fork
=
fork
def
build_suite
(
self
):
suite
=
unittest
.
TestSuite
()
...
...
@@ -192,12 +193,13 @@ class TestBuilder(object):
annotate
=
self
.
annotate
,
cleanup_workdir
=
self
.
cleanup_workdir
,
cleanup_sharedlibs
=
self
.
cleanup_sharedlibs
,
cython_only
=
self
.
cython_only
)
cython_only
=
self
.
cython_only
,
fork
=
self
.
fork
)
class
CythonCompileTestCase
(
unittest
.
TestCase
):
def
__init__
(
self
,
directory
,
workdir
,
module
,
language
=
'c'
,
expect_errors
=
False
,
annotate
=
False
,
cleanup_workdir
=
True
,
cleanup_sharedlibs
=
True
,
cython_only
=
False
):
cleanup_sharedlibs
=
True
,
cython_only
=
False
,
fork
=
True
):
self
.
directory
=
directory
self
.
workdir
=
workdir
self
.
module
=
module
...
...
@@ -207,6 +209,7 @@ class CythonCompileTestCase(unittest.TestCase):
self
.
cleanup_workdir
=
cleanup_workdir
self
.
cleanup_sharedlibs
=
cleanup_sharedlibs
self
.
cython_only
=
cython_only
self
.
fork
=
fork
unittest
.
TestCase
.
__init__
(
self
)
def
shortDescription
(
self
):
...
...
@@ -391,7 +394,7 @@ class CythonRunTestCase(CythonCompileTestCase):
pass
def
run_doctests
(
self
,
module_name
,
result
):
if
sys
.
version_info
[
0
]
>=
3
or
not
hasattr
(
os
,
'fork'
):
if
sys
.
version_info
[
0
]
>=
3
or
not
hasattr
(
os
,
'fork'
)
or
not
self
.
fork
:
doctest
.
DocTestSuite
(
module_name
).
run
(
result
)
return
...
...
@@ -663,6 +666,9 @@ if __name__ == '__main__':
parser
.
add_option
(
"--no-refnanny"
,
dest
=
"with_refnanny"
,
action
=
"store_false"
,
default
=
True
,
help
=
"do not regression test reference counting"
)
parser
.
add_option
(
"--no-fork"
,
dest
=
"fork"
,
action
=
"store_false"
,
default
=
True
,
help
=
"do not fork to run tests"
)
parser
.
add_option
(
"--sys-pyregr"
,
dest
=
"system_pyregr"
,
action
=
"store_true"
,
default
=
False
,
help
=
"run the regression tests of the CPython installation"
)
...
...
@@ -814,14 +820,16 @@ if __name__ == '__main__':
filetests
=
TestBuilder
(
ROOTDIR
,
WORKDIR
,
selectors
,
exclude_selectors
,
options
.
annotate_source
,
options
.
cleanup_workdir
,
options
.
cleanup_sharedlibs
,
options
.
pyregr
,
options
.
cython_only
,
languages
,
test_bugs
)
options
.
cython_only
,
languages
,
test_bugs
,
options
.
fork
)
test_suite
.
addTest
(
filetests
.
build_suite
())
if
options
.
system_pyregr
and
languages
:
filetests
=
TestBuilder
(
ROOTDIR
,
WORKDIR
,
selectors
,
exclude_selectors
,
options
.
annotate_source
,
options
.
cleanup_workdir
,
options
.
cleanup_sharedlibs
,
True
,
options
.
cython_only
,
languages
,
test_bugs
)
options
.
cython_only
,
languages
,
test_bugs
,
options
.
fork
)
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