Commit 9c18bab1 authored by MaxBo's avatar MaxBo

add MixedCase packages and filenames for coverage tests

parent f78f8806
......@@ -15,7 +15,8 @@ from Cython.Build import cythonize
setup(ext_modules = cythonize([
'coverage_test_*.py*',
'pkg/coverage_test_*.py*'
'pkg/coverage_test_*.py*',
'Package2/CoverageTest_*.py*'
]))
......@@ -83,6 +84,52 @@ def main_func(int x): # 11
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 ########
import re
......@@ -99,8 +146,12 @@ from pkg import coverage_test_py
from pkg import coverage_test_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()), \
module.__file__
......@@ -152,3 +203,5 @@ if __name__ == '__main__':
run_coverage(coverage_test_py)
run_coverage(coverage_test_pyx)
run_coverage(coverage_test_include_pyx)
run_coverage(CoverageTest_py)
run_coverage(CoverageTest_pyx)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment