← 返回命令列表

Linux command

genhtml 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Generate HTML report

genhtml [coverage.info] -o [html_output]

Add title

genhtml --title "[Coverage Report]" [coverage.info] -o [html_output]

Show branch coverage

genhtml --branch-coverage [coverage.info] -o [html_output]

Prefix path

genhtml --prefix [/src] [coverage.info] -o [html_output]

说明

genhtml creates HTML coverage reports from lcov trace files. It generates navigable reports showing line, function, and branch coverage with source highlighting. The tool processes coverage data to produce visual reports for reviewing test coverage. Multiple trace files can be combined into a single report. genhtml is the visualization component of the lcov coverage toolkit.

参数

-o _DIR_, --output-directory _DIR_
Output directory.
--title _TEXT_
Report title.
--branch-coverage
Include branch coverage.
--prefix _PATH_
Remove source prefix.
--legend
Include coverage legend.
--help
Display help information.

FAQ

What is the genhtml command used for?

genhtml creates HTML coverage reports from lcov trace files. It generates navigable reports showing line, function, and branch coverage with source highlighting. The tool processes coverage data to produce visual reports for reviewing test coverage. Multiple trace files can be combined into a single report. genhtml is the visualization component of the lcov coverage toolkit.

How do I run a basic genhtml example?

Run `genhtml [coverage.info] -o [html_output]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -o _DIR_, --output-directory _DIR_ do in genhtml?

Output directory.