Commit 2d246e07 authored by Alberto Mardegan's avatar Alberto Mardegan
Browse files

build: add branch coverage information

parent 8113d8bd
......@@ -18,6 +18,10 @@ Product {
outputFileTags: "coverage.html"
requiresInputs: false
prepare: {
var lcovCommonOptions = [
"--rc", "lcov_branch_coverage=1",
];
var commands = []
var captureCmd = new Command("lcov", [
"--directory", project.sourceDirectory,
......@@ -25,7 +29,7 @@ Product {
"--output-file", "coverage.info",
"--no-checksum",
"--compat-libtool",
]);
].concat(lcovCommonOptions));
captureCmd.description = "Collecting coverage data";
captureCmd.highlight = "coverage";
captureCmd.silent = false;
......@@ -40,7 +44,8 @@ Product {
if (product.extractPatterns.length > 0) {
extractArgs.push("-o");
extractArgs.push("coverage.info");
var extractCmd = new Command("lcov", extractArgs);
var params = extractArgs.concat(lcovCommonOptions);
var extractCmd = new Command("lcov", params);
extractCmd.description = "Extracting coverage data";
extractCmd.highlight = "coverage";
extractCmd.silent = false;
......@@ -52,7 +57,7 @@ Product {
"--remove", "coverage.info", 'qrc_*.cpp',
"--remove", "coverage.info", '*/tests/*',
"-o", "coverage.info",
]);
].concat(lcovCommonOptions));
filterCmd.description = "Filtering coverage data";
filterCmd.highlight = "coverage";
filterCmd.silent = false;
......@@ -60,6 +65,7 @@ Product {
var genhtmlCmd = new Command("genhtml", [
"--prefix", project.sourceDirectory,
"--rc", "genhtml_branch_coverage=1",
"--output-directory", product.outputDirectory,
"--title", "Code coverage",
"--legend",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment