mirror of
https://github.com/posva/vim-vue.git
synced 2025-12-07 01:54:27 +08:00
Simplify testing commands using a Makefile
This commit is contained in:
28
Makefile
Normal file
28
Makefile
Normal 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
|
||||
@@ -3,8 +3,8 @@ dependencies:
|
||||
- sudo add-apt-repository ppa:jonathonf/vim -y
|
||||
- sudo apt-get update
|
||||
- sudo apt-get install vim
|
||||
- bash test/install.sh
|
||||
- make dependencies
|
||||
|
||||
test:
|
||||
override:
|
||||
- vim -u test/vimrc -c 'Vader! test/*.vader'
|
||||
- make test
|
||||
|
||||
@@ -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.
|
||||
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
|
||||
|
||||
### Where is Jade?
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
```
|
||||
Reference in New Issue
Block a user