Improved test script
This commit is contained in:
parent
5c1d842abd
commit
a952336487
@ -1,21 +1,32 @@
|
|||||||
setup() {
|
setup() {
|
||||||
mkdir -p $HOME/.vim/autoload/ &&
|
mkdir -p $HOME/.vim/autoload/ &&
|
||||||
curl http://github.com/gmarik/vundle/raw/master/autoload/vundle.vim > $HOME/.vim/autoload/vundle.vim
|
curl http://github.com/gmarik/vundle/raw/master/autoload/vundle.vim > $HOME/.vim/autoload/vundle.vim
|
||||||
|
return$([ -s $HOME/.vim/autoload/vundle.vim ] && rm -f ~/.vim/autoload/vundle.vim )
|
||||||
echo -en "Setup: " ; [ -s $HOME/.vim/autoload/vundle.vim ] && echo "ok" || echo "fail"
|
|
||||||
rm ~/.vim/autoload/vundle.vim
|
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
vim -e -c "BundleInstall" -c "q"
|
vim -e -c "BundleInstall" -c "q"
|
||||||
# echo -en "Setup: " ; [ -s $HOME/.vim/autoload/vundle.vim ] && echo "ok" || echo "fail"
|
return $([ -d $HOME/.vim/bundle ] && [ "$(ls -1 -d ~/.vim/bundle/*|wc -l)" = "$(grep ^Bundle ~/.vim/vimrc|wc -l)" ] )
|
||||||
echo -en 'Install:'; [ -d $HOME/.vim/bundle ] && [ "$(ls -1 -d ~/.vim/bundle/*|wc -l)" = "$(grep ^Bundle ~/.vim/vimrc|wc -l)" ] && echo 'ok' || echo 'fail'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# $ source vundle_test.sh; test
|
docs() {
|
||||||
test() {
|
_tags() { find ~/.vim/bundle/**/doc -name 'tags'; }
|
||||||
setup
|
_tags | xargs rm
|
||||||
install
|
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
|
# $ source vundle_test.sh; doc
|
||||||
|
Loading…
Reference in New Issue
Block a user