Skip to main content

Generate coverage information for Vim scripts.

Project description

covimerage

Generates code coverage information for Vim scripts.

It parses the output from Vim's :profile command, and generates data compatible with Coverage.py.

Build Status codecov Codacy Badge

Installation

You can install covimerage using pip:

pip install covimerage

Simple usage

You can use covimerage run to wrap the call to Neovim/Vim with necessary boilerplate:

covimerage run vim -Nu test/vimrc -c 'Vader! test/**'

This will write the file .coverage_covimerage by default (use --data-file to configure it), which is compatible with Coverage.py. A report is automatically generated (on stdout).

You can then call covimerage xml to create a coverage.xml file (Cobertura-compatible), which tools like Codecov's codecov tool can consume, e.g. via codecov -f coverage.xml.

Manual/advanced usage

1. Generate profile information for your Vim script(s)

You have to basically add the following to your tests vimrc:

profile start /tmp/vim-profile.txt
profile! file ./*

This makes Neovim/Vim then write a file with profiling information.

2. Call covimerage on the output file(s)

covimerage write_coverage /tmp/vim-profile.txt

This will create a file .coverage_covimerage (the default for --data-file), with entries marked for processing by a Coverage.py plugin (provided by covimerage)).

3. Include the covimerage plugin in .coveragerc

When using coverage on the generated output (data file), you need to add the covimerage plugin to the .coveragerc file (which Coverage.py uses). This is basically all the .coveragerc you will need, but you could use other settings here (for Coverage.py), e.g. to omit some files:

[run]
plugins = covimerage
data_file = .coverage_covimerage

4. Create the report(s)

You can now call e.g. coverage report -m, and you should be able to use coverage reporting platforms like https://codecov.io/ or https://coveralls.io, which are basically using coverage xml.

Reference implementation

Links

TODO

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

covimerage-0.1.2.tar.gz (45.2 kB view details)

Uploaded Source

Built Distribution

covimerage-0.1.2-py2.py3-none-any.whl (16.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file covimerage-0.1.2.tar.gz.

File metadata

  • Download URL: covimerage-0.1.2.tar.gz
  • Upload date:
  • Size: 45.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for covimerage-0.1.2.tar.gz
Algorithm Hash digest
SHA256 09a0fa10e31263df1fd4e6baeb6c0ca7001f7a6381f43fb7878c82e0cbe1ae9c
MD5 8cdc0343193cfd8f3113dd87d3260974
BLAKE2b-256 77593f863655a8d5048ff9cf729b5d0208b19599203e2c6a6e417df7ba8e5587

See more details on using hashes here.

File details

Details for the file covimerage-0.1.2-py2.py3-none-any.whl.

File metadata

  • Download URL: covimerage-0.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for covimerage-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ebf68cd889ab6728c31d3b2d1e31884577afd2e12dbc6bddf7055b46e3c603f8
MD5 45dc7995349a758fd94c70b85e69829b
BLAKE2b-256 ade54450d1abe84613d6beb432561ade6c2117cc001f8ed21b3a9ca69264ff3e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page