File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ if [ $# -eq 0 ]; then
4
+ echo " USAGE: ./test/run_command.sh <vimlparser command>"
5
+ echo " Example: ./test/run_command.sh python3 py/vimlparser.py"
6
+ exit 1
7
+ fi
8
+ vimlparser=$@
9
+
10
+ exit_status=0
11
+
12
+ test_file () {
13
+ local vimfile=$1
14
+ local base=$( basename " $vimfile " " .vim" )
15
+ local okfile=" test/${base} .ok"
16
+ local outfile=" test/${base} .out"
17
+
18
+ if [[ -f " test/${base} .skip" ]]; then
19
+ return
20
+ fi
21
+
22
+ local neovim=" "
23
+ if [[ $vimfile =~ " test_neo" ]]; then
24
+ neovim=" --neovim"
25
+ fi
26
+
27
+ rm -f ${outfile}
28
+
29
+ ${vimlparser} ${neovim} ${vimfile} & > ${outfile}
30
+
31
+ diffout=$( diff -u ${outfile} ${okfile} )
32
+ if [ -n " $diffout " ]; then
33
+ exit_status=1
34
+ echo " ${diffout} "
35
+ fi
36
+ }
37
+
38
+ for f in test/test* .vim; do
39
+ test_file ${f}
40
+ done
41
+
42
+ exit $exit_status
You can’t perform that action at this time.
0 commit comments