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