summaryrefslogtreecommitdiffstats
path: root/scripts/oe-selftest
diff options
context:
space:
mode:
authorHumberto Ibarra <humberto.ibarra.lopez@intel.com>2016-04-05 22:15:54 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-06 10:29:24 +0100
commitd8f1f428bdbcc3624e4c0e0881f9c82ae9940a16 (patch)
treec5e2af556f0d624f55d4bef2919bdb7e75eb9228 /scripts/oe-selftest
parent6e5e225217256f84b51a2eca796f3719b648c4fc (diff)
downloadpoky-d8f1f428bdbcc3624e4c0e0881f9c82ae9940a16.tar.gz
scripts/oe-selftest: avoid the creation of coverage file when coverage not installed
Coverage subprocessing file is being created even when coverage is not installed, which causes errors of "module not found" to be send to the oe-selftest output. This patch adds indent to the block of code creating this coverage file, so it can only be executed when coverage is actually installed. [Yocto #9334] (From OE-Core rev: 03d1711350895e941a476bd2d2a6cd389be07509) 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-selftest28
1 files changed, 14 insertions, 14 deletions
diff --git a/scripts/oe-selftest b/scripts/oe-selftest
index 375ba5c415..3d2dffb5c2 100755
--- a/scripts/oe-selftest
+++ b/scripts/oe-selftest
@@ -584,20 +584,20 @@ def buildResultClass(args):
584 if self.coverage_installed: 584 if self.coverage_installed:
585 log.info("Coverage is enabled") 585 log.info("Coverage is enabled")
586 586
587 # In case the user has not set the variable COVERAGE_PROCESS_START, 587 # In case the user has not set the variable COVERAGE_PROCESS_START,
588 # create a default one and export it. The COVERAGE_PROCESS_START 588 # create a default one and export it. The COVERAGE_PROCESS_START
589 # value indicates where the coverage configuration file resides 589 # value indicates where the coverage configuration file resides
590 # More info on https://pypi.python.org/pypi/coverage 590 # More info on https://pypi.python.org/pypi/coverage
591 if not os.environ.get('COVERAGE_PROCESS_START'): 591 if not os.environ.get('COVERAGE_PROCESS_START'):
592 os.environ['COVERAGE_PROCESS_START'] = coverage_setup(args.coverage_source, args.coverage_include, args.coverage_omit) 592 os.environ['COVERAGE_PROCESS_START'] = coverage_setup(args.coverage_source, args.coverage_include, args.coverage_omit)
593 593
594 # Use default site.USER_SITE and write corresponding config file 594 # Use default site.USER_SITE and write corresponding config file
595 site.ENABLE_USER_SITE = True 595 site.ENABLE_USER_SITE = True
596 if not os.path.exists(site.USER_SITE): 596 if not os.path.exists(site.USER_SITE):
597 os.makedirs(site.USER_SITE) 597 os.makedirs(site.USER_SITE)
598 self.coveragepth = os.path.join(site.USER_SITE, "coverage.pth") 598 self.coveragepth = os.path.join(site.USER_SITE, "coverage.pth")
599 with open(self.coveragepth, 'w') as cps: 599 with open(self.coveragepth, 'w') as cps:
600 cps.write('import sys,site; sys.path.extend(site.getsitepackages()); import coverage; coverage.process_startup();') 600 cps.write('import sys,site; sys.path.extend(site.getsitepackages()); import coverage; coverage.process_startup();')
601 601
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 """