Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 66 lines (52 sloc) 2.242 kB
e241eaa Version 0.0.3: Initial upload
Kana Natsuno authored
1 #!/bin/bash
484aa52 Version 0.0.4
Kana Natsuno authored
2 # bin/vspec - Driver script to test Vim script
e8deaae Version 1.1.0
Kana Natsuno authored
3 # Version: 1.1.0
e66b3fe Version 1.0.0
Kana Natsuno authored
4 # Copyright (C) 2009-2012 Kana Natsuno <http://whileimautomaton.net/>
484aa52 Version 0.0.4
Kana Natsuno authored
5 # License: So-called MIT/X license {{{
6 # Permission is hereby granted, free of charge, to any person obtaining
7 # a copy of this software and associated documentation files (the
8 # "Software"), to deal in the Software without restriction, including
9 # without limitation the rights to use, copy, modify, merge, publish,
10 # distribute, sublicense, and/or sell copies of the Software, and to
11 # permit persons to whom the Software is furnished to do so, subject to
12 # the following conditions:
13 #
14 # The above copyright notice and this permission notice shall be included
15 # in all copies or substantial portions of the Software.
16 #
17 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 # }}}
e241eaa Version 0.0.3: Initial upload
Kana Natsuno authored
25
26 if [ "$#" = '0' ] || [ "$1" = '-h' ] || [ "$1" = '--help' ]
27 then
e66b3fe Version 1.0.0
Kana Natsuno authored
28 echo "Usage: $0 [{non-standard-runtimepath} ...] {input-script}"
e241eaa Version 0.0.3: Initial upload
Kana Natsuno authored
29 exit
30 fi
31
e66b3fe Version 1.0.0
Kana Natsuno authored
32 args=("$@")
e241eaa Version 0.0.3: Initial upload
Kana Natsuno authored
33 driver_script=",,$$.vim"
e66b3fe Version 1.0.0
Kana Natsuno authored
34 input_script="${args[$((${#args[@]}- 1))]}"
35 unset args[$((${#args[@]}- 1))] # Now holds all {non-standard-runtimepath}s.
e241eaa Version 0.0.3: Initial upload
Kana Natsuno authored
36
37
38
39
40 cat <<END >"$driver_script"
41 function s:main()
76a0e21 Version 1.0.2
Kana Natsuno authored
42 let standard_paths = split(&runtimepath, ',')[1:-2]
e66b3fe Version 1.0.0
Kana Natsuno authored
43 let non_standard_paths = reverse(['$(echo "${args[@]}" |
44 sed "s/ */', '/g")'])
e241eaa Version 0.0.3: Initial upload
Kana Natsuno authored
45 let all_paths = copy(standard_paths)
46 for i in non_standard_paths
47 let all_paths = [i] + all_paths + [i . '/after']
48 endfor
49 let &runtimepath = join(all_paths, ',')
50
51 1 verbose call vspec#test('$input_script')
52 qall!
53 endfunction
54 call s:main()
55 END
56
76a0e21 Version 1.0.2
Kana Natsuno authored
57 vim -u NONE -i NONE -N -e -s -S "$driver_script" 2>&1
e241eaa Version 0.0.3: Initial upload
Kana Natsuno authored
58
59
60
61
62 rm -f "$driver_script"
63
484aa52 Version 0.0.4
Kana Natsuno authored
64 # __END__
65 # vim: foldmethod=marker
Something went wrong with that request. Please try again.