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
Kirill Smelkov
cython
Commits
bd44de56
Commit
bd44de56
authored
Jan 17, 2019
by
wenjun.swj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add case for tracer-reporter mismatch
parent
4c9acf09
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
0 deletions
+71
-0
tests/run/coverage_installed_pkg.srctree
tests/run/coverage_installed_pkg.srctree
+71
-0
No files found.
tests/run/coverage_installed_pkg.srctree
0 → 100644
View file @
bd44de56
# mode: run
# tag: coverage,trace
"""
PYTHON setup.py build_ext -i
PYTHON -c "import shutil; shutil.move('ext_src/ext_pkg', 'ext_pkg')"
PYTHON -m coverage run coverage_test.py
PYTHON -m coverage report
"""
######## setup.py ########
from distutils.core import setup, Extension
from Cython.Build import cythonize
setup(ext_modules = cythonize([
'pkg/*.pyx',
]))
setup(
name='ext_pkg',
package_dir={'': 'ext_src'},
ext_modules = cythonize([
Extension('ext_pkg._mul', ['ext_src/ext_pkg/mul.py'])
]),
)
######## .coveragerc ########
[run]
plugins = Cython.Coverage
######## pkg/__init__.py ########
from .test_ext_import import test_add
######## pkg/test_ext_import.pyx ########
# cython: linetrace=True
# distutils: define_macros=CYTHON_TRACE=1
import ext_pkg
cpdef test_add(int a, int b):
return a + ext_pkg.test_mul(b, 2)
######## ext_src/ext_pkg/__init__.py ########
from .mul import test_mul
######## ext_src/ext_pkg/mul.py ########
from __future__ import absolute_import
def test_mul(a, b):
return a * b
try:
from ._mul import *
except ImportError:
pass
######## coverage_test.py ########
from pkg import test_add
assert 5 == test_add(1, 2)
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