[oe-commits] Costin Constantin : oeqa/recipetool: add useful failure messages to test cases

git at git.openembedded.org git at git.openembedded.org
Thu Jul 23 07:49:44 UTC 2015


Module: openembedded-core.git
Branch: master
Commit: e555646ecb1ee9c7b00ec22f0d40bdd9da1b4dfd
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=e555646ecb1ee9c7b00ec22f0d40bdd9da1b4dfd

Author: Costin Constantin <costin.c.constantin at intel.com>
Date:   Thu Jul 16 16:20:24 2015 +0300

oeqa/recipetool: add useful failure messages to test cases

Signed-off-by: Costin Constantin <costin.c.constantin at intel.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/lib/oeqa/selftest/recipetool.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oeqa/selftest/recipetool.py b/meta/lib/oeqa/selftest/recipetool.py
index 08ff4f1..12c6b25 100644
--- a/meta/lib/oeqa/selftest/recipetool.py
+++ b/meta/lib/oeqa/selftest/recipetool.py
@@ -50,7 +50,7 @@ class RecipetoolTests(DevtoolBase):
         bbappendfile = self._check_bbappend(testrecipe, recipefile, templayerdir)
         # Check the bbappend contents
         with open(bbappendfile, 'r') as f:
-            self.assertEqual(expectedlines, f.readlines())
+            self.assertEqual(expectedlines, f.readlines(), "Expected lines are not present in %s" % bbappendfile)
         # Check file was copied
         filesdir = os.path.join(os.path.dirname(bbappendfile), testrecipe)
         for expectedfile in expectedfiles:
@@ -109,7 +109,7 @@ class RecipetoolTests(DevtoolBase):
         # But file should have
         copiedfile = os.path.join(os.path.dirname(bbappendfile), 'coreutils', testfile2name)
         result = runCmd('diff -q %s %s' % (testfile2, copiedfile), ignore_status=True)
-        self.assertNotEqual(result.status, 0, 'New file should have been copied but was not')
+        self.assertNotEqual(result.status, 0, 'New file should have been copied but was not %s' % result.output)
 
     @testcase(1178)
     def test_recipetool_appendfile_binary(self):



More information about the Openembedded-commits mailing list