summaryrefslogtreecommitdiffstats
path: root/bitbake
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-21 23:44:34 +0000
commit6fd870e6a1f61d17e43cf30db4259a939db93820 (patch)
treec3e7d18f05eb0d7ab5b339f49ecab43789170942 /bitbake
parent7178c69ea26b0887624b470db677050ac6603d7e (diff)
downloadpoky-6fd870e6a1f61d17e43cf30db4259a939db93820.tar.gz
bitbake: 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 (Bitbake rev: be022085fe1ea1b9a9d519f0455883e2da363d2c) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/tests/codeparser.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/codeparser.py b/bitbake/lib/bb/tests/codeparser.py
index e30e78c158..3fd76a8f9f 100644
--- a/bitbake/lib/bb/tests/codeparser.py
+++ b/bitbake/lib/bb/tests/codeparser.py
@@ -123,6 +123,13 @@ ${D}${libdir}/pkgconfig/*.pc
123 self.parseExpression("sed -i -e 's:IP{:I${:g' $pc") 123 self.parseExpression("sed -i -e 's:IP{:I${:g' $pc")
124 self.assertExecs(set(["sed"])) 124 self.assertExecs(set(["sed"]))
125 125
126 def test_parameter_expansion_modifiers(self):
127 # - and + are also valid modifiers for parameter expansion, but are
128 # valid characters in bitbake variable names, so are not included here
129 for i in ('=', ':-', ':=', '?', ':?', ':+', '#', '%', '##', '%%'):
130 name = "foo%sbar" % i
131 self.parseExpression("${%s}" % name)
132 self.assertNotIn(name, self.references)
126 133
127 def test_until(self): 134 def test_until(self):
128 self.parseExpression("until false; do echo true; done") 135 self.parseExpression("until false; do echo true; done")