Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 66 lines (52 sloc) 2.242 kb
e241eaa1 »
2010-03-12 Version 0.0.3: Initial upload
1 #!/bin/bash
484aa525 »
2010-04-04 Version 0.0.4
2 # bin/vspec - Driver script to test Vim script
e8deaae3 »
2012-10-29 Version 1.1.0
3 # Version: 1.1.0
e66b3fee »
2012-01-30 Version 1.0.0
4 # Copyright (C) 2009-2012 Kana Natsuno <http://whileimautomaton.net/>
484aa525 »
2010-04-04 Version 0.0.4
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 # }}}
e241eaa1 »
2010-03-12 Version 0.0.3: Initial upload
25
26 if [ "$#" = '0' ] || [ "$1" = '-h' ] || [ "$1" = '--help' ]
27 then
e66b3fee »
2012-01-30 Version 1.0.0
28 echo "Usage: $0 [{non-standard-runtimepath} ...] {input-script}"
e241eaa1 »
2010-03-12 Version 0.0.3: Initial upload
29 exit
30 fi
31
e66b3fee »
2012-01-30 Version 1.0.0
32 args=("$@")
e241eaa1 »
2010-03-12 Version 0.0.3: Initial upload
33 driver_script=",,$$.vim"
e66b3fee »
2012-01-30 Version 1.0.0
34 input_script="${args[$((${#args[@]}- 1))]}"
35 unset args[$((${#args[@]}- 1))] # Now holds all {non-standard-runtimepath}s.
e241eaa1 »
2010-03-12 Version 0.0.3: Initial upload
36
37
38
39
40 cat <<END >"$driver_script"
41 function s:main()
76a0e21a »
2012-02-12 Version 1.0.2
42 let standard_paths = split(&runtimepath, ',')[1:-2]
e66b3fee »
2012-01-30 Version 1.0.0
43 let non_standard_paths = reverse(['$(echo "${args[@]}" |
44 sed "s/ */', '/g")'])
e241eaa1 »
2010-03-12 Version 0.0.3: Initial upload
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
76a0e21a »
2012-02-12 Version 1.0.2
57 vim -u NONE -i NONE -N -e -s -S "$driver_script" 2>&1
e241eaa1 »
2010-03-12 Version 0.0.3: Initial upload
58
59
60
61
62 rm -f "$driver_script"
63
484aa525 »
2010-04-04 Version 0.0.4
64 # __END__
65 # vim: foldmethod=marker
Something went wrong with that request. Please try again.