diff options
author | Daniel Carson <danielcarson271@gmail.com> | 2022-06-27 16:04:48 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-09-18 22:48:50 -0400 |
commit | 004575874ffdb77ee997f9c19e0a041d144994d6 (patch) | |
tree | 939353cff137c4718bbf19d7756f0c040c9bc5a9 /unittests | |
parent | 97f248db24fe88495dbe35bbae6eafd643c0c94b (diff) | |
download | meson-004575874ffdb77ee997f9c19e0a041d144994d6.zip meson-004575874ffdb77ee997f9c19e0a041d144994d6.tar.gz meson-004575874ffdb77ee997f9c19e0a041d144994d6.tar.bz2 |
Warn if wrap file changes
Save off the hash of the wrap file when first configuring a subproject.
When reconfiguring a subproject, check the hash of the wrap file
against the stored hash. If they don't match then warn the user.
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/allplatformstests.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py index 8e0f934..7f0dd44 100644 --- a/unittests/allplatformstests.py +++ b/unittests/allplatformstests.py @@ -3733,10 +3733,26 @@ class AllPlatformTests(BasePlatformTests): patch_directory = wrap_git_builddef revision = master '''.format(upstream_uri))) - self.init(srcdir) + out = self.init(srcdir) self.build() self.run_tests() + # Make sure the warning does not occur on the first init. + out_of_date_warning = 'revision may be out of date' + self.assertNotIn(out_of_date_warning, out) + + # Change the wrap's revisions, reconfigure, and make sure it does + # warn on the reconfigure. + with open(os.path.join(srcdir, 'subprojects', 'wrap_git.wrap'), 'w', encoding='utf-8') as f: + f.write(textwrap.dedent(''' + [wrap-git] + url = {} + patch_directory = wrap_git_builddef + revision = not-master + '''.format(upstream_uri))) + out = self.init(srcdir, extra_args='--reconfigure') + self.assertIn(out_of_date_warning, out) + def test_extract_objects_custom_target_no_warning(self): testdir = os.path.join(self.common_test_dir, '22 object extraction') |