Primula is a code coverage tool for Vim script.
$ pip install primula
- Python 3.8+
- coverage 5.0+
- Vim 7.4+
$ primula run vim --clean -Nnu vimrc -S /path/to/script.vim -c q
$ primula report -m
The contents of vimrc
as follow:
if $PROFILE !=# ''
execute 'profile start' $PROFILE
profile! file ./*
endif
$ vim --clean -Nn --cmd "profile start profile.txt" --cmd "profile! file ./*" -S /path/to/script.vim -c q
$ primula combine profile.txt
$ primula report -m
[primula]
environ = PROFILE
profile = profile.txt
- cond
It controls whether following condition commands to be included as statements.
:elsei[f]
:cat[ch]
:fina[lly]
They are counted by Vim 8.1.309+.
Default:
True
- end
It controls whether following end commands to be included as statements.
:en[dif]
:endw[hile]
:endfo[r]
:endt[ry]
:endf[unction]
Default:
False
- environ
An environment variable name.
Default:
PROFILE
- profile
A profile output path.
Default:
profile.txt
Primula is distributed under the terms of the Apache License, Version 2.0.