3 # Script to run the unit-tests for the LSP Vim plugin
5 VIMPRG=${VIMPRG:=$(which vim)}
6 if [ -z "$VIMPRG" ]; then
7 echo "ERROR: vim (\$VIMPRG) is not found in PATH"
11 VIM_CMD="$VIMPRG -u NONE -U NONE -i NONE --noplugin -N --not-a-term"
13 TESTS="clangd_tests.vim tsserver_tests.vim gopls_tests.vim not_lspserver_related_tests.vim"
17 echo "Running tests in $testfile"
18 $VIM_CMD -c "let g:TestName='$testfile'" -S runner.vim
20 if ! [ -f results.txt ]; then
21 echo "ERROR: Test results file 'results.txt' is not found."
27 if grep -qw FAIL results.txt; then
28 echo "ERROR: Some test(s) in $testfile failed."
32 echo "SUCCESS: All the tests in $testfile passed."
36 for testfile in $TESTS
38 RunTestsInFile $testfile
41 for encoding in "utf-8" "utf-16" "utf-32"
43 export LSP_OFFSET_ENCODING=$encoding
44 echo "LSP offset encoding: $LSP_OFFSET_ENCODING"
45 RunTestsInFile clangd_offsetencoding.vim
48 echo "SUCCESS: All the tests passed."