Simplify testing commands using a Makefile

This commit is contained in:
Adriaan Zonnenberg
2018-03-02 18:31:23 +01:00
parent a0cfe6791c
commit 5c3a71983c
5 changed files with 34 additions and 65 deletions

28
Makefile Normal file
View File

@@ -0,0 +1,28 @@
test: dependencies
vim -u test/vimrc -c 'Vader! test/*.vader'
test-nvim: dependencies
VADER_OUTPUT_FILE=/dev/stderr nvim -u test/vimrc -c 'Vader! test/*.vader' --headless
dependencies = \
'junegunn/vader.vim' \
'cakebaker/scss-syntax.vim' \
'digitaltoad/vim-pug' \
'groenewege/vim-less' \
'kchmck/vim-coffee-script' \
'leafgarland/typescript-vim' \
'slm-lang/vim-slm' \
'wavded/vim-stylus' \
'scrooloose/nerdcommenter'
dependencies:
test -L pack/testing/start/vim-vue && exit 0; \
mkdir -p pack/testing/start; \
cd pack/testing/start; \
for repo in $(dependencies); do git clone https://github.com/$$repo.git; done; \
ln -s ../../.. vim-vue
clean:
rm -rf pack
.PHONY: test test-nvim dependencies clean

View File

@@ -3,8 +3,8 @@ dependencies:
- sudo add-apt-repository ppa:jonathonf/vim -y - sudo add-apt-repository ppa:jonathonf/vim -y
- sudo apt-get update - sudo apt-get update
- sudo apt-get install vim - sudo apt-get install vim
- bash test/install.sh - make dependencies
test: test:
override: override:
- vim -u test/vimrc -c 'Vader! test/*.vader' - make test

View File

@@ -45,6 +45,10 @@ npm i -g eslint eslint-plugin-vue
If your language is not getting highlighted open an issue or a PR with the fix. If your language is not getting highlighted open an issue or a PR with the fix.
You only need to add a line to the `syntax/vue.vim` file. You only need to add a line to the `syntax/vue.vim` file.
Don't forget to write [Vader](https://github.com/junegunn/vader.vim) tests for
the code you write. You can run the tests by executing `make test` in the
terminal.
## FAQ ## FAQ
### Where is Jade? ### Where is Jade?

View File

@@ -1,31 +0,0 @@
#!/usr/bin/env bash
set -e
repos=(
'junegunn/vader.vim'
# languages
'cakebaker/scss-syntax.vim'
'digitaltoad/vim-pug'
'groenewege/vim-less'
'kchmck/vim-coffee-script'
'leafgarland/typescript-vim'
'slm-lang/vim-slm'
'wavded/vim-stylus'
# utility
'scrooloose/nerdcommenter'
)
cd "$(dirname "$0")/.."
mkdir -p pack/testing/start
cd pack/testing/start
# Add our plugin to the pack.
ln -s ../../.. vim-vue
for repo in ${repos[@]}
do
git clone https://github.com/$repo.git
done

View File

@@ -1,32 +0,0 @@
# Vader Tests
> Requires Vim 8 or Neovim, due to the way dependencies are installed.
To run the tests, you need to install the dependencies first. Use the
[installation script](install.sh):
```sh
test/install.sh
```
## Running the tests from the command line
You can run the tests with the following command:
```sh
vim -u test/vimrc -c 'Vader! test/*.vader'
```
## Running the tests from within Vim
Open vim with:
```
vim -u test/vimrc
```
Then, you can run the tests with the following command:
```vim
:Vader test/*.vader
```