3
if [ ! -d coverage ]; then
8
# It would be really nice to find a better way to do this than copying the
9
# HTML into this script. But, I am being lazy right now.
10
cat > index.html << EOF
11
<!-- This is a generated file, do not edit -->
12
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
13
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
16
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
17
<meta name="author" content="APR Developers" /><meta name="email" content="dev@apr.apache.org" />
18
<title>Test Coverage</title>
20
<body bgcolor="#ffffff" text="#000000" link="#525D76">
21
<p><a href="/"><img src="./images/apr_logo_wide.png" alt="The Apache Portable Runtime Project" border="0"/></a></p>
22
<table border="0" width="100%" cellspacing="4">
24
<!-- LEFT SIDE NAVIGATION -->
25
<td valign="top" nowrap="nowrap">
26
<a href="http://apachecon.com/"
27
><img src="http://www.apache.org/images/ac2003-150.gif" height="86"
28
width="150" border="0" alt="ApacheCon" /></a>
29
<p><b>Get Involved</b></p>
30
<menu compact="compact">
31
<li><a href="/anoncvs.txt">CVS</a></li>
32
<li><a href="/mailing-lists.html">Mailing Lists</a></li>
33
<li><a href="http://cvs.apache.org/snapshots/apr/">Snapshots</a></li>
34
<li><a href="/compiling_win32.html">Build on Win32</a></li>
35
<li><a href="/compiling_unix.html">Build on Unix</a></li>
37
<p><b>Download!</b></p>
38
<menu compact="compact">
39
<li><a href="http://www.apache.org/dyn/closer.cgi/apr/">from a mirror</a></li>
42
<menu compact="compact">
43
<li><a href="/docs/apr/">APR</a></li>
44
<li><a href="/docs/apr-util/">APR-util</a></li>
47
<p><b>Guidelines</b></p>
48
<menu compact="compact">
49
<li><a href="/guidelines.html">Project Guidelines</a></li>
50
<li><a href="/patches.html">Contributing</a></li>
51
<li><a href="/versioning.html">Version Numbers</a></li>
53
<p><b><a href="/info/">Miscellaneous</a></b></p>
54
<menu compact="compact">
55
<li><a href="http://www.apache.org/LICENSE.txt">License</a></li>
56
<li><a href="/projects.html">Projects using APR</a></li>
59
<!-- RIGHT SIDE INFORMATION -->
60
<td align="left" valign="top">
61
<table border="0" cellspacing="0" cellpadding="2" width="100%">
62
<tr><td bgcolor="#525D76">
63
<font color="#ffffff" face="arial,helvetica,sanserif">
64
<strong>APR Test Coverage</strong>
69
<p>This should give us some idea of how well our tests actually stress our
70
code. To generate this data, do the following:</p>
71
<menu compact="compact">
73
<li>CFLAGS="-fprofile-arcs -ftest-coverage ./configure</li>
81
<p>Note that this will only generate test coverage data for the testall script,
82
but all tests should be moving to the unified framework, so this is correct.</p>
85
<table border="0" width="100%" cellspacing="0">
88
for i in `find .. -name "*.bb" -maxdepth 1 | sort`; do
89
percent=`gcov $i -o .. | grep "%" | awk -F'%' {'print $1'}`
90
name=`echo $i | awk -F'/' {'print $2'}`
91
basename=`echo $name | awk -F'.' {'print $1'}`
93
if [ "x$percent" = "x" ]; then
94
echo "<tr>" >> index.html
95
echo "<td bgcolor=#ffffff> Error generating data for $basename<br>" >> index.html
98
intpercent=`echo "$percent/1" | bc`
99
if [ $intpercent -lt 33 ]; then
101
else if [ $intpercent -lt 66 ]; then
108
echo "<tr>" >> index.html
109
echo "<td bgcolor=$color><a href=\"$basename.c.gcov\">$basename</a><br>" >> index.html
110
echo "<td bgcolor=$color>$percent% tested" >> index.html
113
echo "</table><p>Last generated `date`</p>" >> index.html
115
cat >> index.html << EOF
119
<tr><td colspan="2"><hr noshade="noshade" size="1"/></td></tr>
120
<tr><td colspan="2" align="center">
122
<em>Copyright © 1999-2004, The Apache Software Foundation</em>