From 731906504efb57aa9ae86685501f1d3a0aa22121 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Fri, 13 Jul 2018 13:29:41 -0400 Subject: 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 --- run_unittests.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'run_unittests.py') 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): ''' -- cgit v1.1