Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

handle 'cpp' tag in end-to-end srctree tests

  • Loading branch information...
commit 1a0ff5e2e0cc78f07f059db10ecd79db036186d8 1 parent b1bef0a
scoder scoder authored
8 Cython/TestUtils.py
View
@@ -172,8 +172,10 @@ def unpack_source_tree(tree_file, dir=None):
header = []
cur_file = None
f = open(tree_file)
- lines = f.readlines()
- f.close()
+ try:
+ lines = f.readlines()
+ finally:
+ f.close()
f = None
for line in lines:
if line[:5] == '#####':
@@ -186,7 +188,7 @@ def unpack_source_tree(tree_file, dir=None):
cur_file = open(path, 'w')
elif cur_file is not None:
cur_file.write(line)
- else:
+ elif line.strip() and not line.lstrip().startswith('#'):
header.append(line)
if cur_file is not None:
cur_file.close()
3  runtests.py
View
@@ -376,7 +376,8 @@ def handle_directory(self, path, context):
mode = 'pyregr'
if ext == '.srctree':
- suite.addTest(EndToEndTest(filepath, workdir, self.cleanup_workdir))
+ if 'cpp' not in tags['tag'] or 'cpp' in self.languages:
+ suite.addTest(EndToEndTest(filepath, workdir, self.cleanup_workdir))
continue
# Choose the test suite.
2  tests/build/cpp_cythonize.srctree
View
@@ -1,3 +1,5 @@
+# tag: cpp
+
PYTHON setup.py build_ext --inplace
PYTHON -c "import a; a.use_vector([1,2,3])"
2  tests/build/inline_distutils.srctree
View
@@ -1,3 +1,5 @@
+# tag: cpp
+
PYTHON setup.py build_ext --inplace
PYTHON -c "import a"
2  tests/build/module_api.srctree
View
@@ -1,3 +1,5 @@
+# tag: cpp
+
PYTHON setup.py build_ext --inplace
PYTHON test.py
Please sign in to comment.
Something went wrong with that request. Please try again.