Skip to content
This repository has been archived by the owner on Oct 27, 2023. It is now read-only.

Commit

Permalink
Misc documentation added.
Browse files Browse the repository at this point in the history
  • Loading branch information
whart222 committed Jun 13, 2013
1 parent b509a56 commit c2b15ca
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions scripts/gcovr
Original file line number Diff line number Diff line change
Expand Up @@ -203,27 +203,31 @@ def resolve_symlinks(orig_path):
return os.path.join(*actual_path)


def path_startswith(path, base):
return path.startswith(base) and (
len(base) == len(path) or path[len(base)] == os.path.sep )


#
# Class that creates path aliases
#
class PathAliaser(object):

def __init__(self):
self.aliases = {}
self.master_targets = set()
self.preferred_name = {}

def path_startswith(self, path, base):
return path.startswith(base) and (
len(base) == len(path) or path[len(base)] == os.path.sep )

def master_path(self, path):
match_found = False
while True:
for base, alias in self.aliases.items():
if path_startswith(path, base):
if self.path_startswith(path, base):
path = alias + path[len(base):]
match_found = True
break
for master_base in self.master_targets:
if path_startswith(path, master_base):
if self.path_startswith(path, master_base):
return path, master_base, True
if match_found:
sys.stderr.write(
Expand Down Expand Up @@ -362,6 +366,9 @@ def get_datafiles(flist, options):
return allfiles


#
# Process a single gcov datafile
#
def process_gcov_data(file, covdata, options):
INPUT = open(file,"r")
#
Expand Down Expand Up @@ -688,6 +695,9 @@ def print_text_report(covdata):
if options.output:
OUTPUT.close()

#
# CSS declarations for the HTML output
#
css = '''
/* All views: initial background and text color */
body
Expand Down Expand Up @@ -1253,6 +1263,9 @@ css = '''
}
'''

#
# A string template for the HTML output
#
root_page = Template('''
<html>
Expand Down Expand Up @@ -1473,6 +1486,9 @@ def print_html_report(covdata):
OUTPUT.close()


#
# Generate the table row for a single file
#
def html_row(**kwargs):
rowstr=Template('''
<tr>
Expand Down

0 comments on commit c2b15ca

Please sign in to comment.