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-05 23:12:41 +0100
commit7157fd3bfbf2d5ae07fd4e726884baf7138bb24f (patch)
treeb6a12eafd13289eeb7206514cd1e5c5fb11f9255 /scripts/oe-selftest
parent1ccfdb31ea8a50e695d368c4fc78185254aac763 (diff)
downloadopenembedded-core-7157fd3bfbf2d5ae07fd4e726884baf7138bb24f.tar.gz
openembedded-core-7157fd3bfbf2d5ae07fd4e726884baf7138bb24f.tar.bz2
openembedded-core-7157fd3bfbf2d5ae07fd4e726884baf7138bb24f.zip
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. 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):
def stopTestRun(self):
""" Report coverage data after the testcases are run """
- if args.coverage and self.coverage_installed:
- with open(os.environ['COVERAGE_PROCESS_START']) as ccf:
- log.info("Coverage configuration file (%s)" % os.environ.get('COVERAGE_PROCESS_START'))
- log.info("===========================")
- log.info("\n%s" % "".join(ccf.readlines()))
-
- log.info("Coverage Report")
- log.info("===============")
- try:
- coverage_report()
- # remove the pth file
- finally:
+ if args.coverage or args.coverage_source or args.coverage_include or args.coverage_omit:
+ if self.coverage_installed:
+ with open(os.environ['COVERAGE_PROCESS_START']) as ccf:
+ log.info("Coverage configuration file (%s)" % os.environ.get('COVERAGE_PROCESS_START'))
+ log.info("===========================")
+ log.info("\n%s" % "".join(ccf.readlines()))
+
+ log.info("Coverage Report")
+ log.info("===============")
try:
- os.remove(self.coveragepth)
- except OSError:
- log.warn("Expected temporal file from coverage is missing, ignoring removal.")
+ coverage_report()
+ finally:
+ # remove the pth file
+ try:
+ os.remove(self.coveragepth)
+ except OSError:
+ log.warn("Expected temporal file from coverage is missing, ignoring removal.")
return StampedResult