summaryrefslogtreecommitdiffstats
path: root/aspectj-attic/ajdoc-testsrc/org/aspectj/tools/ajdoc/genSeeTestCases.sh
blob: ab8e7587e63e653732a56d4e21f8bbd3da394410 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
# generate test cases for {@link} tags

## permitted variants:
# - everything but member name can be empty
# - spaces between everything except around sharp #
# - 0..n parm types
# - simple or qualified type names
# - Type[ ][ ] but not Type [ ] [ ]
# todo: 
# - URL's acceptable for link??

count=0
pre="        "
echo "    static final SeeTestCase[] CASES = new SeeTestCase[] { null // first is null"

for type in "" Type junit.Type org.aspectj.Type; do 
for name in memberName; do
for parms in "" "()" "(int)" "(int,String)" "( int , String[ ][ ] )" "( foo.Bar , com.sun.X )" "(foo.Bar)"  ; do
for label in "" label "a label"; do

   # method, field X no spaces, spaces
   echo "$pre, new SeeTestCase(\"$type#$name$parms $label\",  \"$type\", \"$name\", \"$parms\", \"$label\")  // $count"
   echo "$pre, new SeeTestCase(\" $type#$name $parms $label \",  \"$type\", \"$name\", \"$parms\", \"$label\")"
   count=`expr $count + 2`
done; done; done; done;
echo "${pre}};";

i=0
while [ $i -lt $count ] ; do
   i=`expr $i + 1` # first is null
   echo "    public void testLink$i() { CASES[$i].run(); }"
done