aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-09-16 22:05:48 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2017-12-17 21:17:13 +0200
commit46c071ea5c36b153fdf7d388c580bfa1a26cf226 (patch)
tree9f5000bfcaad81d9bbf0622c9f796e8067132baf /run_unittests.py
parent202b2fedf300f62b8c1c3b52cd5320845038d85e (diff)
downloadmeson-46c071ea5c36b153fdf7d388c580bfa1a26cf226.zip
meson-46c071ea5c36b153fdf7d388c580bfa1a26cf226.tar.gz
meson-46c071ea5c36b153fdf7d388c580bfa1a26cf226.tar.bz2
Add functionality to promote nested dependencies to top level.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index d7d5ed0..f742624 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -468,6 +468,7 @@ class BasePlatformTests(unittest.TestCase):
self.mconf_command = meson_command + ['configure']
self.mintro_command = meson_command + ['introspect']
self.mtest_command = meson_command + ['test', '-C', self.builddir]
+ self.wrap_command = meson_command + ['wrap']
# Backend-specific build commands
self.build_command, self.clean_command, self.test_command, self.install_command, \
self.uninstall_command = get_backend_commands(self.backend)
@@ -1643,6 +1644,26 @@ int main(int argc, char **argv) {
self.setconf("-Dfree_array_opt=['a,b', 'c,d']", will_build=False)
self.opt_has('free_array_opt', ['a,b', 'c,d'])
+ def test_subproject_promotion(self):
+ testdir = os.path.join(self.unit_test_dir, '13 promote')
+ workdir = os.path.join(self.builddir, 'work')
+ shutil.copytree(testdir, workdir)
+ spdir = os.path.join(workdir, 'subprojects')
+ s3dir = os.path.join(spdir, 's3')
+ scommondir = os.path.join(spdir, 'scommon')
+ self.assertFalse(os.path.isdir(s3dir))
+ subprocess.check_call(self.wrap_command + ['promote', 's3'], cwd=workdir)
+ self.assertTrue(os.path.isdir(s3dir))
+ self.assertFalse(os.path.isdir(scommondir))
+ self.assertNotEqual(subprocess.call(self.wrap_command + ['promote', 'scommon'],
+ cwd=workdir,
+ stdout=subprocess.DEVNULL), 0)
+ self.assertFalse(os.path.isdir(scommondir))
+ subprocess.check_call(self.wrap_command + ['promote', 'subprojects/s2/subprojects/scommon'], cwd=workdir)
+ self.assertTrue(os.path.isdir(scommondir))
+ self.init(workdir)
+ self.build()
+
class FailureTests(BasePlatformTests):
'''