aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-12-26 13:24:30 +0200
committerGitHub <noreply@github.com>2017-12-26 13:24:30 +0200
commitac8d6087bfe1a2dacbd13d6cc9c4c526fc997fb5 (patch)
treefb443ccd4bdfa44670cc78a6b14b386cdf625a7a /run_unittests.py
parent1806aac37669fe5b4a50175b7b8298f119248be3 (diff)
parenta5507404ab24c307b1ca5127b59e73759790746a (diff)
downloadmeson-ac8d6087bfe1a2dacbd13d6cc9c4c526fc997fb5.zip
meson-ac8d6087bfe1a2dacbd13d6cc9c4c526fc997fb5.tar.gz
meson-ac8d6087bfe1a2dacbd13d6cc9c4c526fc997fb5.tar.bz2
Merge pull request #2334 from mesonbuild/promotedep
Add functionality to promote nested dependencies to top level.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 1387130..cf229da 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)
@@ -1682,6 +1683,30 @@ 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))
+ promoted_wrap = os.path.join(spdir, 'athing.wrap')
+ self.assertFalse(os.path.isfile(promoted_wrap))
+ subprocess.check_call(self.wrap_command + ['promote', 'athing'], cwd=workdir)
+ self.assertTrue(os.path.isfile(promoted_wrap))
+ self.init(workdir)
+ self.build()
+
class FailureTests(BasePlatformTests):
'''