diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..de69007 --- /dev/null +++ b/Makefile @@ -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 diff --git a/circle.yml b/circle.yml index cb8d8d6..c0b6427 100644 --- a/circle.yml +++ b/circle.yml @@ -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 diff --git a/readme.md b/readme.md index 4e91457..7871b76 100644 --- a/readme.md +++ b/readme.md @@ -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? diff --git a/test/install.sh b/test/install.sh deleted file mode 100755 index 974b95c..0000000 --- a/test/install.sh +++ /dev/null @@ -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 diff --git a/test/readme.md b/test/readme.md deleted file mode 100644 index 57d0f0c..0000000 --- a/test/readme.md +++ /dev/null @@ -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 -```