Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 81 lines (61 sloc) 1.62 KB
#!/usr/bin/env bash
if [ "$1" == "--help" ]; then
echo "$(basename $0) <optional list of tests in form file:func>"
echo "e.g.: "
echo " - run all tests: $0"
echo " - run specific tests script: $0 signature_help.test.vim"
echo " - run specific tests fun: $0 signature_help.test.vim:Test_signatures_TopLine\(\)"
exit 0
fi
RUN_VIM="vim --clean --not-a-term"
RUN_TEST="${RUN_VIM} -S lib/run_test.vim"
pushd $(dirname $0) > /dev/null
echo "Running YouCompleteMe Vim tests"
RESULT=0
TESTS="$@"
if [ -z "$TESTS" ]; then
TESTS=*.test.vim
fi
for t in ${TESTS}; do
echo ""
echo "%RUN: $t"
# split on : into fileName and testName
IFS=: read -s t T <<< "$t"
TESTLOGDIR=$(pwd)/logs/$t
if ${RUN_TEST} --cmd 'au SwapExists * let v:swapchoice = "e"' $t $T \
&& [ -f $t.res ]; then
echo "%PASS: $t PASSED"
else
echo "%FAIL: $t FAILED - see $TESTLOGDIR"
RESULT=1
fi
rm -rf $TESTLOGDIR
mkdir -p $TESTLOGDIR
${RUN_VIM} --version > ${TESTLOGDIR}/vimversion
for l in messages debuglog test.log *.testlog; do
# In CI we can't view the output files, so we just have to cat them
if [ -f $l ]; then
if [ "$YCM_TEST_STDOUT" ]; then
echo ""
echo ""
echo "*** START: $l ***"
cat $l
echo "*** END: $l ***"
fi
mv $l $TESTLOGDIR
fi
done
rm -f $t.res
done
echo "Done running tests"
if [ -n "${COVERAGE}" ]; then
echo "Preparing Vim coverage data..."
covimerage write_coverage --source $(pwd)/.. --data-file .coverage.vim \
.vim_profile
mv .coverage.* ../
echo "Done"
fi
popd > /dev/null
echo ""
echo "All done."
exit $RESULT
You can’t perform that action at this time.