mirror of
1
0
Fork 0
ultimate-vim/sources_non_forked/vim-go/scripts/test.sh

46 lines
825 B
Bash
Raw Normal View History

2017-02-11 08:01:38 -05:00
#!/bin/bash
2014-10-31 17:30:24 -04:00
2017-02-11 08:01:38 -05:00
set -e
2014-10-31 17:30:24 -04:00
2017-02-11 08:01:38 -05:00
cd $(dirname $0)
2014-10-31 17:30:24 -04:00
2017-03-07 12:04:28 -05:00
# install dependencies
go get github.com/fatih/gomodifytags
2017-07-06 08:57:35 -04:00
go get golang.org/x/tools/cmd/goimports
2017-03-07 12:04:28 -05:00
2017-02-11 08:01:38 -05:00
# cleanup test.log
if [ -f "test.log" ]; then
rm test.log
fi
2014-10-31 17:30:24 -04:00
2017-02-11 08:01:38 -05:00
if [ -f "FAILED" ]; then
rm FAILED
fi
2014-10-31 17:30:24 -04:00
2017-02-11 08:01:38 -05:00
for test_file in ../autoload/go/*_test.vim
do
vim -u NONE -S runtest.vim $test_file
done
2014-10-31 17:30:24 -04:00
2017-02-11 08:01:38 -05:00
if [ -f "test.log" ]; then
cat test.log
fi
2014-10-31 17:30:24 -04:00
2017-02-11 08:01:38 -05:00
# if Failed exists, test failed
if [ -f "FAILED" ]; then
2014-10-31 17:30:24 -04:00
echo 2>&1 "FAIL"
exit 1
fi
echo 2>&1 "PASS"
2017-07-16 08:28:30 -04:00
# Run vimhelplint
[ -d vim-vimhelplint ] || git clone https://github.com/machakann/vim-vimhelplint
echo "Running vimhelplint"
lint=$(vim -esN --cmd 'set rtp+=./vim-vimhelplint' -c 'filetype plugin on' \
-c 'e ../doc/vim-go.txt' -c 'verb VimhelpLintEcho' -c q 2>&1)
if [ -n "$lint" ]; then
exit 1
else
exit 0
fi