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
cdf5f0de
Commit
cdf5f0de
authored
Jan 26, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
instead of parsing test tags twice, pass them into test class
parent
795c0632
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
runtests.py
runtests.py
+6
-11
No files found.
runtests.py
View file @
cdf5f0de
...
@@ -523,18 +523,18 @@ class TestBuilder(object):
...
@@ -523,18 +523,18 @@ class TestBuilder(object):
elif 'no-cpp' in tags['tag'] and 'cpp' in self.languages:
elif 'no-cpp' in tags['tag'] and 'cpp' in self.languages:
languages = list(languages)
languages = list(languages)
languages.remove('cpp')
languages.remove('cpp')
tests = [ self.build_test(test_class, path, workdir, module,
tests = [ self.build_test(test_class, path, workdir, module,
tags,
language, expect_errors, warning_errors)
language, expect_errors, warning_errors)
for language in languages ]
for language in languages ]
return tests
return tests
def build_test(self, test_class, path, workdir, module,
def build_test(self, test_class, path, workdir, module,
tags,
language, expect_errors, warning_errors):
language, expect_errors, warning_errors):
language_workdir = os.path.join(workdir, language)
language_workdir = os.path.join(workdir, language)
if not os.path.exists(language_workdir):
if not os.path.exists(language_workdir):
os.makedirs(language_workdir)
os.makedirs(language_workdir)
workdir = os.path.join(language_workdir, module)
workdir = os.path.join(language_workdir, module)
return test_class(path, workdir, module,
return test_class(path, workdir, module,
tags,
language=language,
language=language,
expect_errors=expect_errors,
expect_errors=expect_errors,
annotate=self.annotate,
annotate=self.annotate,
...
@@ -547,11 +547,12 @@ class TestBuilder(object):
...
@@ -547,11 +547,12 @@ class TestBuilder(object):
warning_errors=warning_errors)
warning_errors=warning_errors)
class CythonCompileTestCase(unittest.TestCase):
class CythonCompileTestCase(unittest.TestCase):
def __init__(self, test_directory, workdir, module, language='c',
def __init__(self, test_directory, workdir, module,
tags,
language='c',
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):
self.test_directory = test_directory
self.test_directory = test_directory
self.tags = tags
self.workdir = workdir
self.workdir = workdir
self.module = module
self.module = module
self.language = language
self.language = language
...
@@ -725,12 +726,6 @@ class CythonCompileTestCase(unittest.TestCase):
...
@@ -725,12 +726,6 @@ class CythonCompileTestCase(unittest.TestCase):
def run_distutils(self, test_directory, module, workdir, incdir,
def run_distutils(self, test_directory, module, workdir, incdir,
extra_extension_args=None):
extra_extension_args=None):
original_source = self.find_module_source_file(
os.path.join(test_directory, module + '.pyx'))
try:
tags = parse_tags(original_source)
except IOError:
tags = {}
cwd = os.getcwd()
cwd = os.getcwd()
os.chdir(workdir)
os.chdir(workdir)
try:
try:
...
@@ -770,7 +765,7 @@ class CythonCompileTestCase(unittest.TestCase):
...
@@ -770,7 +765,7 @@ class CythonCompileTestCase(unittest.TestCase):
del EXT_EXTRAS[matcher]
del EXT_EXTRAS[matcher]
matcher = string_selector(matcher)
matcher = string_selector(matcher)
EXT_EXTRAS[matcher] = fixer
EXT_EXTRAS[matcher] = fixer
if matcher(module, tags):
if matcher(module,
self.
tags):
newext = fixer(extension)
newext = fixer(extension)
if newext is EXCLUDE_EXT:
if newext is EXCLUDE_EXT:
return
return
...
...
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