]> code.ossystems Code Review - openembedded-core.git/commitdiff
selftest/bbtests.py: Fixed regex and added bitbake output to test_warnings_errors
authorCorneliu Stoicescu <corneliux.stoicescu@intel.com>
Thu, 27 Mar 2014 10:32:03 +0000 (12:32 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 27 Mar 2014 09:41:30 +0000 (09:41 +0000)
The test failed when more than 1 error or 1 warning is present.
Also pasting the bitbake output when the test fails.

Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/bbtests.py

index ee1f82a21716f12aef0e33db7b7e3017b9bc933d..6815ecfe0b3adcde00744567f0edcefd255f3129 100644 (file)
@@ -47,10 +47,10 @@ class BitbakeTests(oeSelfTest):
 
     def test_warnings_errors(self):
         result = bitbake('-b asdf', ignore_status=True)
-        find_warnings = re.search("Summary: There was [1-9][0-9]* WARNING message shown.", result.output)
-        find_errors = re.search("Summary: There was [1-9][0-9]* ERROR message shown.", result.output)
-        self.assertTrue(find_warnings)
-        self.assertTrue(find_errors)
+        find_warnings = re.search("Summary: There w.{2,3}? [1-9][0-9]* WARNING messages* shown", result.output)
+        find_errors = re.search("Summary: There w.{2,3}? [1-9][0-9]* ERROR messages* shown", result.output)
+        self.assertTrue(find_warnings, msg="Did not find the mumber of warnings at the end of the build:\n" + result.output)
+        self.assertTrue(find_errors, msg="Did not find the mumber of errors at the end of the build:\n" + result.output)
 
     def test_invalid_patch(self):
         self.write_recipeinc('man', 'SRC_URI += "file://man-1.5h1-make.patch"')