Skip to content

Commit e35ac0d

Browse files
rgommersdnicolodi
authored andcommitted
TST: test the use of a custom meson.py script
1 parent 9f92d7e commit e35ac0d

File tree

5 files changed

+47
-0
lines changed

5 files changed

+47
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SPDX-FileCopyrightText: 2023 The meson-python developers
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
project('vendored-meson', version: '1.0.0')
6+
7+
py = import('python').find_installation()
8+
9+
if not get_option('custom-meson-used')
10+
error('Expected option "custom-meson-used" was not specified')
11+
endif
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SPDX-FileCopyrightText: 2023 The meson-python developers
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
option('custom-meson-used', type: 'boolean', value: false)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SPDX-FileCopyrightText: 2023 The meson-python developers
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
[build-system]
6+
build-backend = 'mesonpy'
7+
requires = ['meson-python']
8+
9+
[tool.meson-python]
10+
meson = 'third-party/meson.py'
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# SPDX-FileCopyrightText: 2023 The meson-python developers
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
import sys
6+
7+
from mesonbuild import mesonmain
8+
9+
10+
if 'setup' in sys.argv:
11+
sys.argv.append('-Dcustom-meson-used=true')
12+
13+
14+
if __name__ == '__main__':
15+
sys.exit(mesonmain.main())

tests/test_wheel.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,3 +334,9 @@ def test_install_subdir(wheel_install_subdir):
334334
'nested/deep/deep.py',
335335
'nested/nested.py',
336336
}
337+
338+
339+
def test_vendored_meson(wheel_vendored_meson):
340+
# This test will error if the vendored meson.py wrapper script in
341+
# the test package isn't used.
342+
pass

0 commit comments

Comments
 (0)