diff options
Diffstat (limited to 'tests/use-as-subproject.py')
-rw-r--r-- | tests/use-as-subproject.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/use-as-subproject.py b/tests/use-as-subproject.py new file mode 100644 index 0000000..3f45c5b --- /dev/null +++ b/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, + ) |