diff options
author | Jérémy Rosen <jeremy.rosen@smile.fr> | 2016-08-16 14:04:47 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-18 10:06:26 +0100 |
commit | 0eb6d709b6c38aa27f33d8b0ef977a33350f0d75 (patch) | |
tree | f4b503fb079669fdc021f9b7a78f6d814862d7f4 /bitbake/lib/bb/tests/parse.py | |
parent | b50b14e37249fb23b8e4f3a86f9b245cba85ca86 (diff) | |
download | poky-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.py | 17 |
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 = """ | ||
72 | A = "1" | ||
73 | B = "2" | ||
74 | B[flag] = "3" | ||
75 | |||
76 | unset A | ||
77 | unset 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 = """ |
72 | RRECOMMENDS_${PN} = "a" | 89 | RRECOMMENDS_${PN} = "a" |
73 | RRECOMMENDS_${PN}_libc = "b" | 90 | RRECOMMENDS_${PN}_libc = "b" |