aboutsummaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorDaniel Carson <danielcarson271@gmail.com>2022-06-27 16:04:48 -0400
committerEli Schwartz <eschwartz93@gmail.com>2022-09-18 22:48:50 -0400
commit004575874ffdb77ee997f9c19e0a041d144994d6 (patch)
tree939353cff137c4718bbf19d7756f0c040c9bc5a9 /unittests
parent97f248db24fe88495dbe35bbae6eafd643c0c94b (diff)
downloadmeson-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.py18
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')