Skip to content

Introduce covimerage for test coverage #73

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 4 commits into from
Nov 24, 2017
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
10 changes: 10 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
coverage:
status:
project:
default:
target: 0%
patch:
default:
target: 0%

comment: false
3 changes: 3 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[run]
plugins = covimerage
data_file = .coverage.covimerage
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,35 @@ matrix:
- env:
- VIM_VERSION=v7.4
- MAKE_TARGET=test
- TEST_PROFILE=vim-profile-v7.4.txt
- env:
- VIM_VERSION=v8.0.0000
- MAKE_TARGET=test
- TEST_PROFILE=vim-profile-v8.0.txt
- env:
- VIM_VERSION=master
- MAKE_TARGET=test
- TEST_PROFILE=vim-profile-master.txt
- env:
- VIM_VERSION=installed
- MAKE_TARGET="clean_compiled check js/test py/test test/node_position/test_position.out"
- TEST_PROFILE=vim-profile-installed.txt

install:
- |
if [ "$VIM_VERSION" != 'installed' ]; then
bash scripts/install-vim.sh
export PATH=$HOME/vim/bin:$PATH
fi
- pip install covimerage --user

script:
- uname -a
- which -a vim
- vim --cmd version --cmd quit
- make $MAKE_TARGET

after_success:
- covimerage write_coverage $TEST_PROFILE
- coverage xml
- bash <(curl -s https://codecov.io/bash)
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ py/test: py/vimlparser.py
test/run_command.sh python py/vimlparser.py

test/node_position/test_position.out: test/node_position/test_position.vim test/node_position/test_position.ok
vim -u NONE -N --cmd "let &rtp .= ',' . getcwd()" -S test/node_position/test_position.vim
vim -Nu test/vimrc -S test/node_position/test_position.vim
diff -u test/node_position/test_position.ok test/node_position/test_position.out

.PHONY: all clean_compiled check test js/test py/test
2 changes: 1 addition & 1 deletion scripts/install-vim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ set -ev

git clone --depth 1 --branch "${VIM_VERSION}" https://github.com/vim/vim /tmp/vim
cd /tmp/vim
./configure --prefix="${HOME}/vim" --with-features=big --enable-fail-if-missing
./configure --prefix="${HOME}/vim" --with-features=huge --enable-fail-if-missing
make -j2
make install
2 changes: 1 addition & 1 deletion test/run.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@echo off
vim -u NONE -N --cmd "let &rtp .= ',' . getcwd()" -S test/run.vim
vim -Nu test/vimrc -S test/run.vim
set EXIT=%ERRORLEVEL%
if exist test.log type test.log
exit /b %EXIT%
2 changes: 1 addition & 1 deletion test/run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
vim -u NONE -N --cmd "let &rtp .= ',' . getcwd()" -S test/run.vim
vim -Nu test/vimrc -S test/run.vim
EXIT=$?
[ -e test.log ] && cat test.log
exit $EXIT
6 changes: 6 additions & 0 deletions test/vimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
let &rtp .= ',' . getcwd()

if $TEST_PROFILE != ''
execute 'profile' 'start' $TEST_PROFILE
profile! file ./autoload/*
endif