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.

NOTE: this develop branch will be squash-merged into master after some stabilization (1-2 weeks).

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 to 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.0.6.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

covimerage-0.0.6-py2.py3-none-any.whl (15.9 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: covimerage-0.0.6.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for covimerage-0.0.6.tar.gz
Algorithm Hash digest
SHA256 845d6e221878e22444fe6eeceb723ae52167cc29e96335748b6ddeabbfdd73b2
MD5 5047286a010a9abe07c2b217121be2f9
BLAKE2b-256 374dc9d2fb9bbc4477548c87c0ae61f70ab19a2afa9324fbcaa78e7127f81d93

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for covimerage-0.0.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 83437fd00e46ba8a0e2aa85c2de4dc799a29514a10340cb1cde7cf7d9f4b2cc9
MD5 16e305213732ef0dfac7e2aa74a9b9ae
BLAKE2b-256 8698b142e197626c1fd36642877fae331b89567d9c608d5df0d4cfd72c5bb266

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