#!/usr/bin/env bash RUN_VIM="vim --noplugin --clean --not-a-term" RUN_TEST="${RUN_VIM} -S run_test.vim" if [ -z "$VIMSPECTOR_MIMODE" ]; then if which -s lldb; then export VIMSPECTOR_MIMODE=lldb elif which -s gdb; then export VIMSPECTOR_MIMODE=gdb else echo "Couldn't guess VIMSPECTOR_MIMODE. Need lldb or gdb in path" exit 1 fi fi echo "Testing with VIMSPECTOR_MIMODE=$VIMSPECTOR_MIMODE" echo "%SETUP - Building test programs..." set -e pushd tests/testdata/cpp/simple make clean simple popd set +e echo "%DONE - built test programs" pushd tests > /dev/null echo "Running Vimspector Vim tests" RESULT=0 for t in *.test.vim; do echo "" echo "%RUN: $t" rm -f messages debuglog if ${RUN_TEST} $t --cmd 'au SwapExists * let v:swapchoice = "e"'; then echo "%PASS: $t PASSED" else cat messages echo "%FAIL: $t FAILED" RESULT=1 fi done popd > /dev/null echo "" echo "All done." exit $RESULT