-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- coverage.js written for converting coverage.info to json has been commented out - Updated README.md with links to workflow badges - Updated code-coverage.yml with badge extraction - testing 1
- Loading branch information
1 parent
a43a155
commit 8033f86
Showing
4 changed files
with
126 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// var parse = require('lcov-parse'); | ||
// const fs = require('fs'); | ||
|
||
|
||
// const lcovFilePath = './cmake-build-unit-tests/coverage.info'; | ||
|
||
|
||
// const lcovString = fs.readFileSync(lcovFilePath, 'utf8'); | ||
|
||
|
||
// parse(lcovString, function(err, data) { | ||
// if (err) { | ||
// console.error('Error parsing LCOV string:', err); | ||
// return; | ||
// } | ||
|
||
|
||
// let totalLinesFound = 0; | ||
// let totalLinesHit = 0; | ||
// let totalFunctionsFound = 0; | ||
// let totalFunctionsHit = 0; | ||
|
||
// data.forEach(file => { | ||
// if (file.lines) { | ||
// totalLinesFound += file.lines.found || 0; | ||
// totalLinesHit += file.lines.hit || 0; | ||
// } | ||
// if (file.functions) { | ||
// totalFunctionsFound += file.functions.found || 0; | ||
// totalFunctionsHit += file.functions.hit || 0; | ||
// } | ||
// }); | ||
|
||
|
||
// const totalLineCoverage = ((totalLinesHit / totalLinesFound) * 100).toFixed(2); | ||
// const totalFunctionCoverage = ((totalFunctionsHit / totalFunctionsFound) * 100).toFixed(2); | ||
|
||
|
||
// const formattedData = { | ||
// total: { | ||
// statements: { | ||
// pct: totalLineCoverage | ||
// }, | ||
// functions: { | ||
// pct: totalFunctionCoverage | ||
// } | ||
// } | ||
// }; | ||
|
||
|
||
// const outputFilePath = './coverage-badge/coverage-summary.json'; | ||
// fs.writeFileSync(outputFilePath, JSON.stringify(formattedData, null, 2)); | ||
|
||
|
||
// console.log('Coverage data has been saved to:', outputFilePath); | ||
// console.log(`Total Line Coverage: ${totalLineCoverage}%`); | ||
// console.log(`Total Function Coverage: ${totalFunctionCoverage}%`); | ||
// }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters