[bitbake-devel,V2,3/3] bitbake: tests/parse.py: Add testcase for addtask and deltask

Submitted by Robert Yang on April 29, 2019, 8:12 a.m. | Patch ID: 160756

Details

Message ID a8c7d2e3f56778157c889e0a9686668f61f2c333.1556525357.git.liezhi.yang@windriver.com
State New
Headers show

Commit Message

Robert Yang April 29, 2019, 8:12 a.m.
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 bitbake/lib/bb/tests/parse.py | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Patch hide | download patch | download mbox

diff --git a/bitbake/lib/bb/tests/parse.py b/bitbake/lib/bb/tests/parse.py
index 1bc4740..4467d17 100644
--- a/bitbake/lib/bb/tests/parse.py
+++ b/bitbake/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)
+