diff options
author | Simon McVittie <smcv@collabora.com> | 2022-09-05 10:54:25 +0100 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2022-09-05 10:54:25 +0100 |
commit | ab33ebefc5ca34486509e3a87591ad2e883b9549 (patch) | |
tree | 96284201c8cf83ef8d50243cb753b24d8da6717d /subprojects/dbus-gmain/tests/use-as-subproject.py | |
parent | f83a62c27203553c04c375ff663d9d99273670c9 (diff) | |
parent | 93e8fced640e29bd6fbcc066a6c854a8dd74f8ab (diff) | |
download | dbus-python-ab33ebefc5ca34486509e3a87591ad2e883b9549.tar.gz |
Merge dbus-gmain commit '93e8fced640e29bd6fbcc066a6c854a8dd74f8ab'
Diffstat (limited to 'subprojects/dbus-gmain/tests/use-as-subproject.py')
-rw-r--r-- | subprojects/dbus-gmain/tests/use-as-subproject.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/subprojects/dbus-gmain/tests/use-as-subproject.py b/subprojects/dbus-gmain/tests/use-as-subproject.py new file mode 100644 index 0000000..3f45c5b --- /dev/null +++ b/subprojects/dbus-gmain/tests/use-as-subproject.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 +# Copyright 2022 Collabora Ltd. +# SPDX-License-Identifier: MIT + +import os +import shutil +import subprocess +import tempfile + +HERE = os.path.dirname(os.path.abspath(__file__)) + +if __name__ == '__main__': + if shutil.which('meson') is None: + print('SKIP: meson not found in PATH') + raise SystemExit(0) + + with tempfile.TemporaryDirectory() as temp: + shutil.copytree( + os.path.join(HERE, 'use-as-subproject'), + os.path.join(temp, 'src'), + ) + os.makedirs(os.path.join(temp, 'src', 'subprojects'), exist_ok=True) + os.symlink( + os.path.dirname(HERE), + os.path.join(temp, 'src', 'subprojects', 'dbus-gmain'), + ) + subprocess.run( + ['meson', os.path.join(temp, 'src'), os.path.join(temp, 'build')], + check=True, + ) + subprocess.run( + ['meson', 'compile', '-C', os.path.join(temp, 'build')], + check=True, + ) |