-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Code coverage reports with covimerage #1586
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[run] | ||
plugins = covimerage | ||
data_file = .coverage.covimerage |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
doc/tags | ||
.DS_Store | ||
/doc/tags | ||
/.coverage.covimerage | ||
/coverage.xml |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,14 @@ set -euC | |
vimgodir=$(cd -P "$(dirname "$0")/.." > /dev/null && pwd) | ||
cd "$vimgodir" | ||
|
||
coverage=0 | ||
while getopts "c" option; do | ||
case "$option" in | ||
c) coverage=1; ;; | ||
esac | ||
done | ||
shift $((OPTIND - 1)) | ||
|
||
if [ -z "${1:-}" ]; then | ||
echo "unknown version: '${1:-}'" | ||
echo "First argument must be 'vim-7.4', 'vim-8.0', or 'nvim'." | ||
|
@@ -23,11 +31,20 @@ if [ ! -f "$dir/bin/vim" ]; then | |
exit 1 | ||
fi | ||
|
||
$dir/bin/vim --noplugin -u NONE -N \ | ||
+"set shm+=WAFI rtp=$dir/share/vim/vimgo packpath=$dir/share/vim/vimgo,$vimgodir" \ | ||
+'filetype plugin indent on' \ | ||
+'packloadall!' \ | ||
"$@" | ||
if [ $coverage -eq 1 ]; then | ||
covimerage -q run --report-file /tmp/vim-go-test/cov-profile.txt --append \ | ||
$dir/bin/vim --noplugin -u NONE -N \ | ||
+"set shm+=WAFI rtp=$dir/share/vim/vimgo packpath=$dir/share/vim/vimgo,$vimgodir" \ | ||
+'filetype plugin indent on' \ | ||
+'packloadall!' \ | ||
"$@" | ||
else | ||
$dir/bin/vim --noplugin -u NONE -N \ | ||
+"set shm+=WAFI rtp=$dir/share/vim/vimgo packpath=$dir/share/vim/vimgo,$vimgodir" \ | ||
+'filetype plugin indent on' \ | ||
+'packloadall!' \ | ||
"$@" | ||
fi | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be nice to have the base command just once, and then prepend the You could use |
||
|
||
|
||
# vim:ts=2:sts=2:sw=2:et |
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.
btw: why do you use
-q
?I think not making it quiet should result in sensible output, and e.g. warnings in case some dict functions cannot be found etc - not sure if this suppressed with one
-q
only already.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.
As a general rule, I dislike programs that output a lot of informational messages. Basically, the "rule of silence" from The Art of Unix Programming.
Without the
-q
flag it adds a lot of output:We don't have a lot of tests (yet), but this should hopefully increase by a lot soon.
I know this is only run on the CI, but still – it makes it harder to see what failed, and what output is from the test/code, and what is from the tooling, especially for contributors who do not regularly contribute and are unfamiliar with the testing system.
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.
As far as I can see
logger.INFO
is only used for a handful of informational messages, by the way: https://github.com/Vimjas/covimerage/search?utf8=%E2%9C%93&q=LOGGER.info&type=So this should be fine, I think.
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.
I see.
I think using
warning
as the default level would make sense then - but it would change the meaning of-q
then.I'll consider adding an option
-l / --loglevel
to give this explicitly.Vimjas/covimerage#25