aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@igalia.com>2018-07-13 13:29:41 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2018-08-27 21:37:18 +0300
commit731906504efb57aa9ae86685501f1d3a0aa22121 (patch)
treef85fe896a96cee352dae1d887f690eaabf8c761b /run_unittests.py
parent899b0aae9f9afacccfd5963e84df6634e9835b5c (diff)
downloadmeson-731906504efb57aa9ae86685501f1d3a0aa22121.zip
meson-731906504efb57aa9ae86685501f1d3a0aa22121.tar.gz
meson-731906504efb57aa9ae86685501f1d3a0aa22121.tar.bz2
Add a `required` argument to `subproject`
Allowing to use the new "feature" option type and allowing not to fail on subproject if it is not necessary to fail. By default subprojects are "required" so previous behaviour is not changed. Fixes #3880
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 5da2798..ebead66 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -2848,6 +2848,16 @@ class FailureTests(BasePlatformTests):
msg = '.*WARNING:.*feature.*build_always_stale.*custom_target.*'
self.assertMesonDoesNotOutput(vcs_tag, msg, meson_version='>=0.43')
+ def test_missing_subproject_not_required_and_required(self):
+ self.assertMesonRaises("sub1 = subproject('not-found-subproject', required: false)\n" +
+ "sub2 = subproject('not-found-subproject', required: true)",
+ """.*Subproject "subprojects/not-found-subproject" required but not found.*""")
+
+ def test_get_variable_on_not_found_project(self):
+ self.assertMesonRaises("sub1 = subproject('not-found-subproject', required: false)\n" +
+ "sub1.get_variable('naaa')",
+ """Subproject "subprojects/not-found-subproject" disabled can't get_variable on it.""")
+
class WindowsTests(BasePlatformTests):
'''