diff options
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py index dc2429a..e5011c3 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -1902,6 +1902,29 @@ class FailureTests(BasePlatformTests): return raise unittest.SkipTest("objc and objcpp found, can't test detection failure") + def test_subproject_variables(self): + ''' + Test that: + 1. The correct message is outputted when a not-required dep is not + found and the fallback subproject is also not found. + 2. A not-found not-required dep with a fallback subproject outputs the + correct message when the fallback subproject is found but the + variable inside it is not. + 3. A fallback dependency is found from the subproject parsed in (2) + 4. A not-required fallback dependency is not found because the + subproject failed to parse. + ''' + tdir = os.path.join(self.unit_test_dir, '20 subproj dep variables') + out = self.init(tdir, inprocess=True) + self.assertRegex(out, r"Also couldn't find a fallback subproject " + "in.*subprojects.*nosubproj.*for the dependency.*somedep") + self.assertRegex(out, r'Dependency.*somenotfounddep.*from subproject.*' + 'subprojects.*somesubproj.*found:.*NO') + self.assertRegex(out, r'Dependency.*zlibproxy.*from subproject.*' + 'subprojects.*somesubproj.*found:.*YES.*(cached)') + self.assertRegex(out, r'Also couldn\'t find a fallback subproject in ' + '.*subprojects.*failingsubproj.*for the dependency.*somedep') + class WindowsTests(BasePlatformTests): ''' |