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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
0d57141d
Commit
0d57141d
authored
May 02, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use "cerror" tag instead of more verbose "_FAIL_C_COMPILE" special casing in test runner
parent
a8d3e827
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
runtests.py
runtests.py
+3
-6
tests/errors/e_switch_transform.pyx
tests/errors/e_switch_transform.pyx
+1
-2
No files found.
runtests.py
View file @
0d57141d
...
...
@@ -693,9 +693,6 @@ class CythonCompileTestCase(unittest.TestCase):
if line.startswith("
_ERRORS
"):
out.close()
out = ErrorWriter()
elif line.startswith('_FAIL_C_COMPILE'):
out.close()
return '_FAIL_C_COMPILE'
else:
out.write(line)
finally:
...
...
@@ -839,7 +836,7 @@ class CythonCompileTestCase(unittest.TestCase):
finally:
sys.stderr = old_stderr
if
expected_errors == '_FAIL_C_COMPILE'
:
if
'cerror' in self.tags['tag']
:
if errors:
print("
\
n
===
Expected
C
compile
error
===
")
print("
\
n
\
n
===
Got
Cython
errors
:
===
")
...
...
@@ -873,7 +870,7 @@ class CythonCompileTestCase(unittest.TestCase):
with captured_fd(2) as get_stderr:
so_path = self.run_distutils(test_directory, module, workdir, incdir)
except Exception:
if
expected_errors == '_FAIL_C_COMPILE'
and get_stderr and get_stderr():
if
'cerror' in self.tags['tag']
and get_stderr and get_stderr():
pass
else:
raise
...
...
@@ -882,7 +879,7 @@ class CythonCompileTestCase(unittest.TestCase):
if c_compiler_stderr:
print("
\
n
===
C
/
C
++
compiler
error
output
:
===
")
print_bytes(c_compiler_stderr)
if
expected_errors == '_FAIL_C_COMPILE'
:
if
'cerror' in self.tags['tag']
:
# must raise this outside the try block
raise RuntimeError('should have failed C compile')
return so_path
...
...
tests/errors/e_switch_transform.pyx
View file @
0d57141d
# cython: optimize.use_switch=True
# mode: error
# tag: cerror
import
cython
...
...
@@ -10,5 +11,3 @@ cdef extern from *:
def
is_not_one
(
int
i
):
return
i
!=
ONE
and
i
!=
ONE_AGAIN
_FAIL_C_COMPILE
=
True
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