summaryrefslogtreecommitdiffstats
path: root/lib/bb/tests
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2019-01-18 21:45:55 +0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-01-18 17:05:56 +0000
commitbe022085fe1ea1b9a9d519f0455883e2da363d2c (patch)
treea9d5b83bbd1507f129f74952ec7ffcf20208b760 /lib/bb/tests
parentdf2ac65370aa86cdbc1574fdede25e3519410e45 (diff)
downloadbitbake-be022085fe1ea1b9a9d519f0455883e2da363d2c.tar.gz
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@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/tests')
-rw-r--r--lib/bb/tests/codeparser.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/bb/tests/codeparser.py b/lib/bb/tests/codeparser.py
index e30e78c15..3fd76a8f9 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")