aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests/parse.py
diff options
context:
space:
mode:
authorJérémy Rosen <jeremy.rosen@smile.fr>2016-08-16 14:04:47 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-18 10:06:26 +0100
commit0eb6d709b6c38aa27f33d8b0ef977a33350f0d75 (patch)
treef4b503fb079669fdc021f9b7a78f6d814862d7f4 /bitbake/lib/bb/tests/parse.py
parentb50b14e37249fb23b8e4f3a86f9b245cba85ca86 (diff)
downloadopenembedded-core-contrib-0eb6d709b6c38aa27f33d8b0ef977a33350f0d75.tar.gz
bitbake: ast/ConfHandler: Add a syntax to clear variable
unset VAR will clear variable VAR unset VAR[flag] will clear flag "flag" from var VAR (Bitbake rev: bedbd46ece8d1285b5cd2ea07dc64b4875b479aa) Signed-off-by: Jérémy Rosen <jeremy.rosen@openwide.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/tests/parse.py')
-rw-r--r--bitbake/lib/bb/tests/parse.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/parse.py b/bitbake/lib/bb/tests/parse.py
index c296db2013..0b2706af02 100644
--- a/bitbake/lib/bb/tests/parse.py
+++ b/bitbake/lib/bb/tests/parse.py
@@ -68,6 +68,23 @@ C = "3"
with self.assertRaises(bb.parse.ParseError):
d = bb.parse.handle(f.name, self.d)['']
+ unsettest = """
+A = "1"
+B = "2"
+B[flag] = "3"
+
+unset A
+unset B[flag]
+"""
+
+ def test_parse_unset(self):
+ f = self.parsehelper(self.unsettest)
+ d = bb.parse.handle(f.name, self.d)['']
+ self.assertEqual(d.getVar("A", True), None)
+ self.assertEqual(d.getVarFlag("A","flag", True), None)
+ self.assertEqual(d.getVar("B", True), "2")
+
+
overridetest = """
RRECOMMENDS_${PN} = "a"
RRECOMMENDS_${PN}_libc = "b"