xref: /Universal-ctags/Tmain/kinddef.d/run.sh (revision 97d2a1217882963dbd8e66b5e60a5ec6ac31c268)
1# Copyright: 2016 Masatake YAMATO
2# License: GPL-2
3
4CTAGS="$1 --quiet --options=NONE"
5
6title()
7{
8	echo
9	echo "$@"
10
11	{
12		echo
13		echo "$@"
14	} 1>&2
15}
16
17{
18title '# NOSUCHLANG'
19${CTAGS} --kinddef-NOSUCHLANG=l,name,description --list-kinds-full=NOSUCHLANG
20
21CTAGS="${CTAGS} --langdef=MYTEST"
22
23title '# define "a"'
24${CTAGS} --kinddef-MYTEST=a,aa,aaa --list-kinds-full=MYTEST
25
26title '# no description 1'
27${CTAGS} --kinddef-MYTEST=a,aa, --list-kinds-full=MYTEST
28
29title '# no description 2'
30${CTAGS} --kinddef-MYTEST=a,aa --list-kinds-full=MYTEST
31
32title '# no name 1'
33${CTAGS} --kinddef-MYTEST=a, --list-kinds-full=MYTEST
34
35title '# no name 2'
36${CTAGS} --kinddef-MYTEST=a --list-kinds-full=MYTEST
37
38title '# an empty name 1'
39${CTAGS} --kinddef-MYTEST=a,,x --list-kinds-full=MYTEST
40
41title '# an empty name 2'
42${CTAGS} --kinddef-MYTEST=a,, --list-kinds-full=MYTEST
43
44title '# wrong letter in name 1'
45${CTAGS} --kinddef-MYTEST="a,a	x,d" --list-kinds-full=MYTEST
46
47title '# wrong letter in name 2'
48${CTAGS} --kinddef-MYTEST="a,a	x," --list-kinds-full=MYTEST
49
50title '# wrong letter in name 3'
51${CTAGS} --kinddef-MYTEST="a,a	x" --list-kinds-full=MYTEST
52
53title '# no letter 1'
54${CTAGS} --kinddef-MYTEST=,n,d --list-kinds-full=MYTEST
55
56title '# no letter 2'
57${CTAGS} --kinddef-MYTEST=,n, --list-kinds-full=MYTEST
58
59title '# no letter 3'
60${CTAGS} --kinddef-MYTEST=,n --list-kinds-full=MYTEST
61
62title '# no letter 4'
63${CTAGS} --kinddef-MYTEST=, --list-kinds-full=MYTEST
64
65title '# no letter 5'
66${CTAGS} --kinddef-MYTEST= --list-kinds-full=MYTEST
67
68title '# wrong letter'
69${CTAGS} --kinddef-MYTEST=^ --list-kinds-full=MYTEST
70
71title '# wrong letter (using number)'
72${CTAGS} --kinddef-MYTEST=7 --list-kinds-full=MYTEST
73
74title '# reusing the letter for file kind'
75${CTAGS} --kinddef-MYTEST=F --list-kinds-full=MYTEST
76
77title '# reusing the name for file kind'
78${CTAGS} --kinddef-MYTEST=x,file,desc --list-kinds-full=MYTEST
79
80title '# inject a flag separator'
81${CTAGS} --kinddef-MYTEST='x,kind,desc{foo}' --list-kinds-full=MYTEST
82
83title '# inject a broken flag separator(1)'
84${CTAGS} --kinddef-MYTEST='x,kind,desc{foo' --list-kinds-full=MYTEST
85
86title '# inject a broken flag separator(2)'
87${CTAGS} --kinddef-MYTEST='x,kind,desc{' --list-kinds-full=MYTEST
88
89title '# use a { in description (1)'
90${CTAGS} --kinddef-MYTEST='x,kind,desc\{' --list-kinds-full=MYTEST
91
92title '# use a { in description (2)'
93${CTAGS} --kinddef-MYTEST='x,kind,desc\{}' --list-kinds-full=MYTEST
94
95title '# use a number char as the initial letter'
96${CTAGS} --kinddef-MYTEST='x,0kind,desc' --list-kinds-full=MYTEST
97
98title '# use a number char within the body'
99${CTAGS} --kinddef-MYTEST='x,k0ind,desc' --list-kinds-full=MYTEST
100
101# title '# use a { and \t in description'
102# ${CTAGS} --kinddef-MYTEST='x,kind,desc\{}\t' --list-kinds-full=MYTEST
103
104title '# use a \ in description'
105${CTAGS} --kinddef-MYTEST='x,kind,desc\\backslash' --list-kinds-full=MYTEST
106
107title '# description started from {'
108${CTAGS} --kinddef-MYTEST='x,kind,{' --list-kinds-full=MYTEST
109
110title '# description started from \{'
111${CTAGS} --kinddef-MYTEST='x,kind,\{' --list-kinds-full=MYTEST
112
113title '# _refonly flag'
114${CTAGS} --kinddef-MYTEST='x,kind,desc' --list-kinds-full=MYTEST
115${CTAGS} --kinddef-MYTEST='x,kind,desc' --_roledef-MYTEST.x=role,roleDesc --list-kinds-full=MYTEST
116${CTAGS} --kinddef-MYTEST='x,kind,desc{_refonly}' --_roledef-MYTEST.'{kind}'=role,roleDesc --list-kinds-full=MYTEST
117
118} > /tmp/ctags-tmain-$$.stdout 2>/tmp/ctags-tmain-$$.stderr
119
120sed -e 's/\.exe//g' < /tmp/ctags-tmain-$$.stdout
121rm /tmp/ctags-tmain-$$.stdout
122
123sed -e 's/\.exe//g' < /tmp/ctags-tmain-$$.stderr 1>&2
124rm /tmp/ctags-tmain-$$.stderr
125