3 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
\r
4 # Use of this source code is governed by a BSD-style license that can be
\r
5 # found in the LICENSE file.
\r
7 # Example configuration file for Croc
\r
9 # Basic formatting rules:
\r
10 # * It looks like JSON.
\r
11 # * It's really python.
\r
12 # * Dictionaries are wrapped in {}. Order does not matter. Entries are of
\r
15 # Note the trailing comma, which will help save you from python's built-in
\r
16 # string concatenation.
\r
17 # * Lists are wrapped in []. Order does matter. Entries should be followed
\r
18 # with a trailing comma, which will help save you from python's built-in
\r
19 # string concatenation.
\r
20 # * Comments start with # and extend to end of line.
\r
21 # * Strings are wrapped in ''. Backslashes must be escaped ('foo\\bar', not
\r
22 # 'foo\bar') - this is particularly important in rule regular expressions.
\r
25 # What follows is the main configuration dictionary.
\r
27 # List of root directories, applied in order.
\r
29 # Typically, coverage data files contain absolute paths to the sources.
\r
30 # What you care about is usually a relative path from the top of your source
\r
31 # tree (referred to here as a 'source root') to the sources.
\r
33 # Roots may also be specified on the command line via the --root option.
\r
34 # Roots specified by --root are applied before those specified in config
\r
37 # Each entry is a dict.
\r
38 # * It must contain a 'root' entry, which is the start of a path.
\r
39 # * Root entries may be absolute paths
\r
40 # * Root entries starting with './' or '../' are relative paths, and
\r
41 # are taken relative to the current directory where you run croc.
\r
42 # * Root entries may start with previously defined altnames.
\r
43 # * Use '/' as a path separator, even on Windows.
\r
44 # * It may contain a 'altname' entry. If the root matches the start of
\r
45 # a filename, that start is replaced with the 'altname', or with '_'
\r
46 # if no default is specified.
\r
47 # * Multiple root entries may share the same altname. This is commonly
\r
48 # used when combining LCOV files from different platforms into one
\r
49 # coverage report, when each platform checks out source code into a
\r
50 # different source tree.
\r
51 {'root' : 'c:/P4/EarthHammer'},
\r
52 {'root' : 'd:/pulse/recipes/330137642/base'},
\r
53 {'root' : '/Volumes/BuildData/PulseData/data/recipes/330137640/base'},
\r
54 {'root' : '/usr/local/google/builder/.pulse-agent/data/recipes/330137641/base'},
\r
56 # Sub-paths we specifically care about and want to call out. Note that
\r
57 # these are relative to the default '_' altname.
\r
59 'root' : '_/googleclient/third_party/software_construction_toolkit/files',
\r
63 'root' : '_/googleclient/tools/hammer',
\r
64 'altname' : 'HAMMER',
\r
68 # List of rules, applied in order.
\r
70 # Each rule is a dict.
\r
71 # * It must contaihn a 'regexp' entry. Filenames which match this
\r
72 # regular expression (after applying mappings from 'roots') are
\r
73 # affected by the rule.
\r
75 # * Other entries in the dict are attributes to apply to matching files.
\r
77 # Allowed attributes:
\r
79 # 'include' : If 1, the file will be included in coverage reports. If 0,
\r
80 # it won't be included in coverage reports.
\r
82 # 'group' : Name of the group the file belongs to. The most common
\r
83 # group names are 'source' and 'test'. Files must belong to
\r
84 # a group to be included in coverage reports.
\r
86 # 'language' : Programming language for the file. The most common
\r
87 # languages are 'C', 'C++', 'python', 'ObjC', 'ObjC++'.
\r
88 # Files must have a language to be included in coverage
\r
91 # 'add_if_missing' : If 1, and the file was not referenced by any LCOV
\r
92 # files, it will be be scanned for executable lines
\r
93 # and added to the coverage report. If 0, if the
\r
94 # file is not referenced by any LCOV files, it will
\r
95 # simply be ignored and not present in coverage
\r
98 # Files/paths to include
\r
100 'regexp' : '^(SCT|HAMMER)/',
\r
102 'add_if_missing': 1,
\r
105 'regexp' : '.*/(\\.svn|\\.hg)/',
\r
112 'group' : 'source',
\r
115 'regexp' : '.*_(test|test_mac|unittest)\\.',
\r
121 'regexp' : '.*\\.py$',
\r
122 'language' : 'python',
\r
126 # List of paths to add source from.
\r
128 # Each entry is a path. It may be a local path, or one relative to a root
\r
129 # altname (see 'roots' above).
\r
131 # If more than one root's altname matches the start of this path, all matches
\r
132 # will be attempted; matches where the candidate directory doesn't exist will
\r
133 # be ignored. For example, if you're combining data from multiple platforms'
\r
134 # LCOV files, you probably defined at least one root per LCOV, but only have
\r
135 # one copy of the source on your local platform. That's fine; Croc will use
\r
136 # the source it can find and not worry about the source it can't.
\r
138 # Source files must be added via 'add_files' to generate line-by-line HTML
\r
139 # output (via the --html option) and/or to scan for missing executable lines
\r
140 # (if 'add_if_missing' is 1).
\r
146 # Statistics to print.
\r
149 # Each entry is a dict.
\r
151 # It must have a 'stat' entry, which is the statistic to print. This may
\r
152 # be one of the following stats:
\r
154 # * files_executable
\r
155 # * files_instrumented
\r
157 # * lines_executable
\r
158 # * lines_instrumented
\r
161 # or an expression using those stats.
\r
163 # It may have a 'format' entry, which is a python formatting string (very
\r
164 # printf-like) for the statistic.
\r
166 # It may have a 'group' entry. If this is specified, only files from the
\r
167 # matching group will be included in the statistic. If not specified, the
\r
168 # group defaults to 'all', which means all groups.
\r
170 'stat' : 'files_executable',
\r
171 'format' : '*RESULT FilesKnown: files_executable= %d files',
\r
174 'stat' : 'files_instrumented',
\r
175 'format' : '*RESULT FilesInstrumented: files_instrumented= %d files',
\r
178 'stat' : '100.0 * files_instrumented / files_executable',
\r
179 'format' : '*RESULT FilesInstrumentedPercent: files_instrumented_percent= %g',
\r
182 'stat' : 'lines_instrumented',
\r
183 'format' : '*RESULT LinesInstrumented: lines_instrumented= %d lines',
\r
186 'stat' : 'lines_covered',
\r
187 'format' : '*RESULT LinesCoveredSource: lines_covered_source= %d lines',
\r
188 'group' : 'source',
\r
191 'stat' : 'lines_covered',
\r
192 'format' : '*RESULT LinesCoveredTest: lines_covered_test= %d lines',
\r