diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2023-03-30 09:29:27 -0400 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2023-08-25 09:43:24 -0400 |
commit | e3a71a7b58ac559f8669ca6fa95617a537b47f98 (patch) | |
tree | b75a9a8c65ea3196bd743bb85b7d1a879c3d0c6a /unittests/platformagnostictests.py | |
parent | 1bb29b1b329ec056c61a54070024b6b003cf5ca4 (diff) | |
download | meson-e3a71a7b58ac559f8669ca6fa95617a537b47f98.zip meson-e3a71a7b58ac559f8669ca6fa95617a537b47f98.tar.gz meson-e3a71a7b58ac559f8669ca6fa95617a537b47f98.tar.bz2 |
msetup: Update options when builddir is already configured
`meson setup -Dfoo=bar builddir` command was returning success ignoring
new option values.
This now also update options. It is useful because it means
`meson setup -Dfoo=bar builddir && ninja -C builddir` works regardless
whether builddir already exists or not, and when done in a script,
changing options in the script will automatically trigger a reconfigure
if needed. This was already possible by always passing --reconfigure
argument, but that triggers a reconfigure even when options did not
change.
Diffstat (limited to 'unittests/platformagnostictests.py')
-rw-r--r-- | unittests/platformagnostictests.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/unittests/platformagnostictests.py b/unittests/platformagnostictests.py index fd01293..efe3109 100644 --- a/unittests/platformagnostictests.py +++ b/unittests/platformagnostictests.py @@ -183,6 +183,13 @@ class PlatformAgnosticTests(BasePlatformTests): Path(self.builddir, 'dummy').touch() self.init(testdir, extra_args=['--reconfigure']) + # Setup a valid builddir should update options but not reconfigure + self.assertEqual(self.getconf('buildtype'), 'debug') + o = self.init(testdir, extra_args=['-Dbuildtype=release']) + self.assertIn('Directory already configured', o) + self.assertNotIn('The Meson build system', o) + self.assertEqual(self.getconf('buildtype'), 'release') + # Wipe of empty builddir should work self.new_builddir() self.init(testdir, extra_args=['--wipe']) |