source: rtems-testing/rtems-coverage/generate_coverage_html @ 4aa1b66

4.11
Last change on this file since 4aa1b66 was 4aa1b66, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 16, 2009 at 2:41:27 PM

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

  • generate_coverage_html: Modify sort order.
  • Property mode set to 100755
File size: 2.8 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    # 1   2      3      4
96    #bsp-opt-yyyymmdd-hhmm.tar.bz2
97    # sort 1,2 alphabetically, sort 3,4 reverse "version"
98    ls -1 ${bsp}-*-*-*/row.html | sort -t -  -k 1,2 -k 3,4Vr | xargs -e cat | \
99       sed \
100        -e 's/<TD>\(20[0-9][0-9]\)\([0-1][0-9]\)\([0-9][0-9]\)/<TD>\1-\2-\3/' \
101        -e 's/<TR>/<tr class="stats-table-row">/g' \
102        -e 's/<TD>/<td align="center">/g'
103  done
104  print_doc_bottom
105}
106
107cd $1
108
109if [ `ls -1 *.tar.bz2 2>/dev/null | wc -l` -eq 0 ]; then
110  echo "No tarballs.  Is $1 really a coverage publishing directory?"
111  exit 1
112fi
113
114for i in *.tar.bz2
115do
116  dir=`echo $i | sed -e 's/.tar.bz2$//'`
117  if [ ! -d ${dir} ] ; then
118    tar xjf $i
119  fi
120done
121
122if [ ! -d rtems ] ; then
123  mkdir rtems
124fi
125
126cp ${COVBASE}/style.css rtems/style.css
127
128BSPs=`find * -maxdepth 1 -type d | cut -d'-' -f1 | uniq | grep -v rtems`
129
130doit >index.html
131exit 0
Note: See TracBrowser for help on using the repository browser.