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
d3a8f712
Commit
d3a8f712
authored
Mar 22, 2019
by
gsamain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unit testing
parent
594d66ef
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
193 additions
and
0 deletions
+193
-0
nogil_test/cypclass_test___new__.pyx
nogil_test/cypclass_test___new__.pyx
+28
-0
nogil_test/cypclass_test___new___distutil.py
nogil_test/cypclass_test___new___distutil.py
+14
-0
nogil_test/cypclass_test_basic.pyx
nogil_test/cypclass_test_basic.pyx
+10
-0
nogil_test/cypclass_test_basic_distutil.py
nogil_test/cypclass_test_basic_distutil.py
+14
-0
nogil_test/cypclass_test_constructor.pyx
nogil_test/cypclass_test_constructor.pyx
+17
-0
nogil_test/cypclass_test_constructor_distutil.py
nogil_test/cypclass_test_constructor_distutil.py
+14
-0
nogil_test/cypclass_test_constructor_optional_arguments.pyx
nogil_test/cypclass_test_constructor_optional_arguments.pyx
+15
-0
nogil_test/cypclass_test_constructor_optional_arguments_distutil.py
.../cypclass_test_constructor_optional_arguments_distutil.py
+14
-0
nogil_test/cypclass_test_inheritance.pyx
nogil_test/cypclass_test_inheritance.pyx
+29
-0
nogil_test/cypclass_test_inheritance_distutil.py
nogil_test/cypclass_test_inheritance_distutil.py
+14
-0
nogil_test/cypclass_test_keywordnew.pyx
nogil_test/cypclass_test_keywordnew.pyx
+10
-0
nogil_test/cypclass_test_keywordnew_distutil.py
nogil_test/cypclass_test_keywordnew_distutil.py
+14
-0
No files found.
nogil_test/cypclass_test___new__.pyx
0 → 100644
View file @
d3a8f712
cdef
cypclass
SomeMemory
:
int
a
SomeMemory
__new__
():
o
=
new
SomeMemory
()
o
.
a
=
-
2
return
o
void
*
__new__
(
int
a
):
o
=
new
SomeMemory
()
o
.
a
=
a
return
<
void
*>
o
void
__init__
():
this
.
a
+=
1
void
__init__
(
int
a
):
pass
cdef
int
foo
():
cdef
SomeMemory
o
=
SomeMemory
()
return
o
.
a
cdef
int
bar
():
cdef
SomeMemory
o
=
SomeMemory
(
3
)
return
o
.
a
cpdef
bag
():
return
str
(
foo
())
+
'
\
n
'
+
str
(
bar
())
\ No newline at end of file
nogil_test/cypclass_test___new___distutil.py
0 → 100644
View file @
d3a8f712
from
distutils.core
import
setup
from
distutils.extension
import
Extension
from
Cython.Build
import
cythonize
setup
(
ext_modules
=
cythonize
([
Extension
(
'cypclass_test___new__'
,
language
=
'c++'
,
sources
=
[
'cypclass_test___new__.pyx'
],
extra_compile_args
=
[
"-pthread"
,
"-std=c++11"
],
),
])
)
\ No newline at end of file
nogil_test/cypclass_test_basic.pyx
0 → 100644
View file @
d3a8f712
cdef
cypclass
SomeMemory
:
int
a
cpdef
foo
():
cdef
SomeMemory
o
=
SomeMemory
()
o
.
a
=
3
return
o
.
a
def
bag
():
return
str
(
foo
())
\ No newline at end of file
nogil_test/cypclass_test_basic_distutil.py
0 → 100644
View file @
d3a8f712
from
distutils.core
import
setup
from
distutils.extension
import
Extension
from
Cython.Build
import
cythonize
setup
(
ext_modules
=
cythonize
([
Extension
(
'cypclass_test_basic'
,
language
=
'c++'
,
sources
=
[
'cypclass_test_basic.pyx'
],
extra_compile_args
=
[
"-pthread"
,
"-std=c++11"
],
),
])
)
\ No newline at end of file
nogil_test/cypclass_test_constructor.pyx
0 → 100644
View file @
d3a8f712
cdef
cypclass
SomeMemory
:
int
a
void
__init__
(
int
a
):
this
.
a
=
a
void
__init__
(
int
a
,
int
b
):
this
.
a
=
a
*
b
cpdef
foo
():
cdef
SomeMemory
o1
=
SomeMemory
(
3
)
return
o1
.
a
cpdef
bar
():
cdef
SomeMemory
o2
=
SomeMemory
(
2
,
7
)
return
o2
.
a
def
bag
():
return
str
(
foo
())
+
'
\
n
'
+
str
(
bar
())
nogil_test/cypclass_test_constructor_distutil.py
0 → 100644
View file @
d3a8f712
from
distutils.core
import
setup
from
distutils.extension
import
Extension
from
Cython.Build
import
cythonize
setup
(
ext_modules
=
cythonize
([
Extension
(
'cypclass_test_constructor'
,
language
=
'c++'
,
sources
=
[
'cypclass_test_constructor.pyx'
],
extra_compile_args
=
[
"-pthread"
,
"-std=c++11"
],
),
])
)
\ No newline at end of file
nogil_test/cypclass_test_constructor_optional_arguments.pyx
0 → 100644
View file @
d3a8f712
cdef
cypclass
SomeMemory
:
int
a
void
__init__
(
int
a
,
int
b
=
1
):
this
.
a
=
a
*
b
cpdef
foo
():
cdef
SomeMemory
o1
=
SomeMemory
(
3
)
return
o1
.
a
cpdef
bar
():
cdef
SomeMemory
o2
=
SomeMemory
(
2
,
7
)
return
o2
.
a
def
bag
():
return
str
(
foo
())
+
'
\
n
'
+
str
(
bar
())
nogil_test/cypclass_test_constructor_optional_arguments_distutil.py
0 → 100644
View file @
d3a8f712
from
distutils.core
import
setup
from
distutils.extension
import
Extension
from
Cython.Build
import
cythonize
setup
(
ext_modules
=
cythonize
([
Extension
(
'cypclass_test_constructor_optional_arguments'
,
language
=
'c++'
,
sources
=
[
'cypclass_test_constructor_optional_arguments.pyx'
],
extra_compile_args
=
[
"-pthread"
,
"-std=c++11"
],
),
])
)
\ No newline at end of file
nogil_test/cypclass_test_inheritance.pyx
0 → 100644
View file @
d3a8f712
cdef
cypclass
SomeMemory
:
int
a
void
__init__
(
int
a
):
this
.
a
=
a
void
__init__
(
int
a
,
int
b
):
this
.
a
=
a
*
b
cdef
cypclass
SomeSubMemory
(
SomeMemory
):
void
__init__
(
int
a
,
int
b
):
this
.
a
=
a
+
b
int
getter
():
return
this
.
a
cpdef
foo
():
cdef
SomeMemory
o1
=
SomeMemory
(
2
,
7
)
return
o1
.
a
cpdef
bar
():
cdef
SomeSubMemory
o2
=
SomeSubMemory
(
2
,
7
)
return
o2
.
getter
()
cpdef
baz
():
cdef
SomeSubMemory
o3
=
SomeSubMemory
(
2
)
return
o3
.
getter
()
def
bag
():
return
str
(
foo
())
+
'
\
n
'
+
str
(
bar
())
+
'
\
n
'
+
str
(
baz
())
nogil_test/cypclass_test_inheritance_distutil.py
0 → 100644
View file @
d3a8f712
from
distutils.core
import
setup
from
distutils.extension
import
Extension
from
Cython.Build
import
cythonize
setup
(
ext_modules
=
cythonize
([
Extension
(
'cypclass_test_inheritance'
,
language
=
'c++'
,
sources
=
[
'cypclass_test_inheritance.pyx'
],
extra_compile_args
=
[
"-pthread"
,
"-std=c++11"
],
),
])
)
\ No newline at end of file
nogil_test/cypclass_test_keywordnew.pyx
0 → 100644
View file @
d3a8f712
cdef
cypclass
SomeMemory
:
int
a
cpdef
foo
():
cdef
SomeMemory
o
=
new
SomeMemory
()
o
.
a
=
3
return
o
.
a
def
bag
():
return
str
(
foo
())
\ No newline at end of file
nogil_test/cypclass_test_keywordnew_distutil.py
0 → 100644
View file @
d3a8f712
from
distutils.core
import
setup
from
distutils.extension
import
Extension
from
Cython.Build
import
cythonize
setup
(
ext_modules
=
cythonize
([
Extension
(
'cypclass_test_keywordnew'
,
language
=
'c++'
,
sources
=
[
'cypclass_test_keywordnew.pyx'
],
extra_compile_args
=
[
"-pthread"
,
"-std=c++11"
],
),
])
)
\ No newline at end of file
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