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
5b7aaa54
Commit
5b7aaa54
authored
Jul 31, 2014
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option to use common utility code dir to runtests.py
parent
deb34879
Changes
1
Show 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 @
5b7aaa54
...
@@ -487,7 +487,8 @@ class ErrorWriter(object):
...
@@ -487,7 +487,8 @@ class ErrorWriter(object):
class TestBuilder(object):
class TestBuilder(object):
def __init__(self, rootdir, workdir, selectors, exclude_selectors, annotate,
def __init__(self, rootdir, workdir, selectors, exclude_selectors, annotate,
cleanup_workdir, cleanup_sharedlibs, cleanup_failures,
cleanup_workdir, cleanup_sharedlibs, cleanup_failures,
with_pyregr, cython_only, languages, test_bugs, fork, language_level):
with_pyregr, cython_only, languages, test_bugs, fork, language_level,
common_utility_dir):
self.rootdir = rootdir
self.rootdir = rootdir
self.workdir = workdir
self.workdir = workdir
self.selectors = selectors
self.selectors = selectors
...
@@ -502,6 +503,7 @@ class TestBuilder(object):
...
@@ -502,6 +503,7 @@ class TestBuilder(object):
self.test_bugs = test_bugs
self.test_bugs = test_bugs
self.fork = fork
self.fork = fork
self.language_level = language_level
self.language_level = language_level
self.common_utility_dir = common_utility_dir
def build_suite(self):
def build_suite(self):
suite = unittest.TestSuite()
suite = unittest.TestSuite()
...
@@ -631,13 +633,15 @@ class TestBuilder(object):
...
@@ -631,13 +633,15 @@ class TestBuilder(object):
cython_only=self.cython_only,
cython_only=self.cython_only,
fork=self.fork,
fork=self.fork,
language_level=self.language_level,
language_level=self.language_level,
warning_errors=warning_errors)
warning_errors=warning_errors,
common_utility_dir=self.common_utility_dir)
class CythonCompileTestCase(unittest.TestCase):
class CythonCompileTestCase(unittest.TestCase):
def __init__(self, test_directory, workdir, module, tags, language='c', preparse='id',
def __init__(self, test_directory, workdir, module, tags, language='c', preparse='id',
expect_errors=False, annotate=False, cleanup_workdir=True,
expect_errors=False, annotate=False, cleanup_workdir=True,
cleanup_sharedlibs=True, cleanup_failures=True, cython_only=False,
cleanup_sharedlibs=True, cleanup_failures=True, cython_only=False,
fork=True, language_level=2, warning_errors=False):
fork=True, language_level=2, warning_errors=False,
common_utility_dir=None):
self.test_directory = test_directory
self.test_directory = test_directory
self.tags = tags
self.tags = tags
self.workdir = workdir
self.workdir = workdir
...
@@ -654,6 +658,7 @@ class CythonCompileTestCase(unittest.TestCase):
...
@@ -654,6 +658,7 @@ class CythonCompileTestCase(unittest.TestCase):
self.fork = fork
self.fork = fork
self.language_level = language_level
self.language_level = language_level
self.warning_errors = warning_errors
self.warning_errors = warning_errors
self.common_utility_dir = common_utility_dir
unittest.TestCase.__init__(self)
unittest.TestCase.__init__(self)
def shortDescription(self):
def shortDescription(self):
...
@@ -813,6 +818,7 @@ class CythonCompileTestCase(unittest.TestCase):
...
@@ -813,6 +818,7 @@ class CythonCompileTestCase(unittest.TestCase):
from Cython.Compiler.Main import CompilationOptions
from Cython.Compiler.Main import CompilationOptions
from Cython.Compiler.Main import compile as cython_compile
from Cython.Compiler.Main import compile as cython_compile
from Cython.Compiler.Main import default_options
from Cython.Compiler.Main import default_options
common_utility_include_dir = self.common_utility_dir
options = CompilationOptions(
options = CompilationOptions(
default_options,
default_options,
...
@@ -824,6 +830,7 @@ class CythonCompileTestCase(unittest.TestCase):
...
@@ -824,6 +830,7 @@ class CythonCompileTestCase(unittest.TestCase):
language_level = self.language_level,
language_level = self.language_level,
generate_pxi = False,
generate_pxi = False,
evaluate_tree_assertions = True,
evaluate_tree_assertions = True,
common_utility_include_dir = common_utility_include_dir,
**extra_compile_options
**extra_compile_options
)
)
cython_compile(source, options=options,
cython_compile(source, options=options,
...
@@ -1763,6 +1770,7 @@ def main():
...
@@ -1763,6 +1770,7 @@ def main():
help="use pyximport to automatically compile imported .pyx and .py files")
help="use pyximport to automatically compile imported .pyx and .py files")
parser.add_option("--watermark", dest="watermark", default=None,
parser.add_option("--watermark", dest="watermark", default=None,
help="deterministic generated by string")
help="deterministic generated by string")
parser.add_option("--use_common_utility_dir", default=False, action="store_true")
options, cmd_args = parser.parse_args()
options, cmd_args = parser.parse_args()
...
@@ -1976,6 +1984,13 @@ def runtests(options, cmd_args, coverage=None):
...
@@ -1976,6 +1984,13 @@ def runtests(options, cmd_args, coverage=None):
sys.stderr.write("Backends: %s
\
n
" % ','.join(backends))
sys.stderr.write("Backends: %s
\
n
" % ','.join(backends))
languages = backends
languages = backends
if options.use_common_utility_dir:
common_utility_dir = os.path.join(WORKDIR, 'utility_code')
if not os.path.exists(common_utility_dir):
os.makedirs(common_utility_dir)
else:
common_utility_dir = None
sys.stderr.write("
\
n
")
sys.stderr.write("
\
n
")
test_suite = unittest.TestSuite()
test_suite = unittest.TestSuite()
...
@@ -1992,7 +2007,8 @@ def runtests(options, cmd_args, coverage=None):
...
@@ -1992,7 +2007,8 @@ def runtests(options, cmd_args, coverage=None):
options.cleanup_sharedlibs, options.cleanup_failures,
options.cleanup_sharedlibs, options.cleanup_failures,
options.pyregr,
options.pyregr,
options.cython_only, languages, test_bugs,
options.cython_only, languages, test_bugs,
options.fork, options.language_level)
options.fork, options.language_level,
common_utility_dir)
test_suite.addTest(filetests.build_suite())
test_suite.addTest(filetests.build_suite())
if options.system_pyregr and languages:
if options.system_pyregr and languages:
...
@@ -2021,6 +2037,9 @@ def runtests(options, cmd_args, coverage=None):
...
@@ -2021,6 +2037,9 @@ def runtests(options, cmd_args, coverage=None):
result = test_runner.run(test_suite)
result = test_runner.run(test_suite)
if common_utility_dir and options.shard_num < 0 and options.cleanup_workdir:
shutil.rmtree(common_utility_dir)
if coverage is not None:
if coverage is not None:
coverage.stop()
coverage.stop()
ignored_modules = set(
ignored_modules = set(
...
...
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