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
cgen,pref: add -coverage
support + vcover
tool
#21154
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work.
@felipensp, I've tested running this: if true {
println('branch 1')
if true {
println('branch 1.1')
if true {
println('branch 1.1.1')
} else {
println('branch 1.1.2')
}
} else {
println('branch 1.2')
if true {
println('branch 1.2.1')
} else {
println('branch 1.2.2')
}
}
} else {
println('branch 2')
if true {
println('branch 2.1')
if true {
println('branch 2.1.1')
} else {
println('branch 2.1.2')
}
} else {
println('branch 2.2')
if true {
println('branch 2.2.1')
} else {
println('branch 2.2.2')
}
}
} with:
Why does it print all the .v files for all modules (used in the program), given that for most programs, most of their functionality, will not be used? I think that skipping all the ones, for which there is 0 coverage will be more useful and more compact. |
I am planning to do:
|
The Windows gcc failure appears to be completely unrelated... and very, very weird:
|
-coverage
support-coverage
support + vcover
tool
It is my fault. It is fixed on master now. |
Building with coverage support
v -cov ./dir-output file.v
or
v -cov ./dir-output run file.v
Every run of
./file
will generate acover.<build hash>.<time hash>.json
file.VCOVDIR
env variable can be used to change the output dir.VCOVDIR=/tmp/cover ./file
Reporting to stdout
Merging and reporting to stdout
v cov -dir ./coverage-dir
Test coverage
v -cov /tmp/cover test vlib/json/
v cover -dir /tmp/cover
Filtering results
v cover -dir /tmp/cover -filter vlib/json,vlib/toml