summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests
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
parentb50b14e37249fb23b8e4f3a86f9b245cba85ca86 (diff)
downloadpoky-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')
-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"
68 with self.assertRaises(bb.parse.ParseError): 68 with self.assertRaises(bb.parse.ParseError):
69 d = bb.parse.handle(f.name, self.d)[''] 69 d = bb.parse.handle(f.name, self.d)['']
70 70
71 unsettest = """
72A = "1"
73B = "2"
74B[flag] = "3"
75
76unset A
77unset B[flag]
78"""
79
80 def test_parse_unset(self):
81 f = self.parsehelper(self.unsettest)
82 d = bb.parse.handle(f.name, self.d)['']
83 self.assertEqual(d.getVar("A", True), None)
84 self.assertEqual(d.getVarFlag("A","flag", True), None)
85 self.assertEqual(d.getVar("B", True), "2")
86
87
71 overridetest = """ 88 overridetest = """
72RRECOMMENDS_${PN} = "a" 89RRECOMMENDS_${PN} = "a"
73RRECOMMENDS_${PN}_libc = "b" 90RRECOMMENDS_${PN}_libc = "b"