Author: sebor Date: Sun Dec 23 16:23:07 2007 New Revision: 606644 URL: http://svn.apache.org/viewvc?rev=606644&view=rev Log: 2007-12-23 Martin Sebor <[EMAIL PROTECTED]>
* xbuildgen (format_size): Handled GigaBytes. Relaxed the regular expression used to extract build sizes. resultstyle.css: Added LIB. (component_name): Renamed... (component_type): ...to this for clarity. * xcomp.awk (comp): Renamed... (comptype): ...to this for clarity. (assertcounts, buildfails, diffcounts, exitcounts, signalcounts, sighupcounts, missingcounts): Added arrays to keep track of the total number of components in each category. (print_totals): New function to print the above totals in the table footer. (build_summary): Corrected logic to initialize totals when the totals file doesn't exist yet and called print_totals to print them out when non-zero in any build. Modified: incubator/stdcxx/trunk/bin/xbuildgen incubator/stdcxx/trunk/bin/xcomp.awk Modified: incubator/stdcxx/trunk/bin/xbuildgen URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/bin/xbuildgen?rev=606644&r1=606643&r2=606644&view=diff ============================================================================== --- incubator/stdcxx/trunk/bin/xbuildgen (original) +++ incubator/stdcxx/trunk/bin/xbuildgen Sun Dec 23 16:23:07 2007 @@ -255,16 +255,20 @@ { size=$1 - if [ $size -ge 1000000 ]; then - # over million bytes, get size in megabytes up to 2 decimal places + if [ $size -ge 1000000000 ]; then + # over billion bytes, get size in gigabytes up to 2 decimal places + gbsize="$((size / 1073741824)).$(((size % 1073741) / 100000))" + size="<div title=\"$size bytes\">$gbsize GB</div>" + elif [ $size -ge 1000000 ]; then + # over million bytes, get size in megabytes up to 2 decimal places mbsize="$((size / 1048576)).$(((size % 1048576) / 100000))" size="<div title=\"$size bytes\">$mbsize MB</div>" elif [ $size -ge 10000 ]; then - # over ten thoudand bytes, get even size in kilobytes + # over ten thoudand bytes, get even size in kilobytes kbsize="$((size / 1024))" size="<div title=\"$size bytes\">$kbsize kB</div>" elif [ $size -ge 1000 ]; then - # over thoudand bytes, get size in kilobytes up to 2 decimal places + # over thoudand bytes, get size in kilobytes up to 2 decimal places kbsize="$((size / 1024)).$(((size % 1024) / 100))" size="<div title=\"$size bytes\">$kbsize kB</div>" fi @@ -807,6 +811,10 @@ font-weight:bold; text-align:center; } +tr.LIB { + background:pink; + color:black; +} EOF fi @@ -1060,12 +1068,15 @@ # extract the size of the library binary from the build log libsize=`get_lib_size $txtlog` - # extract the size of the whole build, both before and after - # it's been cleaned - buildsizes=` sed -n '/^### du -sk .\/build\/ .\/build\/\*/{n;p;}' \ + # extract the size of the whole build introduced by a line + # containing the strings "# du -sk build", both before and + # afterit's been cleaned + buildsizes=` sed -n '/^##* *du *-sk *.*build/{n;p;}' \ $txtlog | sed 's/ *\([1-9][0-9]*\).*/\1/'` if [ "$buildsizes" = "" ]; then - echo "$myname: warning: unable to extract build size from $l" >&2 + # avoid warning for missing build size to reduce the noise + # in cases when the library fails to build + # echo "$myname: warning: unable to extract build size from $l" >&2 unset fullbuildsize unset cleanbuildsize else @@ -1136,7 +1147,11 @@ tbl_hdr_1="$tbl_hdr_1 <th>$colhdr</th>" tbl_hdr_2="$tbl_hdr_2 <th>$buildtype</th>" - output " <tr>" + if [ "$libsize" = "" ]; then + output " <tr class=\"LIB\">" + else + output " <tr>" + fi output " <td>$colhdr</td>" output " <td>$osname</td>" output " <td>$arch</td>" @@ -1326,12 +1341,12 @@ # component name is one of: { example, locale, test } process_components() { - component_name=$1 - component_list=$2 + component_type=$1 # example, locale, or test + component_list=$2 # list of component names count=`echo $component_list | wc -w` - if [ "$component_name" = "test" ]; then + if [ "$component_type" = "test" ]; then column3=" <th rowspan=2><div title=\"maximum total assertions\">" column3="$column3 max<br>asserts</div></th>" else @@ -1339,19 +1354,19 @@ fi cat <<EOF | output - <h2>Results of $count ${component_name}s</h2> + <h2>Results of $count ${component_type}s</h2> <p> - Note: ${component_name}s passing across all builds have been omitted + Note: ${component_type}s passing across all builds have been omitted for brevity. </p> <table> <thead> <tr> <th rowspan=2> - <div title="${component_name} number of a total of $count">###</div> + <div title="${component_type} number of a total of $count">###</div> </th> <th rowspan=2> - <a name="${component_name}s"></a>$component_name name + <a name="${component_type}s"></a>$component_type name </th> $column3 $tbl_hdr_1 @@ -1379,9 +1394,9 @@ # determine the directory in the source repository the component # source lives in - if [ "example" = $component_name ]; then + if [ "example" = $component_type ]; then dir="" - elif [ "locale" = $component_name ]; then + elif [ "locale" = $component_type ]; then locale=${c%.*} if [ "$locale" != "$c" ]; then @@ -1395,7 +1410,7 @@ url="$svnpath/etc/nls/charmaps/$codeset?view=markup" dispname="$dispname.<a href=\"$url\">$codeset</a>" fi - elif [ "test" = $component_name ]; then + elif [ "test" = $component_type ]; then dir="tests" @@ -1423,14 +1438,14 @@ awk -f $awkscript \ n=$n dir=$dir name=$c dispname="$dispname" verbose=$verbose \ - comp=$component_name totalsfile=$totals_file $textlogs \ + comptype=$component_type totalsfile=$totals_file $textlogs \ | output done # set name to bogus value and invoke the script again # to get it to print summary information - echo "" | awk -f $awkscript comp=$component_name name="@" \ + echo "" | awk -f $awkscript comptype=$component_type name="@" \ totalsfile=$totals_file svnpath=$svnpath \ | output @@ -1445,14 +1460,14 @@ # process a list of builds, one build per row process_builds() { - component_name=$1 - component_list=$2 + component_type=$1 # example, locale, or test + component_list=$2 # list of component names cat <<EOF | output - <h2>Results of ${component_name}s</h2> + <h2>Results of ${component_type}s</h2> <table> <tr> - <th><a name="${component_name}s"></a>log</th> + <th><a name="${component_type}s"></a>log</th> $table_header </tr> EOF @@ -1472,7 +1487,7 @@ line=`grep "^$c *[^-]" $l` if [ $? -eq 0 -a "$line" != "" ]; then echo $line \ - | awk -f $awkscript component=$component_name \ + | awk -f $awkscript component=$component_type \ name=$c verbose=$verbose svnpath=$svnpath \ | output else Modified: incubator/stdcxx/trunk/bin/xcomp.awk URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/bin/xcomp.awk?rev=606644&r1=606643&r2=606644&view=diff ============================================================================== --- incubator/stdcxx/trunk/bin/xcomp.awk (original) +++ incubator/stdcxx/trunk/bin/xcomp.awk Sun Dec 23 16:23:07 2007 @@ -24,7 +24,7 @@ # # SYNOPSIS # myname [n=#] [name=$name] [dispname=$dispname] -# [svnpath=$svnpath] [verbose=0|1] [comp=$comp] +# [svnpath=$svnpath] [verbose=0|1] [comptype=$comp] # [totalsfile=$totalsfile] [expectfile=$expectfile] # logs... # @@ -33,7 +33,7 @@ # name component name # dispname component display name # verbose verbose mode -# comp component kind (example, locale, or test) +# comptype component type (example, locale, or test) # totalsfile name of totals file # expectfile name of file with expected results # @@ -45,7 +45,8 @@ columns = "" # total number of times the current component has been found to fail - # in all logs + # across all logs (a row for the component is normally output only + # when compfails is non-zero, except when in verbose mode) compfails = 0 # maximum and minimum number of assertions for the current component @@ -66,12 +67,41 @@ # array of the total numbers of failed components in each log # logfails + + # array of the total numbers of components in each log that + # failed one or more runtime assertions + # assertcounts + + # array of the total numbers of components in each log that + # failed to build (compile or link) + # buildfails + + # array of the total numbers of components in each log that + # produced unexpected output (DIFF) + # diffcounts + + # array of the total numbers of components in each log that + # exited with a non-zero status + # exitcounts + + # array of the total numbers of components in each log that + # exited with a signal + # signalcounts + + # array of the total numbers of components in each log that + # exited with SIGHUP (likely timed out) + # sighupcounts + + # array of the total numbers of components missing from each log + # missingcounts } # action to keep track of the current file number 1 == FNR { if (0 < fileno && found_in_file < fileno) { + ++missingcounts [fileno] + columns = columns "\n <td class=\"missing\">N/A</td>" found_in_file = -1 } @@ -98,18 +128,24 @@ # The <warn>, <asrts>, <fail>, and <percnt> fields might be missing. # increment the total of components found in this log - ++logcounts [fileno - 1] + ++logcounts [fileno] # the second field is always the exit status of the component status = $2 + # the tile (tooltip) to display over the value + title = "" + + # the value of the cell + value = "" + found_in_file = fileno if (status == 0) { # successful exit status - if (comp == "example" || $5 == 0) { + if (comptype == "example" || $5 == 0) { # component is an example or, when not, had zero failures @@ -123,10 +159,11 @@ } else { ++compfails; - ++logfails [fileno - 1] + ++logfails [fileno] + class = "RUNWARN" - value = "<div title=\"" warnings " warnings\">(" warnings \ - ")</div>" + title = warnings " runtime warnings" + value = "(" warnings ")" } } else { @@ -134,14 +171,15 @@ # component is not an example or, when it is, had failures ++compfails - ++logfails [fileno - 1] + ++logfails [fileno] + ++assertcounts [fileno] class = "ASSERT" - value = "<div title=\"" $5 " failed assertions out of " $4 \ - "\">(" $5 ")</div>" + title = $5 " failed assertions out of " $4 + value = "(" $5 ")" } - if (comp == "test") { + if (comptype == "test") { asserts [n] = $5 if (max_asserts < $4) { @@ -155,11 +193,12 @@ } else if (0 < status && status < 256) { ++compfails - ++logfails [fileno - 1] + ++logfails [fileno] + ++exitcounts [fileno] class = "EXIT" - value = "<div title=\"exit status of " status "\">" status \ - "</div>" + title = "exit status of " status + value = status } else if (status == "FORMAT" || status == "NOUT" || status == "OUTPUT") { ++compfails @@ -167,22 +206,66 @@ class = status value = status == "FORMAT" ? "FMAT" : status } - else if (status == "DIFF" || status == "COMP" || status == "LINK") { + else if (status == "DIFF") { ++compfails - ++logfails [fileno - 1] + ++logfails [fileno] + ++diffcounts [fileno] + + class = status + value = status + } + else if (status == "COMP" || status == "LINK") { + ++compfails + ++logfails [fileno] + ++buildfails [fileno] class = status value = status } else { ++compfails - ++logfails [fileno - 1] + ++logfails [fileno] + if (status == "HUP" || status == "SIGHUP") + ++sighupcounts [fileno] + else + ++signalcounts [fileno] class = "SIGNAL" value = status } - columns = columns "\n <td class=\"" class "\">" value "</td>" + columns = columns "\n <td class=\"" class "\"" + if (title != "") + columns = columns " title=\"" title "\"" + columns = columns ">" value "</td>" +} + + +function print_totals (class, title, text, totals, nfields) +{ + sum = 0 + + row = "" + + for (i = 1; i <= nfields; ++i) { + sum += totals [i] + + row = row " <td class=\"total\">" + if (totals [i] != 0) + row = row totals [i] + + row = row "</td>" + } + + if (sum != 0) { + + print " <tr>" + print " <td class=\"header\"></td>" + print " <td class=\"" class "\" title=\"" \ + title "\">" text "</td>" + print extra_cell + print " " row + } } @@ -195,7 +278,7 @@ print " " dispname print " </td>" - if (comp == "test") { + if (comptype == "test") { print " <td class=\"number\">" max_asserts "</td>" } @@ -203,26 +286,37 @@ print " </tr>" } - if (compfails) { - # increment counts in the totals file + if (0 > getline line < totalsfile) { + # the first time through there is no totalsfile + nfields = fileno + } + else { + nfields = split(line, logcounts_prev) + + getline line < totalsfile + split(line, logfails_prev) - getline < totalsfile - close(totalsfile) + getline line < totalsfile + split(line, assertcounts_prev) - # set the Output Record Separator to space - ORS=" " + getline line < totalsfile + split(line, buildfails_prev) - for (i = 0; i < fileno; ++i) { - print logcounts [i] + $(i + 1) > totalsfile - } + getline line < totalsfile + split(line, diffcounts_prev) - for (i = 0; i < fileno; ++i) { - print logfails [i] + $(i + fileno + 1) > totalsfile - } + getline line < totalsfile + split(line, exitcounts_prev) + + getline line < totalsfile + split(line, signalcounts_prev) + + getline line < totalsfile + split(line, sighupcounts_prev) + + getline line < totalsfile + split(line, missingcounts_prev) - # append a newline to the file - ORS="\n" - print "" >> totalsfile close(totalsfile) } @@ -231,46 +325,128 @@ # the special (bogus) name indicates a request to format # totals from the totals file - # read the totals from the totalsfile - getline < totalsfile + if (comptype == "test") + extra_cell = " <td class=\"header\">—</td>" + else + extra_cell = "" + + print " <tfoot>" + print " <tr>" + print " <td class=\"header\"></td>" + print " <td class=\"header\">totals for status</td>" + print extra_cell + + for (i = 1; i <= nfields; ++i) + print "<td class=\"header\">—</td>" + + print " </tr>" + + # output the totals of components that failed to build + print_totals("COMP", "number of " comptype "s that failed to build", + "BUILD", buildfails_prev, nfields) + + # output the totals of examples that produced unexpected output + print_totals("DIFF", + "number of " comptype "s with unexpected output", + "DIFF", diffcounts_prev, nfields); + + # output the totals of components that had assertions + print_totals("ASSERT", + "number of " comptype "s with failed assertions", + "ASSERT", assertcounts_prev, nfields); + + # output the totals of components that exited with non-zero status + print_totals("EXIT", + "number of " comptype "s with non-zero exit status", + "EXIT", exitcounts_prev, nfields); + + # output the totals of components that exited with a signal + print_totals("SIGNAL", + "number of signalled " comptype "s", + "SIGNAL", signalcounts_prev, nfields); + + # output the totals of components that exited with a signal + print_totals("SIGNAL", + "number of " comptype "s that (likely) timed out", + "SIGHUP", sighupcounts_prev, nfields); + + # output the number if missing components + print_totals("MISSING", + "number of missing " comptype "s", + "N/A", missingcounts_prev, nfields); + + # output the totals of failed components + print_totals("header", + "number of " comptype "s with any failures", + "all failures", logfails_prev, nfields); + + # output the totals of all components + print_totals("header", + "total number of " comptype "s exercised", + "total exercised", logcounts_prev, nfields); - nfields=NF + print " </tfoot>" - # output the totals of failed components first - print " <tr>" - print " <td class=\"header\"></td>" - print " <td class=\"header\">" - print " <div title=\"number of failed " comp "s\">failed</div>" - print " </td>" + close(totalsfile) + system("rm -f " totalsfile) + } + else { + # increment counts in the totals file for each component - if (comp == "test") { - print " <td class=\"header\"></td>" - } + # set the Output Record Separator to space + ORS=" " - for (i = nfields / 2; i < nfields; ++i) { - print " <td class=\"total\">" $(i + 1) "</td>" - } + for (i = 1; i <= nfields; ++i) + print logcounts [i] + logcounts_prev [i] > totalsfile - print " </tr>" + print "\n" >> totalsfile - # output the totals of all components next - print " <tr>" - print " <td class=\"header\"></td>" - print " <td class=\"header\">" - print " <div title=\"total number of " comp "s\">total</div>" - print " </td>" + for (i = 1; i <= nfields; ++i) + print logfails [i] + logfails_prev [i] >> totalsfile - if (comp == "test") { - print " <td class=\"header\"></td>" - } + print "\n" >> totalsfile - for (i = 0; i < nfields / 2; ++i) { - print " <td class=\"total\">" $(i + 1) "</td>" - } + for (i = 1; i <= nfields; ++i) + print assertcounts [i] + assertcounts_prev [i] >> totalsfile - print " </tr>" + print "\n" >> totalsfile - system("rm -f " totalsfile) + for (i = 1; i <= nfields; ++i) + print buildfails [i] + buildfails_prev [i] >> totalsfile + + print "\n" >> totalsfile + + for (i = 1; i <= nfields; ++i) + print diffcounts [i] + diffcounts_prev [i] >> totalsfile + + print "\n" >> totalsfile + + for (i = 1; i <= nfields; ++i) + print exitcounts [i] + exitcounts_prev [i] >> totalsfile + + print "\n" >> totalsfile + + for (i = 1; i <= nfields; ++i) + print signalcounts [i] + signalcounts_prev [i] >> totalsfile + + print "\n" >> totalsfile + + for (i = 1; i <= nfields; ++i) + print sighupcounts [i] + sighupcounts_prev [i] >> totalsfile + + print "\n" >> totalsfile + + for (i = 1; i <= nfields; ++i) + print missingcounts [i] + missingcounts_prev [i] >> totalsfile + + print "\n" >> totalsfile + + close(totalsfile) + + # append a newline to the file + # ORS="\n" + # print "" >> totalsfile + # close(totalsfile) } } @@ -279,8 +455,10 @@ } END { - if (comp != "") { + if (comptype != "") { if (found_in_file < fileno) { + + ++missingcounts [fileno] # the component wasn't found in the last file processed columns = columns "\n <td class=\"missing\">N/A</td>"