[oe-commits] [bitbake] 02/02: bb.tests.codeparser: add parameter expansion modifiers test

git at git.openembedded.org git at git.openembedded.org
Fri Jan 18 17:59:59 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

commit be022085fe1ea1b9a9d519f0455883e2da363d2c
Author: Christopher Larson <chris_larson at mentor.com>
AuthorDate: Fri Jan 18 21:45:55 2019 +0500

    bb.tests.codeparser: add parameter expansion modifiers test
    
    We don't want references including shell parameter expansion modifiers
    (i.e. `:-`, `#`, `%%`, etc) to be added to our vardeps, so add a test to
    ensure this.
    
    YOCTO #12987
    
    Signed-off-by: Christopher Larson <chris_larson at mentor.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/tests/codeparser.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/bb/tests/codeparser.py b/lib/bb/tests/codeparser.py
index e30e78c..3fd76a8 100644
--- a/lib/bb/tests/codeparser.py
+++ b/lib/bb/tests/codeparser.py
@@ -123,6 +123,13 @@ ${D}${libdir}/pkgconfig/*.pc
         self.parseExpression("sed -i -e 's:IP{:I${:g' $pc")
         self.assertExecs(set(["sed"]))
 
+    def test_parameter_expansion_modifiers(self):
+        # - and + are also valid modifiers for parameter expansion, but are
+        # valid characters in bitbake variable names, so are not included here
+        for i in ('=', ':-', ':=', '?', ':?', ':+', '#', '%', '##', '%%'):
+            name = "foo%sbar" % i
+            self.parseExpression("${%s}" % name)
+            self.assertNotIn(name, self.references)
 
     def test_until(self):
         self.parseExpression("until false; do echo true; done")

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list