aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtest cases/python/2 extmodule/blaster.py.in (renamed from test cases/python/2 extmodule/blaster.py)2
-rw-r--r--test cases/python/2 extmodule/ext/meson.build4
-rw-r--r--test cases/python/2 extmodule/ext/nested/meson.build15
-rw-r--r--test cases/python/2 extmodule/ext/tachyon_module.c2
-rw-r--r--test cases/python/2 extmodule/ext/wrongdir/meson.build7
-rw-r--r--test cases/python/2 extmodule/meson.build10
-rw-r--r--test cases/python/2 extmodule/test.json13
7 files changed, 50 insertions, 3 deletions
diff --git a/test cases/python/2 extmodule/blaster.py b/test cases/python/2 extmodule/blaster.py.in
index aaac984..b690b40 100755
--- a/test cases/python/2 extmodule/blaster.py
+++ b/test cases/python/2 extmodule/blaster.py.in
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
-import tachyon
+import @tachyon_module@ as tachyon
result = tachyon.phaserize('shoot')
diff --git a/test cases/python/2 extmodule/ext/meson.build b/test cases/python/2 extmodule/ext/meson.build
index b13bb32..799e9b0 100644
--- a/test cases/python/2 extmodule/ext/meson.build
+++ b/test cases/python/2 extmodule/ext/meson.build
@@ -1,6 +1,10 @@
pylib = py.extension_module('tachyon',
'tachyon_module.c',
dependencies : py_dep,
+ c_args: '-DMESON_MODULENAME="tachyon"',
+ install: true,
)
+subdir('nested')
+subdir('wrongdir')
pypathdir = meson.current_build_dir()
diff --git a/test cases/python/2 extmodule/ext/nested/meson.build b/test cases/python/2 extmodule/ext/nested/meson.build
new file mode 100644
index 0000000..044ddf4
--- /dev/null
+++ b/test cases/python/2 extmodule/ext/nested/meson.build
@@ -0,0 +1,15 @@
+py.extension_module('tachyon',
+ '../tachyon_module.c',
+ dependencies : py_dep,
+ c_args: '-DMESON_MODULENAME="nested.tachyon"',
+ install: true,
+ subdir: 'nested'
+)
+py.install_sources(
+ configure_file(
+ input: '../../blaster.py.in',
+ output: 'blaster.py',
+ configuration: {'tachyon_module': 'nested.tachyon'}
+ ),
+ subdir: 'nested',
+)
diff --git a/test cases/python/2 extmodule/ext/tachyon_module.c b/test cases/python/2 extmodule/ext/tachyon_module.c
index b2592e4..a5d7cdc 100644
--- a/test cases/python/2 extmodule/ext/tachyon_module.c
+++ b/test cases/python/2 extmodule/ext/tachyon_module.c
@@ -38,7 +38,7 @@ static PyMethodDef TachyonMethods[] = {
static struct PyModuleDef tachyonmodule = {
PyModuleDef_HEAD_INIT,
- "tachyon",
+ MESON_MODULENAME,
NULL,
-1,
TachyonMethods
diff --git a/test cases/python/2 extmodule/ext/wrongdir/meson.build b/test cases/python/2 extmodule/ext/wrongdir/meson.build
new file mode 100644
index 0000000..1355d4f
--- /dev/null
+++ b/test cases/python/2 extmodule/ext/wrongdir/meson.build
@@ -0,0 +1,7 @@
+py.extension_module('tachyon',
+ '../tachyon_module.c',
+ dependencies : py_dep,
+ c_args: '-DMESON_MODULENAME="tachyon"',
+ install: true,
+ install_dir: get_option('libdir')
+)
diff --git a/test cases/python/2 extmodule/meson.build b/test cases/python/2 extmodule/meson.build
index 18d70c8..7362de3 100644
--- a/test cases/python/2 extmodule/meson.build
+++ b/test cases/python/2 extmodule/meson.build
@@ -18,11 +18,19 @@ endif
subdir('ext')
+blaster = configure_file(
+ input: 'blaster.py.in',
+ output: 'blaster.py',
+ configuration: {'tachyon_module': 'tachyon'}
+)
+
test('extmod',
py,
- args : files('blaster.py'),
+ args : blaster,
env : ['PYTHONPATH=' + pypathdir])
+py.install_sources(blaster)
+py.install_sources(blaster, pure: true, subdir: 'pure')
py3_pkg_dep = dependency('python3', method: 'pkg-config', required : false)
if py3_pkg_dep.found()
diff --git a/test cases/python/2 extmodule/test.json b/test cases/python/2 extmodule/test.json
new file mode 100644
index 0000000..6bd1195
--- /dev/null
+++ b/test cases/python/2 extmodule/test.json
@@ -0,0 +1,13 @@
+{
+ "installed": [
+ { "type": "python_file", "file": "usr/@PYTHON_PLATLIB@/blaster.py" },
+ { "type": "python_lib", "file": "usr/@PYTHON_PLATLIB@/tachyon" },
+ { "type": "py_implib", "file": "usr/@PYTHON_PLATLIB@/tachyon" },
+ { "type": "python_file", "file": "usr/@PYTHON_PURELIB@/pure/blaster.py" },
+ { "type": "python_file", "file": "usr/@PYTHON_PLATLIB@/nested/blaster.py" },
+ { "type": "python_lib", "file": "usr/@PYTHON_PLATLIB@/nested/tachyon" },
+ { "type": "py_implib", "file": "usr/@PYTHON_PLATLIB@/nested/tachyon" },
+ { "type": "python_lib", "file": "usr/lib/tachyon" },
+ { "type": "py_implib", "file": "usr/lib/tachyon" }
+ ]
+}