From a95233648758cf5c997606fd0031a3539a61efd2 Mon Sep 17 00:00:00 2001 From: gmarik Date: Sun, 31 Oct 2010 19:32:53 -0500 Subject: [PATCH] Improved test script --- vundle_test.sh | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/vundle_test.sh b/vundle_test.sh index e7e845e..92455f6 100755 --- a/vundle_test.sh +++ b/vundle_test.sh @@ -1,23 +1,34 @@ setup() { mkdir -p $HOME/.vim/autoload/ && curl http://github.com/gmarik/vundle/raw/master/autoload/vundle.vim > $HOME/.vim/autoload/vundle.vim - - echo -en "Setup: " ; [ -s $HOME/.vim/autoload/vundle.vim ] && echo "ok" || echo "fail" - rm ~/.vim/autoload/vundle.vim + return$([ -s $HOME/.vim/autoload/vundle.vim ] && rm -f ~/.vim/autoload/vundle.vim ) } install() { vim -e -c "BundleInstall" -c "q" - # echo -en "Setup: " ; [ -s $HOME/.vim/autoload/vundle.vim ] && echo "ok" || echo "fail" - echo -en 'Install:'; [ -d $HOME/.vim/bundle ] && [ "$(ls -1 -d ~/.vim/bundle/*|wc -l)" = "$(grep ^Bundle ~/.vim/vimrc|wc -l)" ] && echo 'ok' || echo 'fail' + return $([ -d $HOME/.vim/bundle ] && [ "$(ls -1 -d ~/.vim/bundle/*|wc -l)" = "$(grep ^Bundle ~/.vim/vimrc|wc -l)" ] ) } -# $ source vundle_test.sh; test -test() { - setup - install +docs() { + _tags() { find ~/.vim/bundle/**/doc -name 'tags'; } + _tags | xargs rm + vim -e -c 'BundleDocs' -c 'q' + return $([ "0" != $(_tags | wc -l) ]) } +t() { + printf "%-15s: " $1 + $1 1>> 'test.log' 2>&1 && echo 'ok' || echo 'fail' +} + +# $ source vundle_test.sh; test_all +test_all() { + : > 'test.log' + t setup + t install + t docs +} + # $ source vundle_test.sh; doc doc() { maruku --html README.md ; open README.html