From: Daniel Hahler Date: Mon, 17 Nov 2014 13:11:43 +0000 (+0100) Subject: Add support for "make test", automatically installing deps X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/ca3005b75641664ba9a982a4fa5bb5b871c07d91?hp=7f61ab3a497224210914c44c16c73046364a24a3 Add support for "make test", automatically installing deps --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..378eac2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build diff --git a/.travis.yml b/.travis.yml index 130c2af..ce03b62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,5 +21,4 @@ before_script: | git clone https://github.com/junegunn/vader.vim script: | - cd "$TRAVIS_BUILD_DIR" - ./test/run-tests.sh + make test diff --git a/Makefile b/Makefile index d929849..3772491 100644 --- a/Makefile +++ b/Makefile @@ -15,3 +15,16 @@ install: cp -v after/ftplugin/markdown.vim ${ADDONS}/after/ftplugin/markdown.vim mkdir -pv ${REGISTRY} cp -v registry/markdown.yaml ${REGISTRY}/markdown.yaml + +test: build/tabular build/vader.vim + test/run-tests.sh +.PHONY: test + +build/tabular: | build + git clone https://github.com/godlygeek/tabular build/tabular + +build/vader.vim: | build + git clone https://github.com/junegunn/vader.vim build/vader.vim + +build: + mkdir build diff --git a/test/README.md b/test/README.md index 1817e55..a13d6d2 100644 --- a/test/README.md +++ b/test/README.md @@ -1,7 +1,5 @@ -To run the tests, you must install [Vader](https://github.com/junegunn/vader.vim). +You can run the tests using the Makefile from the top directory: -Vader and other plugins must be installed in the same directory as this repository. + make test -Run the tests with: - - ./run-tests.sh +To run them manually please refer to the instructions/commands in the Makefile. diff --git a/test/run-tests.sh b/test/run-tests.sh index c8c6213..731b3ce 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -1,3 +1,16 @@ #!/usr/bin/env bash -cd "$( dirname "${BASH_SOURCE[0]}" )" && vim -Nu vimrc -c 'Vader! *' > /dev/null +# Exit on error. +set -e + +cd "$( dirname "${BASH_SOURCE[0]}" )" + +for dep in ../build/tabular ../build/vader.vim; do + if [[ ! -d $dep ]]; then + echo "Missing dependency: $dep" + echo "You may just want to use 'make test'." + exit 1 + fi +done + +vim -Nu vimrc -c 'Vader! *' > /dev/null diff --git a/test/vimrc b/test/vimrc index 44df1b6..59c6163 100644 --- a/test/vimrc +++ b/test/vimrc @@ -1,7 +1,7 @@ set nocompatible set rtp+=../ -set rtp+=../../tabular/ -set rtp+=../../vader.vim/ +set rtp+=../build/tabular/ +set rtp+=../build/vader.vim/ filetype on filetype plugin on filetype indent on