source: rtems/doc/posix1003.1/summarize @ c78be42

4.104.114.84.95
Last change on this file since c78be42 was c78be42, checked in by Joel Sherrill <joel.sherrill@…>, on 03/17/98 at 23:10:33

First attempt at adding constants and feature flags

  • Property mode set to 100755
File size: 5.9 KB
Line 
1#! /bin/sh
2#
3#  Generate the summary chapter
4#
5#  $Id$
6#
7
8echo "@c"
9echo "@c DO NOT EDIT -- AUTOMATICALLY GENERATED!!!"
10echo "@c"
11echo
12echo "@chapter Compliance Summary"
13echo
14
15wc2()
16{
17  pattern=$1
18  shift
19  grep "${pattern}" $* | wc -l
20}
21
22wc3()
23{
24  pattern=$1
25  filter=$2
26  shift ; shift
27  grep "${pattern}" $* | grep "${filter}" | wc -l
28}
29
30# adds the numbers passed on the command line
31addit()
32{
33  sumx=0
34  for x in $*
35  do
36    sumx=`expr $sumx + $x`
37  done
38  echo $sumx
39}
40
41summarize_chapter()
42{
43  echo
44  # takes at least 3.0 inches for each generated section
45  echo "@need 3000"
46  if [ $# -eq 1 ] ; then
47    grep "^@chapter" $1 | \
48      sed -e "s/^.chapter/@section/"  \
49          -e "s/$/ Chapter/"
50  else
51    echo "@section Overall Summary"
52  fi
53
54  echo
55
56  # functions
57
58  functions_total=`wc2 "()" $*`
59  functions_implemented=`   wc3 "()" "Implemented" $*`
60  functions_unimplemented=` wc3 "()" "Unimplemented" $*`
61  functions_unmplementable=`wc3 "()" "Unimplementable" $*`
62  functions_partial=`       wc3 "()" "Partial Implementation" $*`
63  functions_dummy=`         wc3 "()" "Dummy Implementation" $*`
64  functions_untested=`      wc3 "()" "Untested Implementation" $*`
65
66  functions_sum=`addit ${functions_implemented} \
67     ${functions_unimplemented} ${functions_unmplementable} \
68     ${functions_partial}       ${functions_dummy} \
69     ${functions_untested}`
70
71  # data types
72
73  datatypes_total=`wc2 "Type," $*`
74  datatypes_implemented=`   wc3 "Type," "Implemented" $*`
75  datatypes_unimplemented=` wc3 "Type," "Unimplemented" $*`
76  datatypes_unmplementable=`wc3 "Type," "Unimplementable" $*`
77  datatypes_partial=`       wc3 "Type," "Partial Implementation" $*`
78  datatypes_dummy=`         wc3 "Type," "Dummy Implementation" $*`
79  datatypes_untested=`      wc3 "Type," "Untested Implementation" $*`
80
81  datatypes_sum=`addit ${datatypes_implemented} \
82     ${datatypes_unimplemented} ${datatypes_unmplementable} \
83     ${datatypes_partial}       ${datatypes_dummy} \
84     ${datatypes_untested}`
85
86  # feature flags
87
88  features_total=`wc2 "Feature Flag," $*`
89  features_implemented=`   wc3 "Feature Flag," "Implemented" $*`
90  features_unimplemented=` wc3 "Feature Flag," "Unimplemented" $*`
91  features_unmplementable=`wc3 "Feature Flag," "Unimplementable" $*`
92  features_partial=`       wc3 "Feature Flag," "Partial Implementation" $*`
93  features_dummy=`         wc3 "Feature Flag," "Dummy Implementation" $*`
94  features_untested=`      wc3 "Feature Flag," "Untested Implementation" $*`
95
96  features_sum=`addit ${features_implemented} \
97     ${features_unimplemented} ${features_unmplementable} \
98     ${features_partial}       ${features_dummy} \
99     ${features_untested}`
100
101  # constants
102
103  constants_total=`wc2 "Constant," $*`
104  constants_implemented=`   wc3 "Constant," "Implemented" $*`
105  constants_unimplemented=` wc3 "Constant," "Unimplemented" $*`
106  constants_unmplementable=`wc3 "Constant," "Unimplementable" $*`
107  constants_partial=`       wc3 "Constant," "Partial Implementation" $*`
108  constants_dummy=`         wc3 "Constant," "Dummy Implementation" $*`
109  constants_untested=`      wc3 "Constant," "Untested Implementation" $*`
110
111  constants_sum=`addit ${constants_implemented} \
112     ${constants_unimplemented} ${constants_unmplementable} \
113     ${constants_partial}       ${constants_dummy} \
114     ${constants_untested}`
115
116  # Now print the reports
117
118  echo "@example"
119  echo "Functions:"
120  echo "    Total Number    : ${functions_total}"
121  echo "    Implemented     : ${functions_implemented}"
122  echo "    Unimplemented   : ${functions_unimplemented}"
123  echo "    Unimplementable : ${functions_unmplementable}"
124  echo "    Partial         : ${functions_partial}"
125  echo "    Dummy           : ${functions_dummy}"
126  echo "    Untested        : ${functions_untested}"
127  echo "@end example"
128  echo
129  if [ ${functions_sum} -ne ${functions_total} ] ; then
130    echo "@sp 1"
131    echo "@center @b{FUNCTION COUNTS DO NOT ADD UP!!}}"
132    echo "@sp 1"
133  fi
134
135  echo "@example"
136  echo "Data Types:"
137  echo "    Total Number    : ${datatypes_total}"
138  echo "    Implemented     : ${datatypes_implemented}"
139  echo "    Unimplemented   : ${datatypes_unimplemented}"
140  echo "    Unimplementable : ${datatypes_unmplementable}"
141  echo "    Partial         : ${datatypes_partial}"
142  echo "    Dummy           : ${datatypes_dummy}"
143  echo "    Untested        : ${datatypes_untested}"
144  echo "@end example"
145  echo
146  if [ ${datatypes_sum} -ne ${datatypes_total} ] ; then
147    echo "@sp 1"
148    echo "@center @b{DATA TYPE COUNTS DO NOT ADD UP!!}"
149    echo "@sp 1"
150  fi
151
152  echo "@example"
153  echo "Feature Flags:"
154  echo "    Total Number    : ${features_total}"
155  echo "    Implemented     : ${features_implemented}"
156  echo "    Unimplemented   : ${features_unimplemented}"
157  echo "    Unimplementable : ${features_unmplementable}"
158  echo "    Partial         : ${features_partial}"
159  echo "    Dummy           : ${features_dummy}"
160  echo "    Untested        : ${features_untested}"
161  echo "@end example"
162  echo
163  if [ ${features_sum} -ne ${features_total} ] ; then
164    echo "@sp 1"
165    echo "@center @b{FEATURE FLAG COUNTS DO NOT ADD UP!!}"
166    echo "@sp 1"
167  fi
168
169  echo "@example"
170  echo "Constants:"
171  echo "    Total Number    : ${constants_total}"
172  echo "    Implemented     : ${constants_implemented}"
173  echo "    Unimplemented   : ${constants_unimplemented}"
174  echo "    Unimplementable : ${constants_unmplementable}"
175  echo "    Partial         : ${constants_partial}"
176  echo "    Dummy           : ${constants_dummy}"
177  echo "    Untested        : ${constants_untested}"
178  echo "@end example"
179  echo
180  if [ ${constants_sum} -ne ${constants_total} ] ; then
181    echo "@sp 1"
182    echo "@center @b{CONSTANT COUNTS DO NOT ADD UP!!}"
183    echo "@sp 1"
184  fi
185}
186
187chapters="ch01.t ch02.t ch03.t ch04.t ch05.t ch06.t ch07.t ch08.t \
188    ch09.t ch10.t ch11.t ch12.t ch13.t ch14.t ch15.t ch16.t ch17.t ch18.t"
189
190# go through the chapters one at a time
191for chapter in ${chapters}
192do
193  summarize_chapter $chapter
194done
195
196# now generate the overall summary
197summarize_chapter ${chapters}
198
199
200
Note: See TracBrowser for help on using the repository browser.