forked from puremourning/vimspector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_tests
executable file
·61 lines (46 loc) · 1.06 KB
/
run_tests
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env bash
RUN_VIM="vim --clean --not-a-term"
RUN_TEST="${RUN_VIM} -S lib/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
TESTS="$@"
if [ -z "$TESTS" ]; then
TESTS=*.test.vim
fi
for t in ${TESTS}; do
echo ""
echo "%RUN: $t"
rm -f messages debuglog
# split on : into fileName and testName
IFS=: read -s t T <<< "$t"
if ${RUN_TEST} --cmd 'au SwapExists * let v:swapchoice = "e"' $t $T; 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