]> code.ossystems Code Review - openembedded-core.git/commitdiff
runtime/cases/ptest.py: fail when ptests fail on target
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>
Thu, 4 Jan 2018 12:13:46 +0000 (14:13 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 5 Jan 2018 11:54:56 +0000 (11:54 +0000)
That's the whole point isn't it? Previously this testcase succeeded
even if some of the underlying on-target tests failed; the only way
to find out if anything was wrong was to manually inspect the logs.

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/runtime/cases/ptest.py

index a2b6ffdfe112d6cb6c01e891376ef37758bdca44..f60a433d59078c01d31a91a212ec3794e5878c96 100644 (file)
@@ -83,3 +83,11 @@ class PtestRunnerTest(OERuntimeTestCase):
             # Remove the old link to create a new one
             os.remove(ptest_log_dir_link)
         os.symlink(os.path.basename(ptest_log_dir), ptest_log_dir_link)
+
+        failed_tests = {}
+        for section in parse_result.result_dict:
+            failed_testcases = [ test for test, result in parse_result.result_dict[section] if result == 'fail' ]
+            if failed_testcases:
+                failed_tests[section] = failed_testcases
+
+        self.assertFalse(failed_tests, msg = "Failed ptests: %s" %(str(failed_tests)))