xref: /Universal-ctags/Tmain/kinds-all-with-spec.d/run.sh (revision c314f261c930c6407a904f6e598d646db1c0df35)
1#!/bin/sh
2
3# Copyright: 2019 Masatake YAMATO
4# License: GPL-2
5
6CTAGS=$1
7
8t ()
9{
10	echo '#' "--all-kinds=$1" 1>&2
11	$CTAGS --quiet --options=NONE -o - --all-kinds="$1" --fields=-T input.c
12	echo '#' "--kinds-all=$1" 1>&2
13	$CTAGS --quiet --options=NONE -o - --kinds-all="$1" --fields=-T input.c
14}
15
16echo '#' 1>&2
17echo '# unexpected flags after operators ([+-])' 1>&2
18echo '#' 1>&2
19t '*-a'
20t '*-{abc}'
21t '*+a'
22t '*+{abc}'
23
24t 'F-a'
25t 'F-{abc}'
26t 'F+a'
27t 'F+{abc}'
28
29t '{file}-a'
30t '{file}-{abc}'
31t '{file}+a'
32t '{file}+{abc}'
33
34t '+F-a'
35t '+F-{abc}'
36t '+F+a'
37t '+F+{abc}'
38
39t '+{file}-a'
40t '+{file}-{abc}'
41t '+{file}+a'
42t '+{file}+{abc}'
43
44echo '#' 1>&2
45echo '# repeaed operators ([+-])' 1>&2
46echo '#' 1>&2
47t '*--{file}'
48t '*--F'
49t '*++{file}'
50t '*++F'
51t '*+-{file}'
52t '*+-F'
53t '*-+{file}'
54t '*-+F'
55
56t '{file}--F'
57t '{file}++F'
58t '{file}-+F'
59t '{file}+-F'
60
61t '{file}--{file}'
62t '{file}++{file}'
63t '{file}-+{file}'
64t '{file}+-{file}'
65
66t 'F--{file}'
67t 'F++{file}'
68t 'F-+{file}'
69t 'F+-{file}'
70
71t 'F--F'
72t 'F++F'
73t 'F-+F'
74t 'F+-F'
75
76echo '#' 1>&2
77echo '# redundant * usage' 1>&2
78echo '#' 1>&2
79t '-*'
80t '+*'
81t 'F-*'
82t 'F+*'
83t '{file}-*'
84t '{file}+*'
85t '+F-*'
86t '-F+*'
87t '+{file}-*'
88t '-{file}+*'
89
90echo '#' 1>&2
91echo '# Just print the parsed file name' 1>&2
92echo '#' 1>&2
93
94$CTAGS --quiet --options=NONE -o- --all-kinds=F --extras=+f --fields=-T input.c
95$CTAGS --quiet --options=NONE -o- --all-kinds=FF --extras=+f --fields=-T input.c
96$CTAGS --quiet --options=NONE -o- --all-kinds=-F+F --extras=+f --fields=-T input.c
97$CTAGS --quiet --options=NONE -o- --all-kinds='*' --all-kinds=F --extras=+f --fields=-T input.c
98
99$CTAGS --quiet --options=NONE -o- --kinds-all=F --extras=+f --fields=-T input.c
100$CTAGS --quiet --options=NONE -o- --kinds-all=FF --extras=+f --fields=-T input.c
101$CTAGS --quiet --options=NONE -o- --kinds-all=-F+F --extras=+f --fields=-T input.c
102$CTAGS --quiet --options=NONE -o- --kinds-all='*' --kinds-all=F --extras=+f --fields=-T input.c
103
104echo '#' 1>&2
105echo '# The original test cases' 1>&2
106echo '#' 1>&2
107if ! $CTAGS --quiet --options=NONE --kinds-all=xyz --_force-quit=0; then
108	$CTAGS --quiet --options=NONE --all-kinds=abc --_force-quit=0
109else
110	exit 0
111fi
112