#!/bin/sh if [ ! -d coverage ]; then mkdir coverage fi cd coverage # 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 Test Coverage

The Apache Portable Runtime Project

ApacheCon

Get Involved

  • CVS
  • Mailing Lists
  • Snapshots
  • Build on Win32
  • Build on Unix
  • Download!

  • from a mirror
  • Docs

  • APR
  • APR-util
  • APR-iconv
  • Guidelines

  • Project Guidelines
  • Contributing
  • Version Numbers
  • Miscellaneous

  • License
  • Projects using APR
  • APR Test Coverage

    This should give us some idea of how well our tests actually stress our code. To generate this data, do the following:

  • ./buildconf
  • CFLAGS="-fprofile-arcs -ftest-coverage ./configure
  • make
  • cd test
  • make
  • ./testall
  • cd ..
  • make gcov
  • Note that this will only generate test coverage data for the testall script, but all tests should be moving to the unified framework, so this is correct.

    EOF for i in `find .. -name "*.bb" -maxdepth 1 | sort`; do percent=`gcov $i -o .. | grep "%" | awk -F'%' {'print $1'}` name=`echo $i | awk -F'/' {'print $2'}` basename=`echo $name | awk -F'.' {'print $1'}` if [ "x$percent" = "x" ]; then echo "" >> index.html echo "" >> index.html echo "
    Error generating data for $basename
    " >> 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 "
    $basename
    " >> index.html echo "
    $percent% tested" >> index.html done echo "

    Last generated `date`

    " >> index.html cat >> index.html << EOF

    Copyright © 1999-2004, The Apache Software Foundation
    EOF