source: rtems-testing/rtems-coverage/generate_coverage_html @ 8a347d0

4.11
Last change on this file since 8a347d0 was 8a347d0, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 16, 2009 at 12:25:56 PM

2009-09-16 Joel Sherrill <joel.sherrill@…>

  • generate_coverage_html: Turn YYYYMMDD into YYYY-MM-DD.
  • Property mode set to 100755
File size: 2.6 KB
Line 
1#! /bin/sh
2#
3#  Combine the various reports into a single html file
4#
5#  $Id$
6#
7
8vfile=`dirname $0`/VERSIONS-COVERAGE
9if [ ! -r ${vfile} ] ; then
10  echo VERSIONS-COVERAGE file not found
11  exit 1
12fi
13
14source ${vfile}
15
16if [ ! -d ${BASEDIR} ] ; then
17  echo Have you set the BASEDIR in VERSIONS correctly?
18  exit 1
19fi
20
21progname=${0##*/}        # fast basename hack for ksh, bash
22
23if [ $# -ne 1 ] ; then
24  echo Usage: $0 directory
25  exit 1
26fi
27
28if [ ! -d ${1} ] ; then
29  echo ${1} is not a directory
30  exit 1
31fi
32
33print_doc_top()
34{
35cat <<EOF
36<HTML>
37<HEAD>
38<TITLE>RTEMS Coverage Reports</TITLE>
39<meta http-equiv="Content-Language" content="English" />
40<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
41<link rel="stylesheet" type="text/css" href="rtems/style.css" media="screen" />
42</HEAD>
43<body>
44<div class="heading">RTEMS Coverage Results
45EOF
46echo "<div class=\"datetime\">"`date`"</div>"
47cat <<EOF
48</div>
49<table class="stats-table" $cellspacing="1" cellpadding="2">
50EOF
51}
52
53print_doc_bottom()
54{
55cat <<EOF
56</table>
57</body>
58EOF
59}
60
61print_heading()
62{
63  echo "<th>"${*}"</th>"
64}
65
66doit()
67{
68  print_doc_top
69
70  # now cat rows
71  for bsp in ${BSPs}
72  do
73    cpu=`grep "^Target" ${bsp}-*/configuration.txt | \
74          sed -e 's/^.*Target: *//' | sort -u | cut -d'-' -f1`
75    echo "<table class=\"stats-table\" cellspacing=\"1\" cellpadding=\"2\">"
76    echo "<tr class=\"stats-table-target\"><td colspan=\"11\"> <strong>" \
77          ${cpu}/${bsp} "</strong></td></tr>"
78    echo "<tr class=\"stats-table-top\">"
79    ### generate header
80    print_heading Day
81    print_heading Time
82    print_heading Optimization
83    print_heading POSIX Enabled
84    print_heading Developmental Enabled
85    print_heading Uncovered Ranges
86    print_heading Uncovered Percentage
87    print_heading Covered Percentage
88    print_heading Uncovered Bytes
89    print_heading Total Bytes
90    print_heading Results
91
92    #cat ${bsp}-*-*-*/row.html | sed -e 's/<TD>/<TD><CENTER>/g' \
93    #   -e 's/<\/TD>/<\/CENTER><\/TD>/g'
94
95    ls -1 ${bsp}-*-*-*/row.html | sort -t - -k 1,2 -k 3,4n | xargs -e cat | \
96       sed \
97        -e 's/<TD>\(20[0-9][0-9]\)\([0-1][0-9]\)\([0-9][0-9]\)/<TD>\1-\2-\3/' \
98        -e 's/<TR>/<tr class="stats-table-row">/g' \
99        -e 's/<TD>/<td align="center">/g'
100  done
101  print_doc_bottom
102}
103
104cd $1
105
106if [ `ls -1 *.tar.bz2 2>/dev/null | wc -l` -eq 0 ]; then
107  echo "No tarballs.  Is $1 really a coverage publishing directory?"
108  exit 1
109fi
110
111for i in *.tar.bz2
112do
113  tar xjf $i
114done
115
116if [ ! -d rtems ] ; then
117  mkdir rtems
118fi
119
120cp ${COVBASE}/style.css rtems/style.css
121
122BSPs=`find * -maxdepth 1 -type d | cut -d'-' -f1 | uniq | grep -v rtems`
123
124doit >index.html
125exit 0
Note: See TracBrowser for help on using the repository browser.