aboutsummaryrefslogtreecommitdiff
path: root/unittests/allplatformstests.py
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2022-07-16 00:56:30 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2022-07-31 20:43:27 +0300
commitf774609b09c483d6632bfa77fb9403c0fa9927f8 (patch)
tree1b149d2275f53a48847677908ee7b62274de7ed9 /unittests/allplatformstests.py
parente5df70b8d3956e1c8a5d50defd000fbec8bf44a5 (diff)
downloadmeson-f774609b09c483d6632bfa77fb9403c0fa9927f8.zip
meson-f774609b09c483d6632bfa77fb9403c0fa9927f8.tar.gz
meson-f774609b09c483d6632bfa77fb9403c0fa9927f8.tar.bz2
Only reconfigure if configure options actually changed
Currently, if we run "meson configure -Doption=value", meson will do a reconfigure when running "ninja build" afterwards, even if the new value is the same one that was already configured previously. To avoid this unnecessary reconfigure, let's use replace_if_different() instead of unconditionally replacing the conf file in coredata's save() function.
Diffstat (limited to 'unittests/allplatformstests.py')
-rw-r--r--unittests/allplatformstests.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py
index 5179ce1..0ac47e7 100644
--- a/unittests/allplatformstests.py
+++ b/unittests/allplatformstests.py
@@ -4290,3 +4290,13 @@ class AllPlatformTests(BasePlatformTests):
self.init(testdir)
self.build()
+
+ def test_configure_same_noop(self):
+ testdir = os.path.join(self.unit_test_dir, '109 configure same noop')
+ self.init(testdir, extra_args=['-Dopt=val'])
+
+ filename = os.path.join(self.privatedir, 'coredata.dat')
+ oldmtime = os.path.getmtime(filename)
+ self.setconf(["-Dopt=val"])
+ newmtime = os.path.getmtime(filename)
+ self.assertEqual(oldmtime, newmtime)