summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2019-04-29 16:12:00 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-04-30 12:05:24 +0100
commitc761fb126dd9e25b3690be2ce6d317e0ee6cb2b0 (patch)
treef81ddb4579e678528096e4c4aa6d3af7f9f50d9f /bitbake
parente236735d4520fc25a615ed92097fb04ed19f85ba (diff)
downloadpoky-c761fb126dd9e25b3690be2ce6d317e0ee6cb2b0.tar.gz
bitbake: tests/parse.py: Add testcase for addtask and deltask
(Bitbake rev: 4ac388646624e08bef848b560fa52deacf2ff4fb) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/tests/parse.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/parse.py b/bitbake/lib/bb/tests/parse.py
index 1bc47405d9..4467d17997 100644
--- a/bitbake/lib/bb/tests/parse.py
+++ b/bitbake/lib/bb/tests/parse.py
@@ -187,3 +187,21 @@ python () {
187 self.assertEqual(d1.getVar("VAR_var"), "B") 187 self.assertEqual(d1.getVar("VAR_var"), "B")
188 self.assertEqual(d2.getVar("VAR_var"), None) 188 self.assertEqual(d2.getVar("VAR_var"), None)
189 189
190 addtask_deltask = """
191addtask do_patch after do_foo after do_unpack before do_configure before do_compile
192addtask do_fetch do_patch
193
194deltask do_fetch do_patch
195"""
196 def test_parse_addtask_deltask(self):
197 import sys
198 f = self.parsehelper(self.addtask_deltask)
199 d = bb.parse.handle(f.name, self.d)['']
200
201 stdout = sys.stdout.getvalue()
202 self.assertTrue("addtask contained multiple 'before' keywords" in stdout)
203 self.assertTrue("addtask contained multiple 'after' keywords" in stdout)
204 self.assertTrue('addtask ignored: " do_patch"' in stdout)
205 self.assertTrue('deltask ignored: " do_patch"' in stdout)
206 self.assertTrue('dependent task do_foo does not exist' in stdout)
207