├── .gitignore ├── vroom ├── testdata │ └── dummy.py ├── python.vroom ├── setupvroom.vim ├── main.vroom └── lcov.vroom ├── addon-info.json ├── plugin ├── coverage.vim ├── mappings.vim └── commands.vim ├── autoload ├── coverage │ ├── vim.vim │ ├── python.vim │ ├── gcov.vim │ └── gcov │ │ └── parsing.vim └── coverage.vim ├── .travis.yml ├── python └── vim_coverage.py ├── bootstrap.vim ├── CONTRIBUTING.md ├── README.md ├── instant └── flags.vim ├── doc └── coverage.txt └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | /doc/tags 2 | *.pyc 3 | -------------------------------------------------------------------------------- /vroom/testdata/dummy.py: -------------------------------------------------------------------------------- 1 | # this is a comment 2 | 3 | def main(argv): 4 | print 'Today is a good day to die' 5 | print 'Power overwhelming' 6 | print 'Je suis malade' 7 | if 0 == 0: 8 | print 'HODOR' 9 | else: 10 | print 'HULK SAD' 11 | if len(argv) > 3 12 | print 4 13 | else: 14 | print 3 15 | -------------------------------------------------------------------------------- /addon-info.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "coverage", 3 | "description": "Generic coverage reporter.", 4 | "version": "0.0.1", 5 | "repository": {"type": "git", "url": "git://github.com/google/vim-coverage"}, 6 | "dependencies": { 7 | "maktaba": {"type": "git", "url": "git://github.com/google/vim-maktaba"} 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /plugin/coverage.vim: -------------------------------------------------------------------------------- 1 | let [s:plugin, s:enter] = maktaba#plugin#Enter(expand(':p')) 2 | if !s:enter 3 | finish 4 | endif 5 | 6 | 7 | " Require maktaba 1.12.0 or later for maktaba#python#Eval support. 8 | if !maktaba#IsAtLeastVersion('1.12.0') 9 | call maktaba#error#Shout('Coverage requires maktaba version 1.12.0.') 10 | call maktaba#error#Shout('You have maktaba version %s.', maktaba#VERSION) 11 | call maktaba#error#Shout('Please update your maktaba install.') 12 | endif 13 | 14 | 15 | let s:registry = s:plugin.GetExtensionRegistry() 16 | call s:registry.SetValidator('coverage#EnsureProvider') 17 | 18 | call s:registry.AddExtension(coverage#python#GetCoveragePyProvider()) 19 | call s:registry.AddExtension(coverage#vim#GetCovimerageProvider()) 20 | call s:registry.AddExtension(coverage#gcov#GetGcovProvider()) 21 | -------------------------------------------------------------------------------- /autoload/coverage/vim.vim: -------------------------------------------------------------------------------- 1 | " Copyright 2017 Google Inc. All rights reserved. 2 | " 3 | " Licensed under the Apache License, Version 2.0 (the "License"); 4 | " you may not use this file except in compliance with the License. 5 | " You may obtain a copy of the License at 6 | " 7 | " http://www.apache.org/licenses/LICENSE-2.0 8 | " 9 | " Unless required by applicable law or agreed to in writing, software 10 | " distributed under the License is distributed on an "AS IS" BASIS, 11 | " WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | " See the License for the specific language governing permissions and 13 | " limitations under the License. 14 | 15 | "{{{ [covimerage](https://github.com/Vimjas/covimerage) provider. 16 | " (based on coverage.py) 17 | 18 | function! coverage#vim#GetCovimerageProvider() abort 19 | let l:provider = extend(copy(coverage#python#GetCoveragePyProvider()), { 20 | \ 'name': 'covimerage'}) 21 | 22 | function! l:provider.IsAvailable(unused_filename) abort 23 | return &filetype is# 'vim' 24 | endfunction 25 | 26 | return l:provider 27 | endfunction 28 | 29 | "}}} 30 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: generic 2 | env: 3 | matrix: 4 | # The requirement in plugin/coverage.vim is older, but testing in python3 5 | # environments requires maktaba python3 support added in 1.14.0. 6 | - CI_TARGET=vim MAKTABA_VERSION=1.14.0 7 | - CI_TARGET=vim MAKTABA_VERSION=master 8 | - CI_TARGET=neovim MAKTABA_VERSION=master 9 | before_script: 10 | - sudo apt-get update 11 | - sudo apt-get install python3-dev python3-coverage 12 | - if [ $CI_TARGET = vim ]; then 13 | sudo apt-get install vim-gnome; 14 | elif [ $CI_TARGET = neovim ]; then 15 | eval "$(curl -Ss https://raw.githubusercontent.com/neovim/bot-ci/master/scripts/travis-setup.sh) nightly-x64" && 16 | wget https://bootstrap.pypa.io/get-pip.py && 17 | sudo python3 get-pip.py && 18 | sudo pip3 install neovim; 19 | fi 20 | - wget https://github.com/google/vroom/releases/download/v0.13.0/vroom_0.13.0-1_all.deb 21 | - sudo dpkg -i ./vroom_0.13.0-1_all.deb 22 | - git clone -b ${MAKTABA_VERSION} https://github.com/google/vim-maktaba.git ../maktaba/ 23 | services: 24 | - xvfb 25 | script: 26 | - '[ $CI_TARGET = neovim ] && VROOM_ARGS="--neovim" || VROOM_ARGS=""' 27 | - vroom $VROOM_ARGS --crawl ./vroom/ 28 | matrix: 29 | fast_finish: true 30 | allow_failures: 31 | - env: CI_TARGET=neovim MAKTABA_VERSION=master 32 | -------------------------------------------------------------------------------- /plugin/mappings.vim: -------------------------------------------------------------------------------- 1 | " Copyright 2014 Google Inc. All rights reserved. 2 | " 3 | " Licensed under the Apache License, Version 2.0 (the "License"); 4 | " you may not use this file except in compliance with the License. 5 | " You may obtain a copy of the License at 6 | " 7 | " http://www.apache.org/licenses/LICENSE-2.0 8 | " 9 | " Unless required by applicable law or agreed to in writing, software 10 | " distributed under the License is distributed on an "AS IS" BASIS, 11 | " WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | " See the License for the specific language governing permissions and 13 | " limitations under the License. 14 | 15 | "" 16 | " @section Commands, commands 17 | " For toggling coverage view, the t mapping is set. To automatically 18 | " render coverage for available file types, create an autocmd, e.g.: > 19 | " augroup coverage 20 | " autocmd! 21 | " autocmd BufReadPost *.py,*.c,*.cc,*.h,*.java,*.go,*.js :CoverageShow 22 | " augroup END 23 | " < 24 | " 25 | " This will render coverage for all mentioned filetypes, if available. 26 | 27 | let [s:plugin, s:enter] = maktaba#plugin#Enter(expand(':p')) 28 | if !s:enter 29 | finish 30 | endif 31 | 32 | let s:prefix = s:plugin.MapPrefix('C') 33 | execute 'nnoremap