aboutsummaryrefslogtreecommitdiff
path: root/unittests/platformagnostictests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2024-04-14 12:58:30 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2025-02-13 15:26:44 +0200
commit518c732ea9b0f1975f6f28accff3286be4106538 (patch)
tree2be9544828545a2f9f0676efc6eb82ac197ec4bd /unittests/platformagnostictests.py
parentea678ed82938ceac00682b2695b57193d36b71b4 (diff)
downloadmeson-optionrefactor3.zip
meson-optionrefactor3.tar.gz
meson-optionrefactor3.tar.bz2
Make all Meson level options overridable per subproject.optionrefactor3
Diffstat (limited to 'unittests/platformagnostictests.py')
-rw-r--r--unittests/platformagnostictests.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/unittests/platformagnostictests.py b/unittests/platformagnostictests.py
index 7c382cf..f787805 100644
--- a/unittests/platformagnostictests.py
+++ b/unittests/platformagnostictests.py
@@ -37,7 +37,7 @@ class PlatformAgnosticTests(BasePlatformTests):
self.init(testdir, workdir=testdir)
def test_invalid_option_names(self):
- store = OptionStore()
+ store = OptionStore(False)
interp = OptionInterpreter(store, '')
def write_file(code: str):
@@ -71,7 +71,7 @@ class PlatformAgnosticTests(BasePlatformTests):
def test_option_validation(self):
"""Test cases that are not catch by the optinterpreter itself."""
- store = OptionStore()
+ store = OptionStore(False)
interp = OptionInterpreter(store, '')
def write_file(code: str):
@@ -173,16 +173,16 @@ class PlatformAgnosticTests(BasePlatformTests):
# Change backend option is not allowed
with self.assertRaises(subprocess.CalledProcessError) as cm:
self.setconf('-Dbackend=none')
- self.assertIn("ERROR: Tried modify read only option 'backend'", cm.exception.stdout)
+ self.assertIn("ERROR: Tried to modify read only option 'backend'", cm.exception.stdout)
- # Reconfigure with a different backend is not allowed
- with self.assertRaises(subprocess.CalledProcessError) as cm:
- self.init(testdir, extra_args=['--reconfigure', '--backend=none'])
- self.assertIn("ERROR: Tried modify read only option 'backend'", cm.exception.stdout)
+ # Check that the new value was not written in the store.
+ self.assertEqual(self.getconf('backend'), 'ninja')
# Wipe with a different backend is allowed
self.init(testdir, extra_args=['--wipe', '--backend=none'])
+ self.assertEqual(self.getconf('backend'), 'none')
+
def test_validate_dirs(self):
testdir = os.path.join(self.common_test_dir, '1 trivial')
@@ -407,10 +407,10 @@ class PlatformAgnosticTests(BasePlatformTests):
self.assertIn('\nMessage: c_std: c89\n', out)
out = self.init(testdir, extra_args=['--reconfigure', '-Db_ndebug=if-release', '-Dsub:b_ndebug=false', '-Dc_std=c99', '-Dsub:c_std=c11'])
- self.assertIn('\nMessage: b_ndebug: if-release\n', out)
- self.assertIn('\nMessage: c_std: c99\n', out)
- self.assertIn('\nsub| Message: b_ndebug: false\n', out)
- self.assertIn('\nsub| Message: c_std: c11\n', out)
+ self.assertIn('\n b_ndebug : if-release\n', out)
+ self.assertIn('\n c_std : c99\n', out)
+ self.assertIn('\n sub:b_ndebug: false\n', out)
+ self.assertIn('\n sub:c_std : c11\n', out)
def test_setup_with_unknown_option(self):
testdir = os.path.join(self.common_test_dir, '1 trivial')