aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2019-01-22 22:41:50 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2019-01-23 19:50:50 +0530
commitd02ec7111ef3447d7807827e8c9afa93e680ee18 (patch)
tree01d3fbd519383e857f0220cb6dbf594fd6850412 /run_unittests.py
parent379b42c5b18cd94feded28791a5189ee253ba04e (diff)
downloadmeson-d02ec7111ef3447d7807827e8c9afa93e680ee18.zip
meson-d02ec7111ef3447d7807827e8c9afa93e680ee18.tar.gz
meson-d02ec7111ef3447d7807827e8c9afa93e680ee18.tar.bz2
coredata: Only reject a load if major version differs
Our builddir ABI is stable across minor (stable) releases, so there is no need to force a wipe. We already release pretty often, no need to force people to wipe twice as often.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py24
1 files changed, 22 insertions, 2 deletions
diff --git a/run_unittests.py b/run_unittests.py
index e124614..ea5b310 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -2983,12 +2983,16 @@ recommended as it is not supported on some platforms''')
self.wipe()
self.init(testdir, extra_args=['-Dstart_native=true'])
- def __reconfigure(self):
+ def __reconfigure(self, change_minor=False):
# Set an older version to force a reconfigure from scratch
filename = os.path.join(self.privatedir, 'coredata.dat')
with open(filename, 'rb') as f:
obj = pickle.load(f)
- obj.version = '0.47.0'
+ if change_minor:
+ v = mesonbuild.coredata.version.split('.')
+ obj.version = '.'.join(v[0:2] + [str(int(v[2]) + 1)])
+ else:
+ obj.version = '0.47.0'
with open(filename, 'wb') as f:
pickle.dump(obj, f)
@@ -3029,6 +3033,22 @@ recommended as it is not supported on some platforms''')
with Path(self.builddir):
self.init(testdir, extra_args=['--wipe'])
+ def test_minor_version_does_not_reconfigure_wipe(self):
+ testdir = os.path.join(self.unit_test_dir, '46 reconfigure')
+ self.init(testdir, extra_args=['-Dopt1=val1'])
+ self.setconf('-Dopt2=val2')
+
+ self.__reconfigure(change_minor=True)
+
+ out = self.init(testdir, extra_args=['--reconfigure', '-Dopt3=val3'])
+ self.assertNotRegex(out, 'WARNING:.*Regenerating configuration from scratch')
+ self.assertRegex(out, 'opt1 val1')
+ self.assertRegex(out, 'opt2 val2')
+ self.assertRegex(out, 'opt3 val3')
+ self.assertRegex(out, 'opt4 default4')
+ self.build()
+ self.run_tests()
+
def test_target_construct_id_from_path(self):
# This id is stable but not guessable.
# The test is supposed to prevent unintentional