diff options
Diffstat (limited to 'test cases/python3/3 cython')
| -rwxr-xr-x | test cases/python3/3 cython/cytest.py | 23 | ||||
| -rw-r--r-- | test cases/python3/3 cython/libdir/cstorer.pxd | 9 | ||||
| -rw-r--r-- | test cases/python3/3 cython/libdir/meson.build | 12 | ||||
| -rw-r--r-- | test cases/python3/3 cython/libdir/storer.c | 24 | ||||
| -rw-r--r-- | test cases/python3/3 cython/libdir/storer.h | 8 | ||||
| -rw-r--r-- | test cases/python3/3 cython/libdir/storer.pyx | 16 | ||||
| -rw-r--r-- | test cases/python3/3 cython/meson.build | 20 |
7 files changed, 0 insertions, 112 deletions
diff --git a/test cases/python3/3 cython/cytest.py b/test cases/python3/3 cython/cytest.py deleted file mode 100755 index 43443dc66..000000000 --- a/test cases/python3/3 cython/cytest.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python3 - -from storer import Storer -import sys - -s = Storer() - -if s.get_value() != 0: - print('Initial value incorrect.') - sys.exit(1) - -s.set_value(42) - -if s.get_value() != 42: - print('Setting value failed.') - sys.exit(1) - -try: - s.set_value('not a number') - print('Using wrong argument type did not fail.') - sys.exit(1) -except TypeError: - pass diff --git a/test cases/python3/3 cython/libdir/cstorer.pxd b/test cases/python3/3 cython/libdir/cstorer.pxd deleted file mode 100644 index 7b730fc75..000000000 --- a/test cases/python3/3 cython/libdir/cstorer.pxd +++ /dev/null @@ -1,9 +0,0 @@ - -cdef extern from "storer.h": - ctypedef struct Storer: - pass - - Storer* storer_new(); - void storer_destroy(Storer *s); - int storer_get_value(Storer *s); - void storer_set_value(Storer *s, int v); diff --git a/test cases/python3/3 cython/libdir/meson.build b/test cases/python3/3 cython/libdir/meson.build deleted file mode 100644 index 4aaa041fc..000000000 --- a/test cases/python3/3 cython/libdir/meson.build +++ /dev/null @@ -1,12 +0,0 @@ -pyx_c = custom_target('storer_pyx', - output : 'storer_pyx.c', - input : 'storer.pyx', - depend_files : 'cstorer.pxd', - command : [cython, '@INPUT@', '-o', '@OUTPUT@'], -) - -slib = py3_mod.extension_module('storer', - 'storer.c', pyx_c, - dependencies : py3_dep) - -pydir = meson.current_build_dir() diff --git a/test cases/python3/3 cython/libdir/storer.c b/test cases/python3/3 cython/libdir/storer.c deleted file mode 100644 index 0199bb850..000000000 --- a/test cases/python3/3 cython/libdir/storer.c +++ /dev/null @@ -1,24 +0,0 @@ -#include"storer.h" -#include<stdlib.h> - -struct _Storer { - int value; -}; - -Storer* storer_new() { - Storer *s = malloc(sizeof(struct _Storer)); - s->value = 0; - return s; -} - -void storer_destroy(Storer *s) { - free(s); -} - -int storer_get_value(Storer *s) { - return s->value; -} - -void storer_set_value(Storer *s, int v) { - s->value = v; -} diff --git a/test cases/python3/3 cython/libdir/storer.h b/test cases/python3/3 cython/libdir/storer.h deleted file mode 100644 index 4f7191711..000000000 --- a/test cases/python3/3 cython/libdir/storer.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -typedef struct _Storer Storer; - -Storer* storer_new(); -void storer_destroy(Storer *s); -int storer_get_value(Storer *s); -void storer_set_value(Storer *s, int v); diff --git a/test cases/python3/3 cython/libdir/storer.pyx b/test cases/python3/3 cython/libdir/storer.pyx deleted file mode 100644 index ed551dc5f..000000000 --- a/test cases/python3/3 cython/libdir/storer.pyx +++ /dev/null @@ -1,16 +0,0 @@ -cimport cstorer - -cdef class Storer: - cdef cstorer.Storer* _c_storer - - def __cinit__(self): - self._c_storer = cstorer.storer_new() - - def __dealloc__(self): - cstorer.storer_destroy(self._c_storer) - - cpdef int get_value(self): - return cstorer.storer_get_value(self._c_storer) - - cpdef set_value(self, int value): - cstorer.storer_set_value(self._c_storer, value) diff --git a/test cases/python3/3 cython/meson.build b/test cases/python3/3 cython/meson.build deleted file mode 100644 index 753b906cf..000000000 --- a/test cases/python3/3 cython/meson.build +++ /dev/null @@ -1,20 +0,0 @@ -project('cython', 'c', - default_options : ['warning_level=3']) - -cython = find_program('cython3', required : false) -py3_dep = dependency('python3', required : false) - -if cython.found() and py3_dep.found() - py3_dep = dependency('python3') - py3_mod = import('python3') - py3 = py3_mod.find_python() - subdir('libdir') - - test('cython tester', - py3, - args : files('cytest.py'), - env : ['PYTHONPATH=' + pydir] - ) -else - error('MESON_SKIP_TEST: Cython3 or Python3 libraries not found, skipping test.') -endif |
