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
9c18bab1
Commit
9c18bab1
authored
Sep 30, 2017
by
MaxBo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add MixedCase packages and filenames for coverage tests
parent
f78f8806
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
2 deletions
+55
-2
tests/run/coverage_api.srctree
tests/run/coverage_api.srctree
+55
-2
No files found.
tests/run/coverage_api.srctree
View file @
9c18bab1
...
@@ -15,7 +15,8 @@ from Cython.Build import cythonize
...
@@ -15,7 +15,8 @@ from Cython.Build import cythonize
setup(ext_modules = cythonize([
setup(ext_modules = cythonize([
'coverage_test_*.py*',
'coverage_test_*.py*',
'pkg/coverage_test_*.py*'
'pkg/coverage_test_*.py*',
'Package2/CoverageTest_*.py*'
]))
]))
...
@@ -83,6 +84,52 @@ def main_func(int x): # 11
...
@@ -83,6 +84,52 @@ def main_func(int x): # 11
return cfunc1(x) + func1(x, 4) + func2(x) # 12
return cfunc1(x) + func1(x, 4) + func2(x) # 12
######## Package2/__init__.py ########
# Add MixedCase package and filenames to test if the files are found
######## Package2/CoverageTest_py.py ########
# cython: linetrace=True
# distutils: define_macros=CYTHON_TRACE=1
def func1(a, b):
x = 1 # 5
c = func2(a) + b # 6
return x + c # 7
def func2(a):
return a * 2 # 11
######## Package2/CoverageTest_pyx.pyx ########
# cython: linetrace=True
# distutils: define_macros=CYTHON_TRACE=1
def func1(int a, int b):
cdef int x = 1 # 5
c = func2(a) + b # 6
return x + c # 7
def func2(int a):
return a * 2 # 11
######## coverage_test_include_pyx.pyx ########
# cython: linetrace=True
# distutils: define_macros=CYTHON_TRACE=1
cdef int x = 5 # 4
cdef int cfunc1(int x): # 6
return x * 3 # 7
include "pkg/coverage_test_pyx.pxi" # 9
def main_func(int x): # 11
return cfunc1(x) + func1(x, 4) + func2(x) # 12
######## coverage_test.py ########
######## coverage_test.py ########
import re
import re
...
@@ -99,8 +146,12 @@ from pkg import coverage_test_py
...
@@ -99,8 +146,12 @@ from pkg import coverage_test_py
from pkg import coverage_test_pyx
from pkg import coverage_test_pyx
import coverage_test_include_pyx
import coverage_test_include_pyx
# test the MixedCase Files and packages
from Package2 import CoverageTest_py
from Package2 import CoverageTest_pyx
for module in [coverage_test_py, coverage_test_pyx, coverage_test_include_pyx]:
for module in [coverage_test_py, coverage_test_pyx, coverage_test_include_pyx,
CoverageTest_py, CoverageTest_pyx]:
assert not any(module.__file__.endswith(ext) for ext in '.py .pyc .pyo .pyw .pyx .pxi'.split()), \
assert not any(module.__file__.endswith(ext) for ext in '.py .pyc .pyo .pyw .pyx .pxi'.split()), \
module.__file__
module.__file__
...
@@ -152,3 +203,5 @@ if __name__ == '__main__':
...
@@ -152,3 +203,5 @@ if __name__ == '__main__':
run_coverage(coverage_test_py)
run_coverage(coverage_test_py)
run_coverage(coverage_test_pyx)
run_coverage(coverage_test_pyx)
run_coverage(coverage_test_include_pyx)
run_coverage(coverage_test_include_pyx)
run_coverage(CoverageTest_py)
run_coverage(CoverageTest_pyx)
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