diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2020-10-10 10:45:34 -0400 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2020-10-13 11:12:49 +0000 |
commit | dccff1f2bcf6e7b8e42fa7bea63b8532ad29b43a (patch) | |
tree | b82b3c81ab0b4faccc170dde067ff655dca07c40 /run_unittests.py | |
parent | 3ade5bbd92b506f215f86a7d41048b22b287c673 (diff) | |
download | meson-dccff1f2bcf6e7b8e42fa7bea63b8532ad29b43a.zip meson-dccff1f2bcf6e7b8e42fa7bea63b8532ad29b43a.tar.gz meson-dccff1f2bcf6e7b8e42fa7bea63b8532ad29b43a.tar.bz2 |
msubprojects: Handle wrap-file to wrap-git case
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py index 881b781..1601730 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -9151,6 +9151,20 @@ class SubprojectsCommandTests(BasePlatformTests): self.assertEqual(self._git_local_branch(subp_name), '') self.assertEqual(self._git_local_commit(subp_name), new_commit) + # Create a local project not in a git repository, then update it with + # a git wrap. Without --reset it should print error message and return + # failure. With --reset it should delete existing project and clone the + # new project. + subp_name = 'sub2' + self._create_project(self.subprojects_dir / subp_name) + self._git_create_remote_repo(subp_name) + self._wrap_create_git(subp_name) + with self.assertRaises(subprocess.CalledProcessError) as cm: + self._subprojects_cmd(['update']) + self.assertIn('Not a git repository', cm.exception.output) + self._subprojects_cmd(['update', '--reset']) + self.assertEqual(self._git_local_commit(subp_name), self._git_remote_commit(subp_name)) + @skipIfNoExecutable('true') def test_foreach(self): self._create_project(self.subprojects_dir / 'sub_file') |