summaryrefslogtreecommitdiffstats
path: root/external/poky/bitbake/lib/bb/tests/codeparser.py
diff options
context:
space:
mode:
Diffstat (limited to 'external/poky/bitbake/lib/bb/tests/codeparser.py')
-rw-r--r--external/poky/bitbake/lib/bb/tests/codeparser.py22
1 files changed, 8 insertions, 14 deletions
diff --git a/external/poky/bitbake/lib/bb/tests/codeparser.py b/external/poky/bitbake/lib/bb/tests/codeparser.py
index e30e78c1..826a2d2f 100644
--- a/external/poky/bitbake/lib/bb/tests/codeparser.py
+++ b/external/poky/bitbake/lib/bb/tests/codeparser.py
@@ -1,23 +1,10 @@
-# ex:ts=4:sw=4:sts=4:et
-# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# BitBake Test for codeparser.py
#
# Copyright (C) 2010 Chris Larson
# Copyright (C) 2012 Richard Purdie
#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# SPDX-License-Identifier: GPL-2.0-only
#
import unittest
@@ -123,6 +110,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")