From bc7e963c37d9c8d1c854ac960df241cfa34e3dc5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 11:11:38 +0200 Subject: Adding upstream version 1.7.2. Signed-off-by: Daniel Baumann --- build/run-gcov.sh | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100755 build/run-gcov.sh (limited to 'build/run-gcov.sh') diff --git a/build/run-gcov.sh b/build/run-gcov.sh new file mode 100755 index 0000000..98f911f --- /dev/null +++ b/build/run-gcov.sh @@ -0,0 +1,130 @@ +#!/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 -- cgit v1.2.3