edc9561c20e3fbed3f8b377b6f012c29807e03f9.svn-base
1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
## LCOV file parser
Simple LCOV file parser
## Installation
npm install lcov-parse
## Usage
var parse = require('lcov-parse');
parse('./path/to/file.info', function(err, data) {
//process the data here
});
or
parse(lcovString, function(err, data) {
//process the data here
});
## Formatting
Using this as a guide: http://ltp.sourceforge.net/coverage/lcov/geninfo.1.php
It will return JSON like this:
```
{
"title": "Test #1",
"file": "anim-base/anim-base-coverage.js",
"functions": {
"hit": 23,
"found": 29,
"details": [
{
"name": "(anonymous 1)",
"line": 7,
"hit": 6
},
{
"name": "(anonymous 2)",
"line": 620,
"hit": 225
},
{
"name": "_end",
"line": 516,
"hit": 228
}
]
}
"lines": {
"found": 181,
"hit": 143,
"details": [
{
"line": 7,
"hit": 6
},
{
"line": 29,
"hit": 6
}
]
}
}
```
## Cli Usage
lcov-parse ./lcov.info
or
cat lcov.info | xargs -0 lcov-parse
## Tests
npm install && npm test
## Build Status
[![Build Status](https://secure.travis-ci.org/davglass/lcov-parse.png?branch=master)](http://travis-ci.org/davglass/lcov-parse)