Skip to content

Commit 351ae7d

Browse files
committed
TST: extend local lib test to verify Windows support
1 parent 900b5cf commit 351ae7d

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import os
2+
3+
_path = os.path.join(os.path.dirname(__file__), '..', '.example.meson-libs')
4+
if os.name == 'nt':
5+
os.add_dll_directory(_path)
6+
elif sys.platform == 'cygwin':
7+
os.environ['PATH'] = os.pathsep.join((os.environ['PATH'], _path))
8+
del _path
9+
10+
from _example import *

tests/packages/link-against-local-lib/meson.build

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,16 @@ subdir('lib')
88

99
py = import('python').find_installation()
1010

11+
py.install_sources(
12+
'__init__.py',
13+
subdir_name: 'example',
14+
)
15+
1116
py.extension_module(
12-
'example',
17+
'_example',
1318
'examplemod.c',
1419
link_with: example_lib,
1520
link_args: ['-Wl,-rpath,custom-rpath'],
1621
install: true,
22+
subdir_name: 'example',
1723
)

tests/packages/link-against-local-lib/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@
55
[build-system]
66
build-backend = 'mesonpy'
77
requires = ['meson-python']
8+
9+
[tool.meson-python]
10+
allow-windows-internal-shared-libs = true

tests/test_wheel.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ def test_contents(package_library, wheel_library):
172172
}
173173

174174

175-
@pytest.mark.skipif(sys.platform not in {'linux', 'darwin', 'sunos5'}, reason='Not supported on this platform')
176175
def test_local_lib(venv, wheel_link_against_local_lib):
177176
venv.pip('install', wheel_link_against_local_lib)
178177
output = venv.python('-c', 'import example; print(example.example_sum(1, 2))')

0 commit comments

Comments
 (0)