Commit 237ef4c6 authored by Seth Howell's avatar Seth Howell Committed by Tomasz Zawadzki
Browse files

test/post_process.py: Don't print coverage info to separate file.



We already have the post process log readily available. Put the
info there to avoid hiding the coverage errors in an obscure second
file.

Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Change-Id: I2fe9f79403ca1accccc207155f8d0dafd4c24f8e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1790


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent f1dede62
Loading
Loading
Loading
Loading
+40 −41
Original line number Diff line number Diff line
@@ -34,11 +34,10 @@ def generateTestCompletionTables(output_dir, completion_table):


def generateCoverageReport(output_dir, repo_dir):
    with open(os.path.join(output_dir, 'coverage.log'), 'w+') as log_file:
    coveragePath = os.path.join(output_dir, '**', 'cov_total.info')
    covfiles = [os.path.abspath(p) for p in glob.glob(coveragePath, recursive=True)]
    for f in covfiles:
            print(f, file=log_file)
        print(f)
    if len(covfiles) == 0:
        return
    lcov_opts = [
@@ -54,10 +53,10 @@ def generateCoverageReport(output_dir, repo_dir):
    lcov = 'lcov' + ' ' + ' '.join(lcov_opts) + ' -q -a ' + ' -a '.join(covfiles) + ' -o ' + cov_total
    genhtml = 'genhtml' + ' ' + ' '.join(lcov_opts) + ' -q ' + cov_total + ' --legend' + ' -t "Combined" --show-details -o ' + coverage
    try:
            subprocess.check_call([lcov], shell=True, stdout=log_file, stderr=log_file)
        subprocess.check_call([lcov], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    except subprocess.CalledProcessError as e:
            print("lcov failed", file=log_file)
            print(e, file=log_file)
        print("lcov failed")
        print(e)
        return
    cov_total_file = open(cov_total, 'r')
    replacement = "SF:" + repo_dir
@@ -69,10 +68,10 @@ def generateCoverageReport(output_dir, repo_dir):
            Line = re.sub("^SF:.*/repo", replacement, Line)
            file.write(Line + '\n')
    try:
            subprocess.check_call([genhtml], shell=True, stdout=log_file, stderr=log_file)
        subprocess.check_call([genhtml], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    except subprocess.CalledProcessError as e:
            print("genhtml failed", file=log_file)
            print(e, file=log_file)
        print("genhtml failed")
        print(e)
    for f in covfiles:
        os.remove(f)