diff mbox series

[1/2] parse: add a (failing) test for a variable override with capital letters

Message ID 1791377513.8631fc262581453bbf619ec5b2062170.1a1166b9ac40003f66@vates.tech
State New
Headers show
Series [1/2] parse: add a (failing) test for a variable override with capital letters | expand

Commit Message

Yann Dirson Oct. 7, 2026, 12:51 p.m. UTC
Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
---
 lib/bb/tests/parse.py | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

Comments

Mathieu Dubois-Briand Oct. 8, 2026, 9:43 a.m. UTC | #1
On Wed Oct 7, 2026 at 2:51 PM CEST, Yann Dirson via lists.openembedded.org wrote:
> Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
> ---

Hi Yann,

Thanks for your patch.

This appears to be failing selftests:

FAIL: test_append_in_expanded_override (bb.tests.data.TestOverrides.test_append_in_expanded_override)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/srv/pokybuild/yocto-worker/oe-selftest-debian/build/layers/bitbake/lib/bb/tests/data.py", line 417, in test_append_in_expanded_override
    self.assertEqual(self.d.getVar("TEST"), "base appended")
AssertionError: 'base' != 'base appended'
- base
+ base appended

https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/5024
https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/5055
https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/4838

Can you have a look at the issue?

Thanks,
Mathieu
diff mbox series

Patch

diff --git a/lib/bb/tests/parse.py b/lib/bb/tests/parse.py
index 6ac2137e0..9fc094b16 100644
--- a/lib/bb/tests/parse.py
+++ b/lib/bb/tests/parse.py
@@ -150,6 +150,27 @@  exportD = "d"
         self.assertEqual(d.getVar("exportD"), "d")
         self.assertIsNone(d.getVarFlag("exportD", "export"))
 
+    mixedcase_pn_override = """
+PN = "${@bb.parse.vars_from_file(d.getVar('FILE', False), d)[0]}"
+OVERRIDES = "pn-${PN}"
+RPROVIDES:perl-ExtUtils-MakeMaker = "base"
+RPROVIDES:perl-ExtUtils-MakeMaker:append:pn-ExtUtils-MakeMaker = " text"
+"""
+
+    def test_parse_mixedcase_pn_override(self):
+        # Recipes named after CPAN distributions have mixed-case PNs, so
+        # OVERRIDES contains a mixed-case pn-${PN} entry. An operation
+        # guarded by that override must still be applied.
+        with tempfile.TemporaryDirectory() as tempdir:
+            recipe = os.path.join(tempdir, "ExtUtils-MakeMaker.bb")
+            with open(recipe, "w") as f:
+                f.write(self.mixedcase_pn_override)
+            os.chdir(tempdir)
+            d = bb.parse.handle(recipe, self.d)['']
+        self.assertEqual(d.getVar("PN"), "ExtUtils-MakeMaker")
+        self.assertIn("pn-ExtUtils-MakeMaker", d.getVar("OVERRIDES").split(":"))
+        self.assertEqual(d.getVar("RPROVIDES:perl-ExtUtils-MakeMaker"), "base text")
+
     overridetest = """
 RRECOMMENDS:${PN} = "a"
 RRECOMMENDS:${PN}:libc = "b"