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
8b25abbb
Commit
8b25abbb
authored
Jul 18, 2008
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add --no-cleanup-sharedlibs to test script
parent
90f19619
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
runtests.py
runtests.py
+14
-4
No files found.
runtests.py
View file @
8b25abbb
...
@@ -45,12 +45,13 @@ class ErrorWriter(object):
...
@@ -45,12 +45,13 @@ class ErrorWriter(object):
return
self
.
_collect
(
True
,
True
)
return
self
.
_collect
(
True
,
True
)
class
TestBuilder
(
object
):
class
TestBuilder
(
object
):
def
__init__
(
self
,
rootdir
,
workdir
,
selectors
,
annotate
,
cleanup_workdir
):
def
__init__
(
self
,
rootdir
,
workdir
,
selectors
,
annotate
,
cleanup_workdir
,
cleanup_sharedlibs
):
self
.
rootdir
=
rootdir
self
.
rootdir
=
rootdir
self
.
workdir
=
workdir
self
.
workdir
=
workdir
self
.
selectors
=
selectors
self
.
selectors
=
selectors
self
.
annotate
=
annotate
self
.
annotate
=
annotate
self
.
cleanup_workdir
=
cleanup_workdir
self
.
cleanup_workdir
=
cleanup_workdir
self
.
cleanup_sharedlibs
=
cleanup_sharedlibs
def
build_suite
(
self
):
def
build_suite
(
self
):
suite
=
unittest
.
TestSuite
()
suite
=
unittest
.
TestSuite
()
...
@@ -101,13 +102,15 @@ class TestBuilder(object):
...
@@ -101,13 +102,15 @@ class TestBuilder(object):
path
,
workdir
,
module
,
path
,
workdir
,
module
,
expect_errors
=
expect_errors
,
expect_errors
=
expect_errors
,
annotate
=
self
.
annotate
,
annotate
=
self
.
annotate
,
cleanup_workdir
=
self
.
cleanup_workdir
)
cleanup_workdir
=
self
.
cleanup_workdir
,
cleanup_sharedlibs
=
self
.
cleanup_sharedlibs
)
suite
.
addTest
(
test
)
suite
.
addTest
(
test
)
return
suite
return
suite
class
CythonCompileTestCase
(
unittest
.
TestCase
):
class
CythonCompileTestCase
(
unittest
.
TestCase
):
def
__init__
(
self
,
directory
,
workdir
,
module
,
def
__init__
(
self
,
directory
,
workdir
,
module
,
expect_errors
=
False
,
annotate
=
False
,
cleanup_workdir
=
True
):
expect_errors
=
False
,
annotate
=
False
,
cleanup_workdir
=
True
,
cleanup_sharedlibs
=
True
):
self
.
directory
=
directory
self
.
directory
=
directory
self
.
workdir
=
workdir
self
.
workdir
=
workdir
self
.
module
=
module
self
.
module
=
module
...
@@ -121,10 +124,13 @@ class CythonCompileTestCase(unittest.TestCase):
...
@@ -121,10 +124,13 @@ class CythonCompileTestCase(unittest.TestCase):
def
tearDown
(
self
):
def
tearDown
(
self
):
cleanup_c_files
=
WITH_CYTHON
and
self
.
cleanup_workdir
cleanup_c_files
=
WITH_CYTHON
and
self
.
cleanup_workdir
cleanup_lib_files
=
self
.
cleanup_sharedlibs
if
os
.
path
.
exists
(
self
.
workdir
):
if
os
.
path
.
exists
(
self
.
workdir
):
for
rmfile
in
os
.
listdir
(
self
.
workdir
):
for
rmfile
in
os
.
listdir
(
self
.
workdir
):
if
not
cleanup_c_files
and
rmfile
[
-
2
:]
in
(
".c"
,
".h"
):
if
not
cleanup_c_files
and
rmfile
[
-
2
:]
in
(
".c"
,
".h"
):
continue
continue
if
not
cleanup_lib_files
and
rmfile
.
endswith
(
".so"
)
or
rmfile
.
endswith
(
".dll"
):
continue
if
self
.
annotate
and
rmfile
.
endswith
(
".html"
):
if
self
.
annotate
and
rmfile
.
endswith
(
".html"
):
continue
continue
try
:
try
:
...
@@ -303,6 +309,9 @@ if __name__ == '__main__':
...
@@ -303,6 +309,9 @@ if __name__ == '__main__':
parser
.
add_option
(
"--no-cleanup"
,
dest
=
"cleanup_workdir"
,
parser
.
add_option
(
"--no-cleanup"
,
dest
=
"cleanup_workdir"
,
action
=
"store_false"
,
default
=
True
,
action
=
"store_false"
,
default
=
True
,
help
=
"do not delete the generated C files (allows passing --no-cython on next run)"
)
help
=
"do not delete the generated C files (allows passing --no-cython on next run)"
)
parser
.
add_option
(
"--no-cleanup-sharedlibs"
,
dest
=
"cleanup_sharedlibs"
,
action
=
"store_false"
,
default
=
True
,
help
=
"do not delete the generated shared libary files (allows manual module experimentation)"
)
parser
.
add_option
(
"--no-cython"
,
dest
=
"with_cython"
,
parser
.
add_option
(
"--no-cython"
,
dest
=
"with_cython"
,
action
=
"store_false"
,
default
=
True
,
action
=
"store_false"
,
default
=
True
,
help
=
"do not run the Cython compiler, only the C compiler"
)
help
=
"do not run the Cython compiler, only the C compiler"
)
...
@@ -368,7 +377,8 @@ if __name__ == '__main__':
...
@@ -368,7 +377,8 @@ if __name__ == '__main__':
if
options
.
filetests
:
if
options
.
filetests
:
filetests
=
TestBuilder
(
ROOTDIR
,
WORKDIR
,
selectors
,
filetests
=
TestBuilder
(
ROOTDIR
,
WORKDIR
,
selectors
,
options
.
annotate_source
,
options
.
cleanup_workdir
)
options
.
annotate_source
,
options
.
cleanup_workdir
,
options
.
cleanup_sharedlibs
)
test_suite
.
addTests
(
filetests
.
build_suite
())
test_suite
.
addTests
(
filetests
.
build_suite
())
unittest
.
TextTestRunner
(
verbosity
=
options
.
verbosity
).
run
(
test_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