summaryrefslogtreecommitdiffstats
path: root/scripts/oe-selftest
diff options
context:
space:
mode:
authorHumberto Ibarra <humberto.ibarra.lopez@intel.com>2016-04-05 22:15:53 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-06 10:29:24 +0100
commit6e5e225217256f84b51a2eca796f3719b648c4fc (patch)
tree03989435484ce84e1b61e457ba0bfc73c2699ef9 /scripts/oe-selftest
parent5edfec4305b233856d542fa8244a78a80c008752 (diff)
downloadpoky-6e5e225217256f84b51a2eca796f3719b648c4fc.tar.gz
scripts/oe-selftest: remove coverage file if any coverage option is given
Coverage temporal file for sub-processing is being removed only when the --coverage option was found. This is wrong since the file is created when any coverage option (source, include or omit) is given, even if --coverage is not one of them. This patch makes sure to remove the file if any coverage option was given. (From OE-Core rev: 7157fd3bfbf2d5ae07fd4e726884baf7138bb24f) Signed-off-by: Humberto Ibarra <humberto.ibarra.lopez@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/oe-selftest')
-rwxr-xr-xscripts/oe-selftest31
1 files changed, 16 insertions, 15 deletions
diff --git a/scripts/oe-selftest b/scripts/oe-selftest
index 2348b47ae9..375ba5c415 100755
--- a/scripts/oe-selftest
+++ b/scripts/oe-selftest
@@ -602,22 +602,23 @@ def buildResultClass(args):
602 def stopTestRun(self): 602 def stopTestRun(self):
603 """ Report coverage data after the testcases are run """ 603 """ Report coverage data after the testcases are run """
604 604
605 if args.coverage and self.coverage_installed: 605 if args.coverage or args.coverage_source or args.coverage_include or args.coverage_omit:
606 with open(os.environ['COVERAGE_PROCESS_START']) as ccf: 606 if self.coverage_installed:
607 log.info("Coverage configuration file (%s)" % os.environ.get('COVERAGE_PROCESS_START')) 607 with open(os.environ['COVERAGE_PROCESS_START']) as ccf:
608 log.info("===========================") 608 log.info("Coverage configuration file (%s)" % os.environ.get('COVERAGE_PROCESS_START'))
609 log.info("\n%s" % "".join(ccf.readlines())) 609 log.info("===========================")
610 610 log.info("\n%s" % "".join(ccf.readlines()))
611 log.info("Coverage Report") 611
612 log.info("===============") 612 log.info("Coverage Report")
613 try: 613 log.info("===============")
614 coverage_report()
615 # remove the pth file
616 finally:
617 try: 614 try:
618 os.remove(self.coveragepth) 615 coverage_report()
619 except OSError: 616 finally:
620 log.warn("Expected temporal file from coverage is missing, ignoring removal.") 617 # remove the pth file
618 try:
619 os.remove(self.coveragepth)
620 except OSError:
621 log.warn("Expected temporal file from coverage is missing, ignoring removal.")
621 622
622 return StampedResult 623 return StampedResult
623 624