Update test script and documentation.

This commit is contained in:
Rane Brown 2019-07-24 21:57:01 -06:00
parent fcb5850c28
commit 594ac7dbe1
3 changed files with 45 additions and 16 deletions

View File

@ -12,10 +12,13 @@ RUN pip3 install --upgrade pip setuptools
RUN pip3 install vim-vint
RUN git clone https://github.com/junegunn/vader.vim vader
# Notable versions:
# v7.4.1546 sticky type checking removed (allow a variables type to change)
# v7.3.831 getbufvar added a default value
# v8.0 async jobs and timers
RUN install_vim -tag v7.3.429 -name vim_7.3.429 -build \
-tag v7.4.1099 -name vim_7.4.1099 -build \
-tag v7.4.1546 -name vim_7.4.1546 -build \
-tag v8.0.0027 -name vim_8.0.0027 -build \
-tag v8.1.0519 -name vim_8.1.0519 -build \
-tag neovim:v0.2.2 -name nvim_0.2.2 -build \
-tag neovim:v0.3.8 -name nvim_0.3.8 -build \

View File

@ -5,6 +5,7 @@ Vimwiki functionality. It is based on the following tools:
- [vim-testbed](https://github.com/tweekmonster/vim-testbed)
- [Vader](https://github.com/junegunn/vader.vim)
- [Vint](https://github.com/Kuniwak/vint)
## Resources
@ -15,12 +16,37 @@ Vimwiki functionality. It is based on the following tools:
- [ale](https://github.com/w0rp/ale/tree/master/test)
- [Other projects](https://github.com/junegunn/vader.vim/wiki/Projects-using-Vader)
## Manual Steps
## Building Docker Image
To build the Docker image run `docker build -t vimwiki` from the Vimwiki
repository root (same location as the Dockerfile).
To start the tests run `docker run -it --rm -v $PWD:/testplugin -v $PWD/test:/home vimwiki vim-v7.4.1099 -u test/vimrc -i NONE '+Vader! test/*'`
also from the repository root.
## Running Tests
- Substitute `vim-v7.4.1099` for any of the vim versions in the Dockerfile.
### Manual Steps
Starting in the test directory run this command:
```sh
docker run -it --rm -v $PWD/../:/testplugin -v $PWD/../test:/home vimwiki vim_7.4.1099 -u test/vimrc -i NONE
```
This will open a vim instance in the docker container and then all tests
can be run with `:Vader test/*` or individual tests can be run.
**Note:** Substitute `vim_7.4.1099` for any of the vim versions in the Dockerfile.
### Automated Tests
The script in the `test/` directory named `run_test.sh` can be used to
automatically run all tests for all installed vim versions. The vim/nvim
versions are parsed from the Dockerfile. This script will also run `Vint` for all
plugin source files. For more information run `./run_tests.sh -h`.
## Known Issues
1. neovim v0.2.x does not work correctly with Vader output from the docker
container. No test results are printed and an error message saying
`Vim: Error reading input, exiting...`
- Probably need to look into this more and determine if the issue is Vader,
Neovim, or Docker.

View File

@ -56,12 +56,16 @@ vader_filter() {
local err=0
while read -r; do
if [[ "$verbose" == 0 ]]; then
if [[ "$REPLY" = *'docker:'* ]]; then
# print line starting with 'docker:' since it could be an error with
# the docker container starting
# only print possible error cases
if [[ "$REPLY" = *'docker:'* ]] || \
[[ "$REPLY" = *'Starting Vader:'* ]] || \
[[ "$REPLY" = *'Vader error:'* ]] || \
[[ "$REPLY" = *'Vim: Error '* ]]; then
echo "$REPLY"
elif [[ "$REPLY" = *'Starting Vader:'* ]]; then
elif [[ "$REPLY" = *'[EXECUTE] (X)'* ]] || \
[[ "$REPLY" = *'[ EXPECT] (X)'* ]]; then
echo "$REPLY"
err=1
elif [[ "$REPLY" = *'Success/Total:'* ]]; then
success="$(echo -n "$REPLY" | grep -o '[0-9]\+/' | head -n1 | cut -d/ -f1)"
total="$(echo -n "$REPLY" | grep -o '/[0-9]\+' | head -n1 | cut -d/ -f2)"
@ -69,13 +73,6 @@ vader_filter() {
err=1
fi
echo "$REPLY"
elif [[ "$REPLY" = *'[EXECUTE] (X)'* ]] || [[ "$REPLY" = *'[ EXPECT] (X)'* ]]; then
echo "$REPLY"
err=1
elif [[ "$REPLY" = *'Vader error:'* ]]; then
echo "$REPLY"
elif [[ "$REPLY" = *'Vim: Error '* ]]; then
echo "$REPLY"
fi
else
# just print everything
@ -174,6 +171,9 @@ if [[ $# -ne 0 ]]; then
exit 1
fi
# stop tests on ctrl-c or ctrl-z
trap exit 1 SIGINT SIGTERM
# select which tests should run
case $type in
"vader" )