lcov file misses line numbers.
See original GitHub issueWhen the lcov file is generated it is missing line numbers.
This is what is generated:
TN:
SF:./src/app.js
FN:,(anonymous_1)
FN:,(anonymous_2)
FN:,(anonymous_3)
FNF:3
FNH:3
FNDA:7,(anonymous_1)
FNDA:7,(anonymous_2)
FNDA:7,(anonymous_3)
DA:11,1
DA:24,7
DA:27,7
DA:29,7
LF:4
LH:4
BRF:0
BRH:0
end_of_record
You can see FN:,(anonymous_1)
which is false because it needs to have a line number before the comma, according to: http://ltp.sourceforge.net/coverage/lcov/geninfo.1.php
My configuration is:
'use strict';
module.exports = function(config) {
config.set({
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// base path, that will be used to resolve files and exclude
basePath: '../',
// testing framework to use (jasmine/mocha/qunit/...)
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
'test/spec/**/*.js',
'app/es6/**/*.js',
],
// list of files / patterns to exclude
exclude: [],
// web server port
port: 9002,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: ['PhantomJS'],
// Which plugins to enable
plugins: [
'karma-phantomjs-launcher',
'karma-jasmine',
'karma-coverage',
'karma-junit-reporter',
'karma-babel-preprocessor',
'karma-sourcemap-loader',
],
// coverage reporter generates the coverage
reporters: ['spec', 'coverage', 'junit'],
preprocessors: {
'app/**/*.js': ['babel', 'sourcemap'],
'test/**/*.js': ['babel', 'sourcemap'],
},
babelPreprocessor: {
options: {
presets: ['es2015'],
sourceMap: "inline",
plugins: ['instanbul']
}
},
// optionally, configure the reporter
coverageReporter: {
type: 'lcov',
dir: 'coverage',
subdir: 'report'
}
});
};
Did I misconfigure something, or did I stumble unto a bug?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:14 (4 by maintainers)
Top Results From Across the Web
Lcov not counting function toplines - Stack Overflow
I am using lcov to generate coverage information for the project I am working on. It is mostly working, except for some reason...
Read more >Files missing in Coverage "Lines to Cover" - Sonar Community
However, the file covered by the test frontend/reports/coverage/lcov.info is not showing up in the “Coverage > Lines to Cover” panel.
Read more >Line coverage report using gcov/lcov - Swarming Logic
The .gcda -files contain the interesting coverage data -- which lines were touched, how many times, and which branches it went through.
Read more >Linux Test Project - Coverage » lcov - SourceForge
Covers the following gcov-related changes in gcc: .gcov-file format: - Line coverage data can appear multiple times for the same line - Line...
Read more >Reporting — pytest-cov 4.0.0 documentation - Read the Docs
The available reports are terminal (with or without missing line numbers shown), HTML, XML, LCOV and annotated source code. The terminal report without...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We have exactly the same issue as reported by @matteoantoci. Were anyone able to solve the issue? I tried to bump to the latest version, but it didn’t changed anything.
this should now be fixed \o/