aboutsummaryrefslogtreecommitdiffstats
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:04:01 +0100
commit4ac388646624e08bef848b560fa52deacf2ff4fb (patch)
treeba1d03cf5d591675f3c235231a38ba9cb053a27f
parentb1ad36169c2ad189d84c53c707b66c12d5ff812f (diff)
downloadbitbake-4ac388646624e08bef848b560fa52deacf2ff4fb.tar.gz
tests/parse.py: Add testcase for addtask and deltask
Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/tests/parse.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/bb/tests/parse.py b/lib/bb/tests/parse.py
index 1bc47405d..4467d1799 100644
--- a/lib/bb/tests/parse.py
+++ b/lib/bb/tests/parse.py
@@ -187,3 +187,21 @@ python () {
self.assertEqual(d1.getVar("VAR_var"), "B")
self.assertEqual(d2.getVar("VAR_var"), None)
+ addtask_deltask = """
+addtask do_patch after do_foo after do_unpack before do_configure before do_compile
+addtask do_fetch do_patch
+
+deltask do_fetch do_patch
+"""
+ def test_parse_addtask_deltask(self):
+ import sys
+ f = self.parsehelper(self.addtask_deltask)
+ d = bb.parse.handle(f.name, self.d)['']
+
+ stdout = sys.stdout.getvalue()
+ self.assertTrue("addtask contained multiple 'before' keywords" in stdout)
+ self.assertTrue("addtask contained multiple 'after' keywords" in stdout)
+ self.assertTrue('addtask ignored: " do_patch"' in stdout)
+ self.assertTrue('deltask ignored: " do_patch"' in stdout)
+ self.assertTrue('dependent task do_foo does not exist' in stdout)
+