Skip to content

Add count field #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: node_js

node_js:
- stable
- 12

cache:
directories:
Expand Down
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,21 +130,37 @@ interface FunctionCov {
pub struct FunctionCov {
pub function_name: String,
pub ranges: Vec<RangeCocv>,
pub is_bloc_coverage: bool,
pub is_block_coverage: bool,
}
```

**Properties**:
- `ranges` is always non-empty. The first range is called the "root range".
- `isBlockCoverage` indicates if the function has block coverage information.
If this is `false`, it usually means that the functions was never called.
It seems to be equivalent to `ranges.length === 1 && ranges[0].count === 0`.
- `false` means that there is a single range and its count is the number of
times the function was called. **It does not say anything about what happens
inside the body of the function**, some blocks may be skipped or repeated
but this is not measured when `isBlockCoverage` is `false`. There's a single
range spanning the whole function and its count is just number of calls to
this function.
- `true` means that the ranges form a tree of blocks representing how many
times each statement or expression inside was executed. It detects skipped
or repeated statements. The root range counts the number of function calls.
- The `functionName` can be an empty string. This is common for the
`FunctionCov` representing the whole module.
- Inside a single `FunctionCov`, the ranges form a tree based on their inclusion
relation.
- If you get matching `FunctionCov` values from different `ProcessCov`, the
ranges may partially overlap (their number and offsets can vary per process).
- Inside a `ScriptCov`, a `FunctionCov` is uniquely identified by the span of
its root range.

**Hypothesis**:
- A `ScriptCov` cannot contain two `FunctionCov` with the same span but
different `isBlockCoverage` values. This can happen across different
`ProcessCov`: a `FunctionCov` with `isBlockCoverage: true` in one `ProcessCov`
and a `FunctionCov` with the same span but with `isBlockCoverage: false` in
another `ProcessCov`.

### RangeCov

Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
environment:
matrix:
- nodejs_version: '10'
- nodejs_version: '12'
install:
- ps: Install-Product node $env:nodejs_version
- ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) x64
- set CI=true
- npm -g install npm@latest
- set PATH=%APPDATA%\npm;%PATH%
Expand Down
196 changes: 0 additions & 196 deletions test-data/bugs/issue-2-block-coverage.json

This file was deleted.

Loading