diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2025-04-02 09:19:41 -0700 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-04-08 10:00:16 -0700 |
| commit | 9d1837e1afc919d18645c8fd6788cf44ac7d078d (patch) | |
| tree | ef79e6e1079b4a570cd836744a098941533b09fa | |
| parent | 768712cf32e82ee9e82e6d567f2a39677b48e46c (diff) | |
| download | meson-9d1837e1afc919d18645c8fd6788cf44ac7d078d.tar.gz | |
tests: Add a rewriter test that handles prefix
"prefix" has a lot of special handling that has to go on because so many
other options depend on prefix. It was also regressed by the option
refactor changes, so having a test feels appropriate.
This was verified against the 1.7 release, so it has the same behavior
as pre-option refactor Meson.
| -rw-r--r-- | test cases/rewrite/7 prefix/meson.build | 5 | ||||
| -rw-r--r-- | unittests/rewritetests.py | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/test cases/rewrite/7 prefix/meson.build b/test cases/rewrite/7 prefix/meson.build new file mode 100644 index 000000000..563d7d7c9 --- /dev/null +++ b/test cases/rewrite/7 prefix/meson.build @@ -0,0 +1,5 @@ +project('lalala', 'cpp', + default_options : [ + 'prefix=/export/doocs', + ], +) diff --git a/unittests/rewritetests.py b/unittests/rewritetests.py index bfb270f04..dfd69c83a 100644 --- a/unittests/rewritetests.py +++ b/unittests/rewritetests.py @@ -407,3 +407,18 @@ class RewriterTests(BasePlatformTests): # Do it line per line because it is easier to debug like that for orig_line, new_line in zip_longest(original_contents.splitlines(), new_contents.splitlines()): self.assertEqual(orig_line, new_line) + + @unittest.expectedFailure + def test_rewrite_prefix(self) -> None: + self.prime('7 prefix') + out = self.rewrite_raw(self.builddir, ['kwargs', 'info', 'project', '/']) + expected = { + 'kwargs': { + 'project#/': { + "default_options": [ + 'prefix=/export/doocs' + ] + } + } + } + self.assertDictEqual(out, expected) |
