Lines Matching +full:report +full:- +full:coverage
1 llvm-cov - emit coverage information
5 --------
7 :program:`llvm-cov` *command* [*args...*]
10 -----------
12 The :program:`llvm-cov` tool shows code coverage information for
14 work with ``gcov``\-style coverage or with ``clang``\'s instrumentation
18 the :program:`llvm-cov gcov` command were called. Otherwise, a command should
22 --------
24 * :ref:`gcov <llvm-cov-gcov>`
25 * :ref:`show <llvm-cov-show>`
26 * :ref:`report <llvm-cov-report>`
28 .. program:: llvm-cov gcov
30 .. _llvm-cov-gcov:
33 ------------
38 :program:`llvm-cov gcov` [*options*] *SOURCEFILE*
43 The :program:`llvm-cov gcov` tool reads code coverage data files and displays
44 the coverage information for a specified source file. It is compatible with the
48 To use :program:`llvm-cov gcov`, you must first build an instrumented version
49 of your application that collects coverage data as it runs. Compile with the
50 ``-fprofile-arcs`` and ``-ftest-coverage`` options to add the
51 instrumentation. (Alternatively, you can use the ``--coverage`` option, which
53 information (``-g``) and without optimization (``-O0``); otherwise, the
54 coverage data cannot be accurately mapped back to the source code.
58 coverage data. The other half of the data comes from ``.gcda`` files that are
73 where :program:`llvm-cov gcov` expects to find them.
75 Once you have generated the coverage data files, run :program:`llvm-cov gcov`
76 for each main source file where you want to examine the coverage results. This
84 count is shown as ``-`` if a line does not contain any executable code. If
91 .. option:: -a, --all-blocks
94 source code, this option causes llvm-cov to show the count for each block
97 .. option:: -b, --branch-probabilities
101 .. option:: -c, --branch-counts
103 Display branch counts instead of probabilities (requires -b).
105 .. option:: -f, --function-summaries
107 Show a summary of coverage for each function instead of just one summary for
110 .. option:: --help
112 Display available options (--help-hidden for more).
114 .. option:: -l, --long-file-names
116 For coverage output of files included from the main source file, add the
118 can be combined with the --preserve-paths option to use complete paths for
121 .. option:: -n, --no-output
126 .. option:: -o=<DIR|FILE>, --object-directory=<DIR>, --object-file=<FILE>
129 object file, the coverage data files are expected to have the same base name
134 .. option:: -p, --preserve-paths
136 Preserve path components when naming the coverage output files. In addition
140 the --long-file-names option, this applies to both the main file name and the
143 .. option:: -u, --unconditional-branches
145 Include unconditional branches in the output for the --branch-probabilities
148 .. option:: -version
150 Display the version of llvm-cov.
155 :program:`llvm-cov gcov` returns 1 if it cannot read input files. Otherwise,
159 .. program:: llvm-cov show
161 .. _llvm-cov-show:
164 ------------
169 :program:`llvm-cov show` [*options*] -instr-profile *PROFILE* *BIN* [*SOURCES*]
174 The :program:`llvm-cov show` command shows line by line coverage of a binary
176 show the coverage for the files listed in *SOURCES*.
178 To use :program:`llvm-cov show`, you need a program that is compiled with
179 instrumentation to emit profile and coverage data. To build such a program with
180 ``clang`` use the ``-fprofile-instr-generate`` and ``-fcoverage-mapping``
181 flags. If linking with the ``clang`` driver, pass ``-fprofile-instr-generate``
184 The coverage information is stored in the built executable or library itself,
185 and this is what you should pass to :program:`llvm-cov show` as the *BIN*
189 is suitable for the *PROFILE* argument using the :program:`llvm-profdata merge`
195 .. option:: -show-line-counts
198 another ``-show`` option is used.
200 .. option:: -show-expansions
205 .. option:: -show-instantiations
210 .. option:: -show-regions
215 .. option:: -show-line-counts-or-regions
220 .. option:: -use-color[=VALUE]
224 .. option:: -arch=<name>
229 non-universal binary.
231 .. option:: -name=<NAME>
233 Show code coverage only for functions with the given name.
235 .. option:: -name-regex=<PATTERN>
237 Show code coverage only for functions that match the given regular expression.
239 .. option:: -format=<FORMAT>
243 .. option:: -output-dir=PATH
245 Specify a directory to write coverage reports into. If the directory does not
246 exist, it is created. When used in function view mode (i.e when -name or
247 -name-regex are used to select specific functions), the report is written to
248 PATH/functions.EXTENSION. When used in file view mode, a report for each file
251 .. option:: -line-coverage-gt=<N>
253 Show code coverage only for functions with line coverage greater than the
256 .. option:: -line-coverage-lt=<N>
258 Show code coverage only for functions with line coverage less than the given
261 .. option:: -region-coverage-gt=<N>
263 Show code coverage only for functions with region coverage greater than the
266 .. option:: -region-coverage-lt=<N>
268 Show code coverage only for functions with region coverage less than the given
271 .. program:: llvm-cov report
273 .. _llvm-cov-report:
275 REPORT COMMAND
276 --------------
281 :program:`llvm-cov report` [*options*] -instr-profile *PROFILE* *BIN* [*SOURCES*]
286 The :program:`llvm-cov report` command displays a summary of the coverage of a
288 only show the coverage for the files listed in *SOURCES*.
291 coverage data. If any files are provided, summaries are shown for each function
294 For information on compiling programs for coverage and generating profile data,
295 see :ref:`llvm-cov-show`.
300 .. option:: -use-color[=VALUE]
304 .. option:: -arch=<name>
309 non-universal binary.