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
Gwenaël Samain
cython
Commits
a663be97
Commit
a663be97
authored
Sep 01, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes for C++ test runs
parent
50cef2fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
4 deletions
+23
-4
runtests.py
runtests.py
+23
-4
No files found.
runtests.py
View file @
a663be97
...
...
@@ -85,8 +85,6 @@ class TestBuilder(object):
workdir
=
os
.
path
.
join
(
self
.
workdir
,
context
)
if
not
os
.
path
.
exists
(
workdir
):
os
.
makedirs
(
workdir
)
if
workdir
not
in
sys
.
path
:
sys
.
path
.
insert
(
0
,
workdir
)
expect_errors
=
(
context
==
'errors'
)
suite
=
unittest
.
TestSuite
()
...
...
@@ -126,6 +124,9 @@ class TestBuilder(object):
def
build_test
(
self
,
test_class
,
path
,
workdir
,
module
,
language
,
expect_errors
):
workdir
=
os
.
path
.
join
(
workdir
,
language
)
if
not
os
.
path
.
exists
(
workdir
):
os
.
makedirs
(
workdir
)
return
test_class
(
path
,
workdir
,
module
,
language
=
language
,
expect_errors
=
expect_errors
,
...
...
@@ -152,7 +153,19 @@ class CythonCompileTestCase(unittest.TestCase):
def
shortDescription
(
self
):
return
"compiling (%s) %s"
%
(
self
.
language
,
self
.
module
)
def
setUp
(
self
):
if
self
.
workdir
not
in
sys
.
path
:
sys
.
path
.
insert
(
0
,
self
.
workdir
)
def
tearDown
(
self
):
try
:
sys
.
path
.
remove
(
self
.
workdir
)
except
ValueError
:
pass
try
:
del
sys
.
modules
[
self
.
module
]
except
KeyError
:
pass
cleanup_c_files
=
WITH_CYTHON
and
self
.
cleanup_workdir
cleanup_lib_files
=
self
.
cleanup_sharedlibs
if
os
.
path
.
exists
(
self
.
workdir
):
...
...
@@ -187,6 +200,10 @@ class CythonCompileTestCase(unittest.TestCase):
source_file
=
source_file
[:
-
1
]
return
source_file
def
build_target_filename
(
self
,
module_name
):
target
=
'%s.%s'
%
(
module_name
,
self
.
language
)
return
target
def
split_source_and_output
(
self
,
directory
,
module
,
workdir
):
source_file
=
os
.
path
.
join
(
directory
,
module
)
+
'.pyx'
source_and_output
=
open
(
...
...
@@ -212,7 +229,7 @@ class CythonCompileTestCase(unittest.TestCase):
include_dirs
.
append
(
incdir
)
source
=
self
.
find_module_source_file
(
os
.
path
.
join
(
directory
,
module
+
'.pyx'
))
target
=
os
.
path
.
join
(
targetdir
,
module
+
'.'
+
self
.
language
)
target
=
os
.
path
.
join
(
targetdir
,
self
.
build_target_filename
(
module
)
)
options
=
CompilationOptions
(
pyrex_default_options
,
include_path
=
include_dirs
,
...
...
@@ -236,7 +253,7 @@ class CythonCompileTestCase(unittest.TestCase):
extension
=
Extension
(
module
,
sources
=
[
module
+
'.'
+
self
.
language
],
sources
=
[
self
.
build_target_filename
(
module
)
],
extra_compile_args
=
CFLAGS
,
)
build_extension
.
extensions
=
[
extension
]
...
...
@@ -285,6 +302,7 @@ class CythonRunTestCase(CythonCompileTestCase):
result
=
self
.
defaultTestResult
()
result
.
startTest
(
self
)
try
:
self
.
setUp
()
self
.
runCompileTest
()
if
not
self
.
cython_only
:
sys
.
stderr
.
write
(
'running doctests in %s ...
\
n
'
%
self
.
module
)
...
...
@@ -306,6 +324,7 @@ class CythonUnitTestCase(CythonCompileTestCase):
result
=
self
.
defaultTestResult
()
result
.
startTest
(
self
)
try
:
self
.
setUp
()
self
.
runCompileTest
()
sys
.
stderr
.
write
(
'running tests in %s ...
\
n
'
%
self
.
module
)
unittest
.
defaultTestLoader
.
loadTestsFromName
(
self
.
module
).
run
(
result
)
...
...
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