diff options
author | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2004-03-10 19:36:38 +0000 |
---|---|---|
committer | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2004-03-10 19:36:38 +0000 |
commit | d8c749427e951d41c04dcb735c267d83fd686fe0 (patch) | |
tree | 922f7fcff32af780006de2df327ac2123c303d68 /build/run-gcov.sh | |
parent | 0b297e32abeb31ebe6b0da44c8c9f313e7fdb903 (diff) | |
download | libapr-d8c749427e951d41c04dcb735c267d83fd686fe0.tar.gz |
Add percent tested to the output of the coverage script. Also
colorize the page based on the percent tested.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64963 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build/run-gcov.sh')
-rwxr-xr-x | build/run-gcov.sh | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/build/run-gcov.sh b/build/run-gcov.sh index 3543e7274..702d9508f 100755 --- a/build/run-gcov.sh +++ b/build/run-gcov.sh @@ -5,10 +5,6 @@ if [ ! -d coverage ]; then fi cd coverage -for i in `find .. -name "*.bb" -maxdepth 1`; do - gcov $i -o .. -done - # It would be really nice to find a better way to do this than copying the # HTML into this script. But, I am being lazy right now. cat > index.html << EOF @@ -86,14 +82,35 @@ code. To generate this data, do the following:</p> but all tests should be moving to the unified framework, so this is correct.</p> </blockquote> + <table border="0" width="100%" cellspacing="4"> EOF -for i in `find . -name "*.gcov" -print`; do +for i in `find .. -name "*.bb" -maxdepth 1`; do + percent=`gcov $i -o .. | grep "%" | awk -F'%' {'print $1'}` name=`echo $i | awk -F'/' {'print $2'}` - echo " <a href=\"$name\">$name</a><br>" >> index.html -done; + basename=`echo $name | awk -F'.' {'print $1'}` + + if [ "x$percent" = "x" ]; then + echo "<tr>" >> index.html + echo "<td bgcolor=#ffffff> Error generating data for $basename<br>" >> index.html + continue; + fi + intpercent=`echo "$percent/1" | bc` + if [ $intpercent -lt 33 ]; then + color="#ffaaaa" + else if [ $intpercent -lt 66 ]; then + color="#ffff77" + else + color="#aaffaa" + fi + fi + + echo "<tr>" >> index.html + echo "<td bgcolor=$color><a href=\"$basename.c.gcov\">$basename</a><br>" >> index.html + echo "<td bgcolor=$color>$percent% tested" >> index.html +done -echo "<p>Last generated `date`</p>" >> index.html +echo "</table><p>Last generated `date`</p>" >> index.html cat >> index.html << EOF </td></tr> |