]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: tests.data: Add underscore+numeric in overrides datastore test
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 7 Jan 2019 15:11:39 +0000 (15:11 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 8 Jan 2019 11:16:03 +0000 (11:16 +0000)
Add a test for x86_64 in overrides where is was being incorrectly handled.
There was a previous fix (3a3be518536acc868c7eeb3c1111ad1b321480b7) but
this ensures we don't regress.

(Bitbake rev: 08c314eac231ac9292c8c95f1c5a6fc2023fe749)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/tests/data.py

index db3e2010a92df29f3df58062e8d3e59202fc8616..3c511f214bba59949d0d61f05f2580c0f8cb9ce2 100644 (file)
@@ -394,6 +394,15 @@ class TestOverrides(unittest.TestCase):
         self.d.setVar("OVERRIDES", "foo:bar:some_val")
         self.assertEqual(self.d.getVar("TEST"), " testvalue5")
 
+    # Test an override with _<numeric> in it based on a real world OE issue
+    def test_underscore_override(self):
+        self.d.setVar("TARGET_ARCH", "x86_64")
+        self.d.setVar("PN", "test-${TARGET_ARCH}")
+        self.d.setVar("VERSION", "1")
+        self.d.setVar("VERSION_pn-test-${TARGET_ARCH}", "2")
+        self.d.setVar("OVERRIDES", "pn-${PN}")
+        bb.data.expandKeys(self.d)
+        self.assertEqual(self.d.getVar("VERSION"), "2")
 
 class TestKeyExpansion(unittest.TestCase):
     def setUp(self):