Skip to content

Commit

Permalink
TST: test the use of a custom meson.py script
Browse files Browse the repository at this point in the history
  • Loading branch information
rgommers committed Sep 12, 2023
1 parent d729425 commit db93d14
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/packages/vendored-meson/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-FileCopyrightText: 2023 The meson-python developers
#
# SPDX-License-Identifier: MIT

project('vendored-meson', version: '1.0.0')

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

#py.install_sources('pure.py')

if not get_option('custom-cli-used')
error('Expected option "custom-cli-used" was not specified')
endif
5 changes: 5 additions & 0 deletions tests/packages/vendored-meson/meson_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-FileCopyrightText: 2023 The meson-python developers
#
# SPDX-License-Identifier: MIT

option('custom-cli-used', type: 'boolean', value: false)
10 changes: 10 additions & 0 deletions tests/packages/vendored-meson/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# SPDX-FileCopyrightText: 2023 The meson-python developers
#
# SPDX-License-Identifier: MIT

[build-system]
build-backend = 'mesonpy'
requires = ['meson-python']

[tool.meson-python]
meson = 'third-party/meson.py'
15 changes: 15 additions & 0 deletions tests/packages/vendored-meson/third-party/meson.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# SPDX-FileCopyrightText: 2023 The meson-python developers
#
# SPDX-License-Identifier: MIT

import sys

from mesonbuild import mesonmain


if 'setup' in sys.argv:
sys.argv.append('-Dcustom-cli-used=true')


if __name__ == '__main__':
sys.exit(mesonmain.main())
6 changes: 6 additions & 0 deletions tests/test_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,3 +333,9 @@ def test_install_subdir(wheel_install_subdir):
'nested/deep/deep.py',
'nested/nested.py',
}


def test_vendored_meson(wheel_vendored_meson):
# This test will error if the vendored meson.py wrapper script in
# the test package isn't used.
pass

0 comments on commit db93d14

Please sign in to comment.