1
0
mirror of https://github.com/amix/vimrc synced 2025-02-28 14:12:51 +08:00
amix-vimrc-mirror/sources_non_forked/vim-go/scripts/test.sh

46 lines
825 B
Bash
Raw Normal View History

2017-02-11 21:01:38 +08:00
#!/bin/bash
2014-11-01 05:30:24 +08:00
2017-02-11 21:01:38 +08:00
set -e
2014-11-01 05:30:24 +08:00
2017-02-11 21:01:38 +08:00
cd $(dirname $0)
2014-11-01 05:30:24 +08:00
2017-03-08 01:04:28 +08:00
# install dependencies
go get github.com/fatih/gomodifytags
2017-07-06 20:57:35 +08:00
go get golang.org/x/tools/cmd/goimports
2017-03-08 01:04:28 +08:00
2017-02-11 21:01:38 +08:00
# cleanup test.log
if [ -f "test.log" ]; then
rm test.log
fi
2014-11-01 05:30:24 +08:00
2017-02-11 21:01:38 +08:00
if [ -f "FAILED" ]; then
rm FAILED
fi
2014-11-01 05:30:24 +08:00
2017-02-11 21:01:38 +08:00
for test_file in ../autoload/go/*_test.vim
do
vim -u NONE -S runtest.vim $test_file
done
2014-11-01 05:30:24 +08:00
2017-02-11 21:01:38 +08:00
if [ -f "test.log" ]; then
cat test.log
fi
2014-11-01 05:30:24 +08:00
2017-02-11 21:01:38 +08:00
# if Failed exists, test failed
if [ -f "FAILED" ]; then
2014-11-01 05:30:24 +08:00
echo 2>&1 "FAIL"
exit 1
fi
echo 2>&1 "PASS"
2017-07-16 20:28:30 +08: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