summaryrefslogtreecommitdiffstats
path: root/doc/posix1003.1/summarize
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-03-16 22:43:37 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-03-16 22:43:37 +0000
commit2a087f30a4e5d2b72e0bc046865bb7f5c4c5c22f (patch)
tree13aeb2a51322618ccc986361ebf6e3d72d989eb7 /doc/posix1003.1/summarize
parentAdded function status and data types (diff)
downloadrtems-2a087f30a4e5d2b72e0bc046865bb7f5c4c5c22f.tar.bz2
Added types, status of functions, cleaned up output of summarize.
Diffstat (limited to 'doc/posix1003.1/summarize')
-rwxr-xr-xdoc/posix1003.1/summarize104
1 files changed, 79 insertions, 25 deletions
diff --git a/doc/posix1003.1/summarize b/doc/posix1003.1/summarize
index bbe954acd2..c60ce3a6d9 100755
--- a/doc/posix1003.1/summarize
+++ b/doc/posix1003.1/summarize
@@ -14,61 +14,115 @@ echo
wc2()
{
- grep "$1" $2 | wc -l
+ pattern=$1
+ shift
+ grep "${pattern}" $* | wc -l
}
wc3()
{
- grep "$1" $2 | grep "$3" | wc -l
+ pattern=$1
+ filter=$2
+ shift ; shift
+ grep "${pattern}" $* | grep "${filter}" | wc -l
+}
+
+# adds the numbers passed on the command line
+addit()
+{
+ sumx=0
+ for x in $*
+ do
+ sumx=`expr $sumx + $x`
+ done
+ echo $sumx
}
summarize_chapter()
{
- grep "^@chapter" $1 | \
- sed -e "s/^.chapter/@section/" \
- -e "s/$/ Chapter/"
+ echo
+ # takes at least 3.0 inches for each generated section
+ echo "@need 3000"
+ if [ $# -eq 1 ] ; then
+ grep "^@chapter" $1 | \
+ sed -e "s/^.chapter/@section/" \
+ -e "s/$/ Chapter/"
+ else
+ echo "@section Overall Summary"
+ fi
+
echo
- functions_total=`wc2 "()" $1 `
- functions_implemented=`wc3 "()" $1 "Implemented"`
- functions_unimplemented=`wc3 "()" $1 "Unimplemented"`
- functions_unmplementable=`wc3 "()" $1 "Unimplementable"`
- functions_dummy=`wc3 "()" $1 "Dummy Implementation"`
- functions_untested=`wc3 "()" $1 "Untested Implementation"`
+ functions_total=`wc2 "()" $*`
+ functions_implemented=` wc3 "()" "Implemented" $*`
+ functions_unimplemented=` wc3 "()" "Unimplemented" $*`
+ functions_unmplementable=`wc3 "()" "Unimplementable" $*`
+ functions_partial=` wc3 "()" "Partial Implementation" $*`
+ functions_dummy=` wc3 "()" "Dummy Implementation" $*`
+ functions_untested=` wc3 "()" "Untested Implementation" $*`
- datatypes_total=`grep "Type," $1 | wc -l`
- datatypes_implemented=`grep "Type," $1 | grep Implemented | wc -l`
- datatypes_unimplemented=`grep "Type," $1 | grep Unimplemented | wc -l`
- datatypes_unmplementable=`grep "Type," $1 | grep Unimplementable | wc -l`
+ functions_sum=`addit ${functions_implemented} \
+ ${functions_unimplemented} ${functions_unmplementable} \
+ ${functions_partial} ${functions_dummy} \
+ ${functions_untested}`
+
+ datatypes_total=`wc2 "Type," $*`
+ datatypes_implemented=` wc3 "Type," "Implemented" $*`
+ datatypes_unimplemented=` wc3 "Type," "Unimplemented" $*`
+ datatypes_unmplementable=`wc3 "Type," "Unimplementable" $*`
+ datatypes_partial=` wc3 "Type," "Partial Implementation" $*`
+ datatypes_dummy=` wc3 "Type," "Dummy Implementation" $*`
+
+ datatypes_sum=`addit ${datatypes_implemented} \
+ ${datatypes_unimplemented} ${datatypes_unmplementable} \
+ ${datatypes_partial} ${datatypes_dummy} \
+ ${datatypes_untested}`
echo "@example"
echo "Functions:"
- echo " Total Number : ${functions_total}"
- echo " Implemented : ${functions_implemented}"
- echo " Unimplemented : ${functions_unimplemented}"
- echo " Unimplementable: ${functions_unmplementable}"
- echo " Working Dummies: ${functions_dummy}"
- echo " Untested : ${functions_untested}"
+ echo " Total Number : ${functions_total}"
+ echo " Implemented : ${functions_implemented}"
+ echo " Unimplemented : ${functions_unimplemented}"
+ echo " Unimplementable : ${functions_unmplementable}"
+ echo " Partial : ${functions_partial}"
+ echo " Dummy : ${functions_dummy}"
+ echo " Untested : ${functions_untested}"
echo "@end example"
echo
+ if [ ${functions_sum} -ne ${functions_total} ] ; then
+ echo "@sp"
+ echo "@center{@b{FUNCTION COUNTS DO NOT ADD UP!!}}"
+ echo "@sp"
+ fi
echo "@example"
echo "Data Types:"
- echo " Total Number : ${datatypes_total}"
- echo " Implemented : ${datatypes_implemented}"
- echo " Unimplemented : ${datatypes_unimplemented}"
- echo " Unimplementable: ${datatypes_unmplementable}"
+ echo " Total Number : ${datatypes_total}"
+ echo " Implemented : ${datatypes_implemented}"
+ echo " Unimplemented : ${datatypes_unimplemented}"
+ echo " Unimplementable : ${datatypes_unmplementable}"
+ echo " Partial : ${datatypes_partial}"
+ echo " Dummy : ${datatypes_dummy}"
echo "@end example"
echo
+ if [ ${datatypes_sum} -ne ${datatypes_total} ] ; then
+ echo "@sp"
+ echo "@center{@b{DATA TYPE COUNTS DO NOT ADD UP!!}}"
+ echo "@sp"
+ fi
}
chapters="ch01.t ch02.t ch03.t ch04.t ch05.t ch06.t ch07.t ch08.t \
ch09.t ch10.t ch11.t ch12.t ch13.t ch14.t ch15.t ch16.t ch17.t ch18.t"
+
+# go through the chapters one at a time
for chapter in ${chapters}
do
summarize_chapter $chapter
done
+# now generate the overall summary
+summarize_chapter ${chapters}