You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by se...@apache.org on 2008/01/01 02:21:35 UTC

svn commit: r607788 - in /incubator/stdcxx/trunk: bin/xbuildgen bin/xcomp.awk etc/config/xfail.txt

Author: sebor
Date: Mon Dec 31 17:21:34 2007
New Revision: 607788

URL: http://svn.apache.org/viewvc?rev=607788&view=rev
Log:
2007-12-31  Martin Sebor  <se...@roguewave.com>

	STDCXX-683
	* bin/xbuildgen (xfailfile): New constant containing the pathname
	to the expected failures file.
	Used the title attribute directly in each element for simplicity
	intead of adding <div> all over the place.
	(Logs and Columns table): Temporarily removed/commented out all
	six component columns until the xcomp.awk script has been enhanced
	to generate the whole table instead.
	(Logs and Columns table): Added minimum, maximum, total, and average
	rows for each of the sizes columns.
	(resultstle.css): Added caption, tr. Renamed missing to MISS. Removed
	padding from td.name and background from td.total.
	(process_components): Removed and invoked xcomp.awk (with xfailfile
	as an argument) to process all components in a single shot instead.
	* bin/xcomp.awk: Rewrote from scratch to process the entire build
	log, including all examples, locales, and tests, in one go to
	simplify things and for efficiency. Implemented the "expected
	failures feature.
	* etc/config/xfail.txt: Initial (demo) version of the list of
	expected failures.

Added:
    incubator/stdcxx/trunk/etc/config/xfail.txt   (with props)
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=607788&r1=607787&r2=607788&view=diff
==============================================================================
--- incubator/stdcxx/trunk/bin/xbuildgen (original)
+++ incubator/stdcxx/trunk/bin/xbuildgen Mon Dec 31 17:21:34 2007
@@ -86,6 +86,9 @@
 # URL to the trunk of the source repository
 readonly svnpath="$viewvc/incubator/stdcxx/trunk"
 
+# expected failures
+readonly xfailfile=$HOME/stdcxx/etc/config/xfail.txt
+
 ######################################################################
 # global variables
 
@@ -290,8 +293,6 @@
         # in cases when it fails to build
         # echo "$myname: warning: unable to extract library size from $l" >&2
         unset libsize
-    else
-        libsize=`format_size $libsize`
     fi
 
     echo $libsize
@@ -634,6 +635,13 @@
     font-family:courier;
     font-size: 80%;
 }
+caption {
+    background:lightslategray;
+    color:lightgray;
+    font-weight:bold;
+    font-family:lucida mono;
+    font-size: 120%;
+}
 th {
     background:lightgray;
     text-align:center;
@@ -642,20 +650,19 @@
 td {
     padding: 2px;
     text-align: center;
+}
+tr {
     background:powderblue;
 }
 td.rowno {
-    padding: 3px;
     text-align: right;
     background:lightgray;
 }
 td.name {
-    padding: 3px;
     text-align: left;
     background:lightblue;
 }
 td.number {
-    padding: 3px;
     text-align: center;
     background:lightblue;
 }
@@ -663,14 +670,13 @@
     background:white;
     text-align:left;
 }
-td.header {
+.header {
     background:#cccccc;
     text-align:center;
     font-weight:bold;
     font-family:lucida mono;
 }
 td.total {
-    background:#cccccc;
     text-align:center;
     font-weight:bold;
 }
@@ -700,7 +706,7 @@
     text-align:center;
     font-weight:bold;
 }
-td.missing {
+td.MISS {
     color:white;
     background:lightgray;
     text-align:center;
@@ -856,17 +862,11 @@
 # the location of the logs
 logdir="http://people.apache.org/~sebor/stdcxx/results"
 
-# the names of temporary files containing the list of components
-# (examples, locales, and tests) to process and include in the
-# generated report
-tests_file=$TMP/.stdcxx-tests.$$
-examples_file=$TMP/.stdcxx-examples.$$
-locales_file=$TMP/.stdcxx-locales.$$
+# the name of a temporary file containing the build timings
 timings_file=$TMP/.stdcxx-timings.$$
 
-
-# remove temporary files in case they exist
-rm -f $tests_file $examples_file $locales_file
+# remove the temporary file
+rm -f timings_file
 
 if [ $? -ne 0 ]; then
     exit 2
@@ -886,32 +886,18 @@
     <table>
       <thead>
         <tr>
-          <th rowspan=3><div title="column number and log">log</div></th>
+          <th rowspan=3 title="column number and log">log</th>
           <th rowspan=3>build<br>type</th>
           <th colspan=21>build and run times (M:SS)</th>
         </tr>
         <tr>
-          <th colspan=3>
-            <div title="library configuration times">config</div>
-          </th>
-          <th colspan=3>
-            <div title="library build times">library</div>
-          </th>
-          <th colspan=3>
-            <div title="build times for all examples">examples</div>
-          </th>
-          <th colspan=3>
-            <div title="build times for all utilities">utilities</div>
-          </th>
-          <th colspan=3>
-            <div title="build times for all tests">tests</div>
-          </th>
-          <th colspan=3>
-            <div title="run times for all components">run times</div>
-          </th>
-          <th colspan=3>
-            <div title="total build and run times">total</div>
-          </th>
+          <th colspan=3 title="library configuration times">config</th>
+          <th colspan=3 title="library build times">library</th>
+          <th colspan=3 title="build times for all examples">examples</th>
+          <th colspan=3 title="build times for all utilities">utilities</th>
+          <th colspan=3 title="build times for all tests">tests</th>
+          <th colspan=3 title="run times for all components">run times</th>
+          <th colspan=3 title="total build and run times">total</th>
         </tr>
         <tr>
           <th>real</th>
@@ -944,51 +930,39 @@
     <table>
       <thead>
         <tr>
-          <th rowspan=3><div title="column number and log">log</div></th>
+          <th rowspan=3 title="column number and log">log</th>
           <th rowspan=3>operating<br>system</th>
-          <th rowspan=3><div title="hardware architecture">arch</div></th>
+          <th rowspan=3 title="hardware architecture">arch</th>
           <th rowspan=3>compiler</th>
           <th rowspan=3>build<br>type</th>
           <th rowspan=3>start date and time</th>
-          <th rowspan=3>
-            <div title="build age at the time of this report">
-              age
-            </div>
-          </th>
+          <th rowspan=3 title="build age at the time of this report">age</th>
           <th rowspan=3>revision</th>
           <th colspan=5>sizes</th>
           <th colspan=2>diagnostics</th>
-          <th colspan=3>components</th>
+          <!-- <th colspan=6>components</th> -->
         </tr>
         <tr>
-          <th rowspan=2>
-            <div title="size of the library binary">library</div>
-          </th>
+          <th rowspan=2 title="size of the library binary">library</th>
           <th colspan=2>log</th>
           <th colspan=2>build</th>
-
-          <th rowspan=2>
-            <div title="number of error messages found">errors</div>
-          </th>
-          <th rowspan=2>
-            <div title="number of warning messages found">warnings</div>
-          </th>
-          <th rowspan=2>
-            <div title="number of examples exercised">examples</div>
-          </th>
-          <th rowspan=2>
-            <div title="number of locales exercised">locales</div>
-          </th>
-          <th rowspan=2>
-            <div title="number of tests exercised">tests</div>
-          </th>
-
-        </tr>
-        <tr>
-          <th><div title="size of gzipped log">gzip</div></th>
-          <th><div title="size of expanded log">text</div></th>
-          <th><div title="size of full build">full</div></th>
-          <th><div title="size of clean build">clean</div></th>
+          <th rowspan=2 title="number of error messages found">errors</th>
+          <th rowspan=2 title="number of warning messages found">warnings</th>
+          <!-- <th colspan=2>examples</th> -->
+          <!-- <th colspan=2>locales</th> -->
+          <!-- <th colspan=2>tests</th> -->
+        </tr>
+        <tr>
+          <th title="size of gzipped log">gzip</th>
+          <th title="size of expanded log">text</th>
+          <th title="size of full build">full</th>
+          <th title="size of clean build">clean</th>
+          <!-- <th title="number of examples exercised">total</th> -->
+          <!-- <th title="number of examples failed">failed</th> -->
+          <!-- <th title="number of locales exercised">total</th> -->
+          <!-- <th title="number of locales failed">failed</th> -->
+          <!-- <th title="number of tests exercised">total</th> -->
+          <!-- <th title="number of tests failed">failed</th> -->
         </tr>
       </thead>
       <tbody>
@@ -1004,18 +978,44 @@
 # the text files are stored in the textlogs variable
 
 # number of logs processed in loop below
-n=0
+logcount=0
 
 # space-separated list of names of text logs processed in loop below
 textlogs=""
 
-# running total number of examples, locales, and tests in all logs
-total_examples=0
-total_locales=0
-total_tests=0
+# the minimum, maximum, and the sum of library sizes
+libsize_min=9999999999
+libsize_max=0
+libsize_sum=0
+
+# the minimum, maximum, and the sum of compressed log sizes
+gzlogsize_min=9999999999
+gzlogsize_max=0
+gzlogsize_sum=0
+
+# the minimum, maximum, and the sum of uncompressed log sizes
+txtlogsize_min=9999999999
+txtlogsize_max=0
+txtlogsize_sum=0
+
+# the number of logs counted equals logcount (see above)
+
+# the minimum, maximum, and the sum of full build sizes
+fullbuildsize_min=9999999999
+fullbuildsize_max=0
+fullbuildsize_sum=0
+
+# the minimum, maximum, and the sum of clean build sizes
+cleanbuildsize_min=9999999999
+cleanbuildsize_max=0
+cleanbuildsize_sum=0
+
+# the number of build sizes counted
+buildsize_count=0
+
 
 for l in $gzlogs; do
-    n=$((n + 1))
+    logcount=$((logcount + 1))
     fname=`basename $l`
 
     if [ $verbose -eq 1 ]; then
@@ -1023,11 +1023,10 @@
     fi
 
     # set temporary variables (valid only within the loop)
-    runlog=$TMP/`basename $l`.$$
-    txtlog=$TMP/`basename $l`.txt.$$
+    txtlog=$TMP/`basename $l .gz.txt`.txt.$$
 
     # append the name of the log to the list
-    textlogs="$textlogs $runlog"
+    textlogs="$textlogs $txtlog"
 
     # unzip the log into a temporary text file
     gunzip -c $l > $txtlog
@@ -1039,10 +1038,34 @@
 
     # determine the size of the compressed and decompressed log
     gzlogsize=`wc -c $l`
-    gzlogsize=`format_size ${gzlogsize% *}`
+    gzlogsize=${gzlogsize% *}
+
+    if [ $gzlogsize -lt $gzlogsize_min ]; then
+        gzlogsize_min=$gzlogsize
+    fi
+
+    if [ $gzlogsize -gt $gzlogsize_max ]; then
+        gzlogsize_max=$gzlogsize
+    fi
+
+    gzlogsize_sum=$((gzlogsize_sum + gzlogsize))
+
+    gzlogsize=`format_size $gzlogsize`
 
     txtlogsize=`wc -c $txtlog`
-    txtlogsize=`format_size ${txtlogsize% *}`
+    txtlogsize=${txtlogsize% *}
+
+    if [ $txtlogsize -lt $txtlogsize_min ]; then
+        txtlogsize_min=$txtlogsize
+    fi
+
+    if [ $txtlogsize -gt $txtlogsize_max ]; then
+        txtlogsize_max=$txtlogsize
+    fi
+
+    txtlogsize_sum=$((txtlogsize_sum + txtlogsize))
+
+    txtlogsize=`format_size $txtlogsize`
 
     # extract the date and time the build started
     # the date is expected to be introduced by a line like this:
@@ -1068,6 +1091,22 @@
     # extract the size of the library binary from the build log
     libsize=`get_lib_size $txtlog`
 
+    if [ "$libsize" != "" ]; then
+        if [ $libsize -lt $libsize_min ]; then
+            libsize_min=$libsize
+        fi
+
+        if [ $libsize -gt $libsize_max ]; then
+            libsize_max=$libsize
+        fi
+
+        libsize_sum=$((libsize_sum + libsize))
+
+        libsize=`format_size $libsize`
+        libcount=$((libcount + 1))
+    fi
+
+
     # extract the size of the whole build introduced by a line
     # containing the strings "# du -sk build", both before and
     # afterit's been cleaned
@@ -1086,6 +1125,31 @@
         fullbuildsize=$((fullbuildsize * 1024))
         cleanbuildsize=$((cleanbuildsize * 1024))
 
+        if [ "$fullbuildsize" != "" ]; then
+
+            # compute the minimum, maximum, sum, and average
+            if [ $fullbuildsize -lt $fullbuildsize_min ]; then
+                fullbuildsize_min=$fullbuildsize
+            fi
+
+            if [ $cleanbuildsize -lt $cleanbuildsize_min ]; then
+                cleanbuildsize_min=$cleanbuildsize
+            fi
+
+            if [ $fullbuildsize -gt $fullbuildsize_max ]; then
+                fullbuildsize_max=$fullbuildsize
+            fi
+
+            if [ $cleanbuildsize -gt $cleanbuildsize_max ]; then
+                cleanbuildsize_max=$cleanbuildsize
+            fi
+
+            fullbuildsize_sum=$((fullbuildsize_sum + fullbuildsize))
+            cleanbuildsize_sum=$((cleanbuildsize_sum + cleanbuildsize))
+
+            buildsize_count=$((buildsize_count + 1))
+        fi
+
         fullbuildsize=`format_size $fullbuildsize`
         cleanbuildsize=`format_size $cleanbuildsize`
     fi
@@ -1136,8 +1200,8 @@
         fbase=${fbase%-$buildtype}
 
         # componse the column header
-        colhdr="<a href=\"$logdir/$fname\"><div title=\"$fbase\">$n"
-        colhdr="$colhdr</div></a>"
+        colhdr="<a href=\"$logdir/$fname\" title=\"$fbase\">$logcount"
+        colhdr="$colhdr</a>"
 
         # when displaying one component (example, test, or locale) per row
         # of the table, format the table header so as to include the build
@@ -1148,10 +1212,12 @@
         tbl_hdr_2="$tbl_hdr_2 <th>$buildtype</th>"
 
         if [ "$libsize" = "" ]; then
-            output "      <tr class=\"LIB\">"
+            table_row="      <tr class=\"LIB\">"
         else
-            output "      <tr>"
+            table_row="      <tr>"
         fi
+
+        output "$table_row"
         output "        <td>$colhdr</td>"
         output "        <td>$osname</td>"
         output "        <td>$arch</td>"
@@ -1167,10 +1233,11 @@
         output "        <td>$cleanbuildsize</td>"
         output "        <td>$errors</td>"
         output "        <td>$warnings</td>"
+        output "      </tr>"
 
         cat <<EOF >>$timings_file
 
-        <tr>
+        $table_row
           <td>$colhdr</td>
           <td>$buildtype</td>
 EOF
@@ -1187,105 +1254,59 @@
 
         echo "        </tr>" >>$timings_file
     fi
+done
 
 
-    # cut the first part up to the first table from the text log
-    sed -e "1,/^NAME  *STATUS/d" $txtlog > $runlog
-
-    status=$?
-
-    if [ $status -eq 0 ]; then
-
-        # extract the list of locales from the log
-        # removing the .bat or .sh suffix from their names
-
-             sed -e "/^PROGRAM SUMMARY:/,999999d" $runlog              \
-           | sed -e "s/^\([^ ][^ ]*\)  *.*/\1/"                        \
-           | sed -e "s/^\([^ ][^ ]*\)\.bat/\1/"                        \
-                 -e "s/^\([^ ][^ ]*\)\.sh/\1/" >>$locales_file         \
-        && sed -e "1,/^NAME  *STATUS/d" $runlog > $runlog.next
-
-        status=$?
-
-        if [ $verbose -eq 1 ]; then
-            echo "$myname:  extracted locale results into $locales_file"
-        fi
-    else
-        exit 3
-    fi
-
-    if [ $status -eq 0 ]; then
-
-        # extract the list of tests from the log
-        # removing the .exe suffix from their names
-
-             sed -e "/^PROGRAM SUMMARY:/,999999d" $runlog.next          \
-           | sed -e "s/^\([^ ][^ ]*\)  *.*/\1/"                         \
-           | sed -e "s/^\([^ ][^ ]*\)\.exe/\1/" >>$tests_file \
-        && sed -e "1,/^NAME  *STATUS/d" $runlog.next > $runlog.next.2   \
-        && mv $runlog.next.2 $runlog.next
-
-        status=$?
-
-        if [ $verbose -eq 1 ]; then
-            echo "$myname:  extracted test results into $tests_file"
-        fi
-    else
-        exit 3
-    fi
-
-    if [ $status -eq 0 ]; then
-
-        # extract the list of examples from the log
-        # removing the .exe suffix from their names
-
-             sed -e "/^PROGRAM SUMMARY:/,999999d" $runlog.next          \
-           | sed -e "s/^\([^ ][^ ]*\)  *.*/\1/"                         \
-           | sed -e "s/^\([^ ][^ ]*\)\.exe/\1/" >>$examples_file \
-        && sed -e "1,/^NAME  *STATUS/d" $runlog > $runlog.next.2        \
-        && mv $runlog.next.2 $runlog.next
-
-        if [ $verbose -eq 1 ]; then
-            echo "$myname:  extracted example results into $examples_file"
-        fi
-    else
-        exit 3
-    fi
-
-    if [ $components_in_rows -ne 0 ]; then
-
-        # get  the number of components of each kind in the log
-        nexamples=`wc -l $examples_file`
-        nlocales=`wc -l $locales_file`
-        ntests=`wc -l $tests_file`
-
-        nexamples=${nexamples% *}
-        nlocales=${nlocales% *}
-        ntests=${ntests% *}
-
-        output "        <td>$((nexamples - total_examples))</td>"
-        output "        <td>$((nlocales - total_locales))</td>"
-        output "        <td>$((ntests - total_tests))</td>"
-        output "      </tr>"
-
-        total_examples=$nexamples
-        total_locales=$nlocales
-        total_tests=$ntests
-    fi
-
-    if [ ! -s $runlog ]; then
-        # make sure file is not empty
-        echo "###" >$runlog
-    fi
+if [ $components_in_rows -ne 0 ]; then
 
-    rm $runlog.next
-    rm $txtlog
-done
+    gzlogsize_avg=$((gzlogsize_sum / logcount))
+    txtlogsize_avg=$((txtlogsize_sum / logcount))
 
+    libsize_avg=$((libsize_sum / libcount))
 
-if [ $components_in_rows -ne 0 ]; then
+    fullbuildsize_avg=$((fullbuildsize_sum / buildsize_count))
+    cleanbuildsize_avg=$((cleanbuildsize_sum / buildsize_count))
 
     output "      </tbody>"
+    output "      <tfooter>"
+    output "        <tr>"
+    output "          <td colspan=8 class=\"header\">min</td>"
+    output "          <td>`format_size $libsize_min`</td>"
+    output "          <td>`format_size $gzlogsize_min`</td>"
+    output "          <td>`format_size $txtlogsize_min`</td>"
+    output "          <td>`format_size $fullbuildsize_min`</td>"
+    output "          <td>`format_size $cleanbuildsize_min`</td>"
+    output "          <td></td>"
+    output "          <td></td>"
+    output "        </tr>"
+    output "        <tr>"
+    output "          <td colspan=8 class=\"header\">max</td>"
+    output "          <td>`format_size $libsize_max`</td>"
+    output "          <td>`format_size $gzlogsize_max`</td>"
+    output "          <td>`format_size $txtlogsize_max`</td>"
+    output "          <td>`format_size $fullbuildsize_max`</td>"
+    output "          <td>`format_size $cleanbuildsize_max`</td>"
+    output "          <td></td>"
+    output "          <td></td>"
+    output "        </tr>"
+    output "        <tr>"
+    output "          <td colspan=8 class=\"header\">total</td>"
+    output "          <td>`format_size $libsize_sum`</td>"
+    output "          <td>`format_size $gzlogsize_sum`</td>"
+    output "          <td>`format_size $txtlogsize_sum`</td>"
+    output "          <td>`format_size $fullbuildsize_sum`</td>"
+    output "          <td>`format_size $cleanbuildsize_sum`</td>"
+    output "          <td class=\"header\" colspan=9 rowspan=2></td>"
+    output "        </tr>"
+    output "        <tr>"
+    output "          <td colspan=8 class=\"header\">average</td>"
+    output "          <td>`format_size $libsize_avg`</td>"
+    output "          <td>`format_size $gzlogsize_avg`</td>"
+    output "          <td>`format_size $txtlogsize_avg`</td>"
+    output "          <td>`format_size $fullbuildsize_avg`</td>"
+    output "          <td>`format_size $cleanbuildsize_avg`</td>"
+    output "        </tr>"
+    output "      </tfooter>"
     output "    </table>"
     output "    <hr>"
 
@@ -1299,12 +1320,12 @@
 
     output "    <ol>"
 
-    n=0
+    logcount=0
     for c in $example_list $test_list $locale_list; do
-        n=$((n + 1))
+        logcount=$((logcount + 1))
 
         # output one build per row, with components in columns
-        table_header="$table_header <th><div title=\"$c\">$n</div></th>"
+        table_header="$table_header <th title=\"$c\">$logcount</th>"
         output "      <li>$c</li>"
     done
 
@@ -1313,147 +1334,10 @@
 
 output "    <hr>"
 
-if [ -s $locales_file ]; then
-    # if the list of locales non-empty sort it and weed out duplicates
-       sort $locales_file | uniq > $locales_file.2 \
-    && mv $locales_file.2 $locales_file
-fi
-
-if [ -s $examples_file ]; then
-    # if the list of examples is non-empty sort it and weed out duplicates
-       sort $examples_file | uniq > $examples_file.2 \
-    && mv $examples_file.2 $examples_file
-fi
-
-if [ -s $tests_file ]; then
-    # if list of tests file is non-empty sort it and weed out duplicates
-       sort $tests_file | uniq > $tests_file.2 \
-    && mv $tests_file.2 $tests_file
-fi
-
 ######################################################################
 
-awkscript=$HOME/stdcxx/bin/xcomp.awk
-
-######################################################################
-
-# process a list of components, one component per row
-# component name is one of: { example, locale, test }
-process_components()
-{
-    component_type=$1   # example, locale, or test
-    component_list=$2   # list of component names
-
-    count=`echo $component_list | wc -w`
-
-    if [ "$component_type" = "test" ]; then
-        column3="        <th rowspan=2><div title=\"maximum total assertions\">"
-        column3="$column3 max<br>asserts</div></th>"
-    else
-        unset column3
-    fi
-
-    cat <<EOF | output
-    <h2>Results of $count ${component_type}s</h2>
-    <p>
-      Note: ${component_type}s passing across all builds have been omitted
-      for brevity.
-    </p>
-    <table>
-      <thead>
-        <tr>
-          <th rowspan=2>
-            <div title="${component_type} number of a total of $count">###</div>
-          </th>
-          <th rowspan=2>
-            <a name="${component_type}s"></a>$component_type name
-          </th>
-          $column3
-          $tbl_hdr_1
-        </tr>
-        <tr>$tbl_hdr_2</tr>
-      </thead>
-      <tbody>
-EOF
-
-    totals_file=$TMP/.stdcxx-failtotals.$$.txt
-
-    # iterate over the list of idividual components (examples, tests,
-    # or locales) invoking the awk script on each of them (i.e., each
-    # example, test, or locale) in every iteration of the loop
-    n=0;
-    for c in $component_list; do
-
-        # compute the sequential component number and pass it
-        # to the awk script to include it on the row it generates
-        # (if it generates one)
-        n=$((n + 1))
-
-        # the display name of the component
-        dispname="$c"
-
-        # determine the directory in the source repository the component
-        # source lives in
-        if [ "example" = $component_type ]; then
-            dir=""
-        elif [ "locale" = $component_type ]; then
-            locale=${c%.*}
-            if [ "$locale" != "$c" ]; then
-
-                # compose a URL pointing to the character set description
-                # file and the locale defintion file in the repository
-                codeset=${c#*.}
-
-                url="$svnpath/etc/nls/src/$locale?view=markup"
-                dispname="<a href=\"$url\">$locale</a>"
-
-                url="$svnpath/etc/nls/charmaps/$codeset?view=markup"
-                dispname="$dispname.<a href=\"$url\">$codeset</a>"
-            fi
-        elif [ "test" = $component_type ]; then
-
-            dir="tests"
-
-            case $c in
-                *.stdcxx-*) dir="$dir/regress";;
-                0.*)  dir="$dir/self";;
-                17.*) dir="$dir/intro";;
-                18.*) dir="$dir/support";;
-                19.*) dir="$dir/diagnostics";;
-                20.*) dir="$dir/utilities";;
-                21.*) dir="$dir/strings";;
-                22.*) dir="$dir/localization";;
-                23.*) dir="$dir/containers";;
-                24.*) dir="$dir/iterators";;
-                25.*) dir="$dir/algorithm";;
-                26.*) dir="$dir/numerics";;
-                27.*) dir="$dir/iostream";;
-                *)    dir="";;
-            esac
-
-            if [ "$dir" != "" ]; then
-                dispname="<a href=\"$svnpath/$dir/$c.cpp?view=markup\">$c</a>"
-            fi
-        fi
-
-          awk -f $awkscript \
-              n=$n dir=$dir name=$c dispname="$dispname" verbose=$verbose \
-              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 comptype=$component_type name="@" \
-              totalsfile=$totals_file svnpath=$svnpath        \
-            | output
-
-    cat <<EOF | output
-      </tbody>
-    </table>
-EOF
-}
+# xcross-component script
+xcomp=$HOME/stdcxx/bin/xcomp.awk
 
 ######################################################################
 
@@ -1487,8 +1371,8 @@
             line=`grep "^$c  *[^-]" $l`
             if [ $? -eq 0 -a "$line" != "" ]; then
                   echo $line \
-                | awk -f $awkscript component=$component_type   \
-                      name=$c verbose=$verbose svnpath=$svnpath \
+                | awk -f $xcomp component=$component_type         \
+                      name=$c verbose=$verbose expect="$expect"   \
                 | output
             else
                 output "        <td class=\"missing\">N/A</td>"
@@ -1502,9 +1386,15 @@
 
 
 if [ $components_in_rows -ne 0 ]; then
-    process_components "example" "`cat $examples_file`"
-    process_components "test" "`cat $tests_file`"
-    process_components "locale" "`cat $locales_file`"
+
+    # check to see 
+    if [ -r $xfailfile ]; then
+        xfails=$xfailfile
+    else
+        xfails=""
+    fi
+
+    awk -f $xcomp bodyonly=1 $xfails $textlogs | output
 else
     if [ "$examples_list" != "" ]; then
         process_builds "example" "$examples_list"
@@ -1532,17 +1422,12 @@
           <th rowspan=2 class="header">Meaning</th>
         </tr>
         <tr>
-          <th class="header">
-            <div title="Unexpected success or ordinary failure">
-
-              Unexpected
-            </div>
+          <th class="header" title="Unexpected success or ordinary failure">
+            Unexpected
           </th>
           <th class="header">Severity</th>
-          <th class="header">
-            <div title="Ordinary success or expected failure">
-              Expected
-            </div>
+          <th class="header" title="Ordinary success or expected failure">
+            Expected
           </th>
           <th class="header">Severity</th>
         </tr>
@@ -1577,7 +1462,7 @@
         </tr>
         <tr>
           <td colspan=2 class="na"><center>Not Applicable</center></td>
-          <td class="FORMAT">FMAT</td>
+          <td class="FORMAT">FORMAT</td>
           <td class="na">Success</td>
           <td class="na">
              Component completed successfully but produced unexpected
@@ -1585,7 +1470,7 @@
           </td>
         </tr>
         <tr>
-          <td class="missing">N/A</td>
+          <td class="MISS">N/A</td>
           <td class="na">Success</td>
           <td colspan=2 class="na"><center>Not Applicable</center></td>
           <td class="na">Component was not tested.</td>
@@ -1796,11 +1681,8 @@
     # clean up
 
     if [ $verbose -eq 1 ]; then
-        echo "$myname: " \
-             "rm $examples_file $tests_file $locales_file " \
-             "$textlogs $timings_file"
+        echo "$myname: rm $textlogs $timings_file"
     fi
 
-    rm $examples_file $tests_file $locales_file $textlogs \
-       $timings_file
+    rm -f $textlogs $timings_file
 fi

Modified: incubator/stdcxx/trunk/bin/xcomp.awk
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/bin/xcomp.awk?rev=607788&r1=607787&r2=607788&view=diff
==============================================================================
--- incubator/stdcxx/trunk/bin/xcomp.awk (original)
+++ incubator/stdcxx/trunk/bin/xcomp.awk Mon Dec 31 17:21:34 2007
@@ -23,450 +23,1181 @@
 ########################################################################
 #
 # SYNOPSIS
-#     myname [n=#] [name=$name] [dispname=$dispname]
-#            [svnpath=$svnpath] [verbose=0|1] [comptype=$comp]
-#            [totalsfile=$totalsfile] [expectfile=$expectfile]
-#            logs...
+#     myname [comptype=<string>] [bodyonly=0|1] logs...
 #
 # VARIABLES:
-#   n            component number
-#   name         component name
-#   dispname     component display name
-#   verbose      verbose mode
+#   bodyonly     when non-zero, suppresses the <html> tags
 #   comptype     component type (example, locale, or test)
-#   totalsfile   name of totals file
-#   expectfile   name of file with expected results
+#   expect       set of expected results
 #
 ########################################################################
 
 
 BEGIN {
-    # the text of all columns, output after all logs have been processed
-    columns = ""
+    # array of component counts for each component
+    # compcnts [<name>]
 
-    # total number of times the current component has been found to fail
-    # across all logs (a row for the component is normally output only
-    # when compfails is non-zero, except when in verbose mode)
-    compfails = 0
+    # one-based array of files processed
+    # files [1..]
 
-    # maximum and minimum number of assertions for the current component
-    max_asserts = 0
-    min_asserts = -1
+    # map of [FILENAME,components] to component status
+    # compstatuses [FILENAME, compcnts]
 
-    # one-based file number (the first file on the command line
-    # is number one, etc.)
-    fileno = 0
+    sectnames [1] = "locale"
+    sectnames [2] = "test"
+    sectnames [3] = "example"
+
+    # displayed and cout as failures
+    states ["ASSERT"] =  1
+    states ["BUILD"]  =  1
+    states ["COMP"]   =  1
+    states ["DIFF"]   =  1
+    states ["EXEC"]   =  1
+    states ["FORMAT"] =  1
+    states ["EXIT"]   =  1
+    states ["LINK"]   =  1
+    states ["SIGNAL"] =  1
+
+    # displayed but don't cout as failures
+    states ["OUTPUT"] = -1
+    states ["WARN"]   = -1
+
+    # expected failures are displayed but not counted as failures
+    states ["XASSERT"] = -1
+    states ["XBUILD"]  = -1
+    states ["XCOMP"]   = -1
+    states ["XDIFF"]   = -1
+    states ["XEXEC"]   = -1
+    states ["XFORMAT"] = -1
+    states ["XEXIT"]   = -1
+    states ["XLINK"]   = -1
+    states ["XPASS"]   = -1
+    states ["XSIGNAL"] = -1
+
+    # not displayed and doesn't cout as a failure
+    states ["MISS"] = 0
+    states ["OK"]   = 0
+
+    # add all states/classes that count as failures to failclasses
+    for (e in states) {
+        if (1 == states [e])
+            failclasses [e]
+    }
 
-    # the (one-based) number of the file in which the current
-    # component was last found (detects a component that is
-    # missing from one or more files)
-    found_in_file = -1
+    # month numbers used to format dates
+    monthnames ["Jan"] = 1
+    monthnames ["Feb"] = 2
+    monthnames ["Mar"] = 3
+    monthnames ["Apr"] = 4
+    monthnames ["May"] = 5
+    monthnames ["Jun"] = 6
+    monthnames ["Jul"] = 7
+    monthnames ["Aug"] = 8
+    monthnames ["Sep"] = 9
+    monthnames ["Oct"] = 10
+    monthnames ["Nov"] = 11
+    monthnames ["Dec"] = 12
+
+    # mapping from build type to the more descriptive build mode
+    buildmodes ["8a"]  = "shared archive, optimized"
+    buildmodes ["8A"]  = "shared archive, optimized, wide"
+    buildmodes ["8d"]  = "shared, optimized"
+    buildmodes ["8D"]  = "shared, optimized, wide"
+    buildmodes ["8s"]  = "archive, optimized"
+    buildmodes ["8S"]  = "archive, optimized, wide"
+    buildmodes ["11a"] = "shared archive, debug"
+    buildmodes ["11A"] = "shared archive, debug, wide"
+    buildmodes ["11d"] = "shared, debug"
+    buildmodes ["11D"] = "shared, debug, wide"
+    buildmodes ["11s"] = "archive, debug"
+    buildmodes ["11S"] = "archive, debug, wide"
+    buildmodes ["12a"] = "shared archive, optimized, reentrant"
+    buildmodes ["12A"] = "shared archive, optimized, reentrant, wide"
+    buildmodes ["12d"] = "shared, optimized, reentrant"
+    buildmodes ["12D"] = "shared, optimized, reentrant, wide"
+    buildmodes ["12s"] = "archive, optimized, reentrant"
+    buildmodes ["12S"] = "archive, optimized, reentrant, wide"
+    buildmodes ["15a"] = "shared archive, debug, reentrant"
+    buildmodes ["15A"] = "shared archive, debug, reentrant, wide"
+    buildmodes ["15d"] = "shared, debug, reentrant"
+    buildmodes ["15D"] = "shared, debug, reentrant, wide"
+    buildmodes ["15s"] = "archive, debug, reentrant"
+    buildmodes ["15S"] = "archive, debug, reentrant, wide"
+
+    svnpath="http://svn.apache.org/viewvc/incubator/stdcxx/trunk"
+
+    # regular expression to match a name (e.g., compiler or OS)
+    re_name    = "[A-Za-z][A-Za-z_0-9]*"
+
+    # regular expression to match a version string
+    re_version = "[1-9][0-9]*(\\.[0-9][0-9]*)*"
+
+    # regular expression matching the buildtype string
+    re_buildtype = "(8|11|12|15)[aAdDsS](-(solaris|win32))?"
+
+    # regular expresssion matching a log file name
+    re_logname = re_name "-" re_version    \
+        "-" re_name "-" re_name "-" re_version \
+        "-" re_buildtype "-" "[1-9][0-9]*-log"
+}
 
-    # array of the total numbers of components found in each log
-    # logcounts
 
-    # array of the total numbers of failed components in each log
-    # logfails
+# action to detect the type of file
+1 == FNR {
+    section = 0
 
-    # array of the total numbers of components in each log that
-    # failed one or more runtime assertions
-    # assertcounts
+    if (0 == match(FILENAME, re_logname)) {
+        # treat files whose names don't match the log file name pattern
+        # as lists of expected failures
+        expect_file = 1
+    }
+    else {
+        expect_file = 0
 
-    # array of the total numbers of components in each log that
-    # failed to build (compile or link)
-    # buildfails
+        logsections [FILENAME] = 0
 
-    # array of the total numbers of components in each log that
-    # produced unexpected output (DIFF)
-    # diffcounts
+        logcompcnts [1, FILENAME] = 0
+        logcompcnts [2, FILENAME] = 0
+        logcompcnts [3, FILENAME] = 0
 
-    # array of the total numbers of components in each log that
-    # exited with a non-zero status
-    # exitcounts
+        ++logcount
 
-    # array of the total numbers of components in each log that
-    # exited with a signal
-    # signalcounts
+        # append the current log file name to the list
+        logfnames [logcount] = FILENAME
+    }
+}
 
-    # 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 process file containing specification of expected failures
+1 == expect_file && $1 ~ "^[^#][^#]" {
 
+    if (1 == index($0, " ")) {
+        # component specification continued from previous line
+        cont = 1
+    }
+    else {
+        compname = $1
+        cont     = 0
+    }
 
-# action to keep track of the current file number
-1 == FNR {
-    if (0 < fileno && found_in_file < fileno) {
-        ++missingcounts [fileno]
+    pattern = $(2 - cont)
+    status  = $(3 - cont)
+    comment = $(4 - cont)
+
+    # convert shell globbing pattern to a regular expression by
+    # escaping periods and replacing astersisks with ".*" and
+    # question marks with "."
+    gsub("\\.", "\\.", pattern)
+    gsub("\\*", ".*", pattern)
+    gsub("?", ".", pattern)
+
+    # if patter contains an open brace expand it using the shell
+    if (0 < index(pattern, "{")) {
+        cmd = "echo " pattern
+        cmd | getline pattern
+    }
+
+    # split the (potentially expanded) pattern into an array
+    n = split(pattern, patlist, " ")
+
+    spec = ""
+    sep  = ""
 
-        columns = columns "\n        <td class=\"missing\">N/A</td>"
-        found_in_file = -1
+    # concatenate the array of expanded patters, the status,
+    # and the comment, to form a single specification
+    for (i = 1; i <= n; ++i) {
+
+        spec = spec sep patlist [i] " " status " " comment
+
+        sep = ":"
     }
 
-    ++fileno
+    # insert the specification to the expected_statuses array
+    if (compname in nexpected_statuses)
+        spec = expected_statuses [compname] ":" spec
+
+    expected_statuses [compname] = spec
+
+    # skip the actions below
+    next
+}
+
+
+########################################################################
+# logfile only processing below
+
+# action to extract the build date and time
+/^##* *date *: *$/ {
+
+    getline
+
+    logdates [FILENAME] = $0
+}
+
+
+# action at the beginning of component table
+/^NAME  *STATUS WARN/ {
+    start = 1
+
+    ++section
+
+    ++logsections [FILENAME]
+
+    logcompcnts [section, FILENAME] = 0
+
+    # skip this record
+    next
+}
+
+# end of component table
+/^PROGRAM SUMMARY:$/ {
+
+    start = 0
+}
+
+0 == start {
+    # skip this record
+    next
 }
 
 
-# match the first record to the name optionally followed
-# by one of the three suffixes
-   $1 ~ "^" name "$"       \
-|| $1 ~ "^" name ".bat$"   \
-|| $1 ~ "^" name ".exe$"   \
-|| $1 ~ "^" name ".sh$" {
+# locale, example, or test section
+1 == start {
 
-    # EXPECTED RECORD FORMAT(s)
-    #
-    #  $1     $2       $3     $4      $5     $6       $7    $8    $9
-    # <name> <status> <warn> <asrts> <fail> <percnt> <usr> <sys> <real>
-    #
-    #  $1     $2                                      $3    $4    $5
-    # <name> <status>                                <usr> <sys> <real>
-    #
-    # The <warn>, <asrts>, <fail>, and <percnt> fields might be missing.
+    compname = $1
 
-    # increment the total of components found in this log
-    ++logcounts [fileno]
+    # trim suffix from component name
+    sub("(\\.bat|\\.exe|\\.sh)$", "", compname)
 
-    # the second field is always the exit status of the component
-    status = $2
+    compstatus = $2
+    expect     = ""
+    comment    = ""
 
-    # the tile (tooltip) to display over the value
-    title = ""
+    # increment the number of times the current component occurs
+    # in the current section across all logs
+    ++compcnts [section, compname]
 
-    # the value of the cell
-    value = ""
+    # increment the number of components in the current section
+    # and log
+    ++logcompcnts [section, FILENAME]
 
-    found_in_file = fileno
+    if (sectmaxcompcnts [section] < logcompcnts [section, FILENAME])
+        sectmaxcompcnts [section] = logcompcnts [section, FILENAME]
 
-    if (status == 0) {
+    if (compname in expected_statuses)
+        expspec = expected_statuses [compname]
+    else
+        expspec = ""    
 
+    n = split(expspec, slist, ":")
+
+    for (i = 1; i <= n; ++i) {
+
+        split(slist [i], fields, " ")
+
+        # try to match the log file name against the specified pattern
+        if (match(FILENAME, fields [1])) {
+            # extract the expected component status and the comment
+            expect  = fields [2] 
+            comment = fields [3]
+
+            break
+        }
+    }
+
+    # class, value, and optional detail for the cell
+    class  = ""
+    value  = ""
+    detail = ""
+
+    # compstatus:
+    # <class>:[<value>]:[<detail>]
+
+    if (0 == compstatus) {
         # successful exit status
 
-        if (comptype == "example" || $5 == 0) {
+        class = "OK"
 
-            # component is an example or, when not, had zero failures
+        if (3 != section) {
+            runwarns = $3
+            asserts  = $4
+            failed   = $5
+
+            if (0 < failed) {
+                class  = "ASSERT"
+                value  = failed
+                detail = asserts
+            }
+            else if (0 < runwarns) {
+                class = "RUNWARN"
+                value = runwarns
+            }
+        }
+
+        if (expect != "") {
+            if ("OK" == class && expect != class) {
+                # unexpected success
+                class  = "XPASS"
+                value  = "XPASS<br>(X" expect ")"
+                detail = "unexpected success"
+            }
+            else if ("OK" != class) {
+                # expected status doesn't match
+                ++xmatchcounts [section, FILENAME]
+
+                value = value "<br>" expect
+            }
+        }
+    }
+    else if (0 < compstatus && compstatus < 256) {
+        # non-zero exit status
+        class = "EXIT"
+        value = compstatus
 
-            # get the number of warnings (only valid when the number
-            # fields is greater than 5)
-            warnings = 5 < NF ? $3 : 0
+        if (expect != "") {
+            if (expect == value) {
+                # actual exit status matches the expected status
+                ++xfailcounts [section, FILENAME]
 
-            if (warnings == 0) {
-                class = "OK"
-                value = "0"
+                class = "X" class
             }
             else {
-                ++compfails;
-                ++logfails [fileno]
+                ++xmatchcounts [section, FILENAME]
 
-                class = "RUNWARN"
-                title = warnings " runtime warnings"
-                value = "(" warnings ")"
+                value  = value "<br>(X" expect ")"
+                detail = "expected failure doesn't match actual status"
             }
         }
-        else {
-
-            # component is not an example or, when it is, had failures
+    }
+    else if (   "COMP" == compstatus       \
+             || "DIFF" == compstatus       \
+             || "FORMAT" == compstatus     \
+             || "LINK" ==  compstatus      \
+             || "NOUT" == compstatus       \
+             || "OUTPUT" == compstatus) {
+        # DIFF     unexpected (example) output
+        # FORMAT   unexpected (test) output format
+        # NOUT     no (test) output
+        # OUTPUT   no (example) master output file
+        class = compstatus
+
+        if (expect != "") {
+            if (expect == class) {
+                # actual status matches expected status
+                ++xfailcounts [section, FILENAME]
 
-            ++compfails
-            ++logfails [fileno]
-            ++assertcounts [fileno]
+                class = "X" class
+            }
+            else {
+                # actual status doesn't match expected status
+                ++xmatchcounts [section, FILENAME]
 
-            class = "ASSERT"
-            title = $5 " failed assertions out of " $4
-            value = "(" $5 ")"
+                value  = class "<br>(X" expect ")"
+                detail = "expected failure doesn't match actual status"
+            }
         }
+    }
+    else {
+        # signal
 
-        if (comptype == "test") {
-            asserts [n] = $5
+        class = "SIGNAL"
+        value = compstatus
+
+        if (expect != "") {
+            if (expect == value) {
+                # signal matches the expected signal
+                ++xfailcounts [section, FILENAME]
 
-            if (max_asserts < $4) {
-                max_asserts = $4
+               class = "X" class
             }
+            else {
+                # signal doesn't match expected status
+                ++xmatchcounts [section, FILENAME]
 
-            if ($4 < min_asserts || min_asserts < 0) {
-                min_asserts = $4
+                value  = value "<br>(X" expect ")"
+                detail = "expected failure doesn't match actual status"
             }
         }
     }
-    else if (0 < status && status < 256) {
-        ++compfails
-        ++logfails [fileno]
-        ++exitcounts [fileno]
 
-        class = "EXIT"
-        title = "exit status of " status
-        value = status
-    }
-    else if (status == "FORMAT" || status == "NOUT" || status == "OUTPUT") {
-        ++compfails
+    compstatus = class ":" value ":" detail
+
+    compstatuses [section, FILENAME, compname] = compstatus
+}
+
+# locale section
+1 == section && 1 == start {
+}
 
-        class = status
-        value = status == "FORMAT" ? "FMAT" : status
+# test section
+2 == section && 1 == start {
+}
+
+# example section
+3 == section && 1 == start {
+}
+
+
+########################################################################
+# functions
+
+function get_date(fulldate)
+{
+    split(fulldate, fields)
+    month = fields [2]
+    mday  = fields [3]
+
+    date = monthnames [month] "/" mday
+
+    return date
+}
+
+
+function get_time(fulldate)
+{
+    split(fulldate, fields)
+
+    return fields [4]
+}
+
+
+# extracts the build type from the log file name
+function get_buildtype(fname)
+{
+    # look for the beginning of the buildtype component followed
+    # by the (Subversion) revision number
+    pos = match(fname, "-[1-9][0-9]*[aAdDsS]-[1-9][0-9]*-log")
+
+    # is not found, try looking for the buildtype followed by
+    # the name of the threads library and only then followed
+    #  by the (Subversion) revision number
+    if (0 == pos)
+        pos = match(fname, "-[1-9][0-9]*[aAdDsS]-[a-z][a-z]*-[1-9][0-9]*-log*")
+
+    buildtype = substr(fname, pos + 1)
+
+    pos = index(buildtype, "-")
+    buildtype = substr(buildtype, 1, pos - 1)
+
+    return buildtype
+}
+
+
+function get_dispname(section, compname)
+{
+    dir = ""
+
+    if (1 == section) {
+        # compose a URL pointing to the character set description
+        # file and the locale defintion file in the repository
+        pos = index(compname, ".")
+        if (0 < pos) {
+            locale  = substr(compname, 1, pos - 1)
+            codeset = substr(compname, pos + 1);
+
+            url      = svnpath "/etc/nls/src/" locale "?view=markup"
+            dispname = "<a href=\"" url "\">" locale "</a>"
+
+            url      = svnpath "/etc/nls/charmaps/" codeset "?view=markup"
+            dispname = dispname ".<a href=\"" url "\">" codeset "</a>"
+        }
+        else {
+            dispname = compname
+        }
     }
-    else if (status == "DIFF") {
-        ++compfails
-        ++logfails [fileno]
-        ++diffcounts [fileno]
-
-        class = status
-        value = status
-    }
-    else if (status == "COMP" || status == "LINK") {
-        ++compfails
-        ++logfails [fileno]
-        ++buildfails [fileno]
+    else if (2 == section) {
+        dir = "tests"
 
-        class = status
-        value = status
+        if (match(compname, "\\.stdcxx-"))
+            dir = dir "/regress"
+        else if (match(compname, "^0\\."))
+            dir = dir "/self"
+        else if (match(compname, "^17\\."))
+            dir = dir "/intro"
+        else if (match(compname, "^18\\."))
+            dir = dir "/support"
+        else if (match(compname, "^19\\."))
+            dir = dir "/diagnostics"
+        else if (match(compname, "^20\\."))
+            dir = dir "/utilities"
+        else if (match(compname, "^21\\."))
+            dir = dir "/strings"
+        else if (match(compname, "^22\\."))
+            dir = dir "/localization"
+        else if (match(compname, "^23\\."))
+            dir = dir "/containers"
+        else if (match(compname, "^24\\."))
+            dir = dir "/iterators"
+        else if (match(compname, "^25\\."))
+            dir = dir "/algorithm"
+        else if (match(compname, "^26\\."))
+            dir = dir "/numerics"
+        else if (match(compname, "^27\\."))
+            dir = dir "/iostream"
+        else if (match(compname, "^d_"))
+            ; # dir = dir "/depr"
+        else
+            dir = ""
+    
+        if (dir != "") {
+            dispname = "<a href=\"" svnpath "/" dir "/" compname
+            dispname = dispname ".cpp?view=markup\">"
+            dispname = dispname compname "</a>"
+        }
+        else {
+            dispname = compname
+        }
     }
     else {
-        ++compfails
-        ++logfails [fileno]
-        if (status == "HUP" || status == "SIGHUP")
-            ++sighupcounts [fileno]
-        else
-            ++signalcounts [fileno]
-
-        class = "SIGNAL"
-        value = status
+        dispname = compname
     }
 
-    columns = columns "\n          <td class=\"" class "\""
-    if (title != "")
-        columns = columns " title=\"" title "\""
-    columns = columns ">" value "</td>"
+    return dispname
 }
 
 
-function print_totals (class, title, text, totals, nfields)
+# prints a row of columns for the given section and component
+function print_component(section, compname)
 {
-    sum = 0
+    # increment for each component, regardless of whether it gets
+    # included in the output or not
+    ++compinx
 
     row = ""
+        
+    # the number of failures and warning states of the current
+    # component across all logs to decide whether to include
+    # the component in the output or not
+    nfailures = 0
+    nwarnings = 0
+
+    # maximum number of assertions exercised by the current
+    # test across all logs
+    maxasserts = 0
+
+    # the number of columns to span the same class/value
+    repeat = 1
+
+    last_class = ""
+    last_value = ""
+    last_title = ""
+
+    # iterate over all log files
+    for (i = 1; i <= logcount; ++i) {
+
+        # only process the specified section
+        # if (section != substr(fi, 1, 1))
+        #     continue
+
+        # extract the name of the log file from the key
+        # fname = substr(fi, 3)
+        fname = logfnames [i]
+
+        # check to see if the component was found in the current
+        # log file being careful not to add a new entry to the
+        # array
+        if ((section, fname, compname) in compstatuses) {
+
+            # component found
+
+            status = compstatuses [section, fname, compname]
+
+            n = split(status, triple, ":")
+
+            class = triple [1]
+            value = "" == triple [2] ? class : triple [2]
+            title = triple [3]
+
+            if ("ASSERT" == class) {
+
+                if (0 < value) {
+                    title = "failed " value " out of "  \
+                        triple [3] " assertions"
+                }
+                else
+                    title = ""
+
+                if (maxasserts < triple [3])
+                    maxasserts = triple [3]
+            }
+        }
+        else {
+            # component missing from log file
+            class = "MISS"
+            title = "not tested"
+            value = "N/A"
+        }
 
-    for (i = 1; i <= nfields; ++i) {
-        sum += totals [i]
+        if (class in failclasses) {
+            ++nfailures
+            ++logcompfails [fname]
+        }
+        else if (class != "OK" && class != "MISS") {
+            ++nwarnings
+            ++logcompwarns [fname]
+        }
+
+        if ("" == last_class) {
+            last_class = class
+            last_title = title
+            last_value = value
+        }
+        else if (   last_class == class \
+                 && last_value == value \
+                 && last_title == title) {
+            ++repeat
+        }
+        else {
+            row = row "          <td class=\"" last_class "\""
 
-        row = row "            <td class=\"total\">"
-        if (totals [i] != 0)
-            row = row totals [i]
+            if (1 < repeat) {
+                row     = row " colspan=" repeat
+                coltext = "columns " i - repeat " to " i - 1
+            }
+            else {
+                coltext = "column " i - 1
+            }
 
-        row = row "</td>"
+            if (last_title == "")
+                last_title = coltext
+            else
+                last_title = coltext ":" last_title
+
+            row = row " title=\"" last_title "\""
+            row = row ">" last_value "</td>\n"
+
+            repeat     = 1
+            last_class = class
+            last_title = title
+            last_value = value
+        }
+
+        ++statuscnts [fname, class]
     }
 
-    if (sum != 0) {
-   
-        print "          <tr>"
-        print "            <td class=\"header\"></td>"
-        print "            <td class=\"" class "\" title=\"" \
-            title "\">" text "</td>"
-        print extra_cell
-        print "            " row
+    row = row "          <td class=\"" last_class "\""
+
+    if (1 < repeat) {
+        row     = row " colspan=" repeat
+        coltext = "columns " i - repeat " to " i - 1
     }
+    else {
+        coltext = "column " i - 1
+    }
+
+    if (last_title == "")
+        last_title = coltext
+    else
+        last_title = coltext ": " last_title
+
+    row = row " title=\"" last_title "\""
+    row = row ">" last_value "</td>"
+
+    repeat = 0
+
+    if (0 < nfailures || nwarnings) {
+
+        # increment only for components included in the output
+        ++rowinx
+
+        dispname = get_dispname(section, compname)
+
+        print "        <tr>"
+        print "          <td class=\"header\">" compinx "</td>"
+        print "          <td class=\"name\">" dispname "</td>"
+
+        if (2 == section)
+            print "          <td class=\"total\">" maxasserts "</td>"
+
+        print row
+        print "        </tr>"
+
+        return 1
+    }
+
+    return 0
 }
 
 
-function build_summary ()
+# prints a table for each of the three sections (examples, locales,
+# and tests)
+function print_section(section)
 {
-    if (verbose || compfails) {
-        print "        <tr>"
-        print "          <td class=\"rowno\">" n "</td>"
-        print "          <td class=\"name\"><a name=\"" name "\"></a>"
-        print "            " dispname
-        print "          </td>"
+    # the name of this section ("example", "locale", or "test")
+    sectname = sectnames [section]
 
-        if (comptype == "test") {
-            print "          <td class=\"number\">" max_asserts "</td>"
-        }
+    if (0 == sectmaxcompcnts [section]) {
+        print
+        print "    <a name=\"" sectname "s\"></a>"
+        print "    <h2>No " sectname "s found in " logcount " logs</h2>"
 
-        print columns;
-        print "      </tr>"
+        return
     }
 
-    if (0 > getline line < totalsfile) {
-        # the first time through there is no totalsfile
-        nfields = fileno
+    thead =       "      <thead>\n"
+    thead = thead "        <tr class=\"header\">\n"
+    thead = thead "          <td rowspan=3 title=\"" \
+        sectname " number\">###</td>\n"
+    thead = thead "          <td rowspan=3 title=\""    \
+        sectname " name\">"
+    thead = thead sectname " name</td>\n"
+
+    if (2 == section) {
+        thead = thead "          <td rowspan=3 "
+        thead = thead "title=\"maximum total assertions\">"
+        thead = thead "max<br>asserts</td>\n"
     }
-    else {
-        nfields = split(line, logcounts_prev)
 
-        getline line < totalsfile
-        split(line, logfails_prev)
+    row0 = ""
+    row1 = "        <tr class=\"header\">\n"
+    row2 = "        <tr class=\"header\">\n"
+
+    colnos = ""
+
+    # iterate over the array of section counts for each log file
+    # and compose the column headers for each log
+    for (i = 1; i <= logcount; ++i) {
+
+        logname = logfnames [i]
+
+        loggzfname = substr(logname, 1, index(logname, ".txt") - 1) ".gz.txt"
+
+        colnos = colnos "          <td title=\"" logname "\">"
+        colnos = colnos "<a href=\"" loggzfname "\">" i "</a></td>"
+
+        buildtype = get_buildtype(logname)
+        buildmode = buildmodes [buildtype]
+
+        row1 = row1 "          <td title=\"" buildmode "\">" buildtype "</td>\n"
+
+        fulldate = logdates [logname]
+        date     = get_date(fulldate)
+        time     = get_time(fulldate)
+
+        row2 = row2 "          <td title=\"" fulldate "\">" date "</td>\n"
+    }
+
+    row0 = row0 colnos "\n        </tr>\n"
+    row1 = row1 "        </tr>\n"
+    row2 = row2 "        </tr>\n"
+
+    thead = thead row0 row1 row2 "      </thead>"
+
+    print "    <a name=\"" sectname "s\"></a>"
+    print "    <h2>Results of " sectmaxcompcnts [section] " "        \
+        sectname "s from " logcount " logs</h2>"
+    print "    <table>"
+
+    print thead
+
+    print "      <tbody>"
+
+    # one-based component index (of all found)
+    compinx = 0
+
+    # reset the arrays
+    split("", logcompwarns)
+    split("", logcompfails)
+    split("", statuscnts)
+
+    # iterate over elements of the compcnts array using the section
+    # number and the name of the comoponent as the key (index)
+
+    if (2 == section)
+        colspan = " colspan=2"
+    else
+        colspan = ""
+
+    rowinx = 1
+
+    for (ci in compcnts) {
+
+        # only process the specified section
+        if (section != substr(ci, 1, 1))
+            continue
+
+        # extract the name of the component from the key
+        compname = substr(ci, 3)
+
+        # determine whether the current component should be included
+        # in output or not and if so, print it out
+        printed = print_component(section, compname)
+
+        if (printed && (rowinx % 20) == 0) {
+
+            print "        <tr class=\"header\">"
+            print "          <td></td>"
+            print "          <td " colspan ">column number and log</td>"
+            print colnos
+            print "        </tr>"
+        }
+    }
+
+    print "      </tbody>"
+
+    # print totals in the table footer
+    print "      <tfooter>"
+
+    ##################################################################
+    ### print column headers again
+
+    print "        <tr class=\"header\">"
+    print "          <td></td>"
+    print "          <td " colspan ">column number and log</td>"
+    print colnos
+    print "        </tr>"
+
+    ##################################################################
+    ### print totals for each interesting status (class)
+    print "        <tr class=\"header\">"
+    print "          <td></td>"
+    print "          <td" colspan ">status</td>"
+    print "          <td colspan=" logcount ">totals for status</td>"
+    print "        </tr>"
+
+    for (si in states) {
+
+        row =     "        <tr>\n"
+        row = row "          <td class=\"header\"></td>\n"
+        row = row "          <td class=\"" si "\"" colspan ">" si "</td>\n"
+
+        nfails = 0
+
+        # the number of times the same value consecutively repeats 
+        repeat     = 1
+        last_value = "?"
 
-        getline line < totalsfile
-        split(line, assertcounts_prev)
+        for (i = 1; i <= logcount; ++i) {
 
-        getline line < totalsfile
-        split(line, buildfails_prev)
+            fname = logfnames [i]
 
-        getline line < totalsfile
-        split(line, diffcounts_prev)
+            if ((fname, si) in statuscnts) {
 
-        getline line < totalsfile
-        split(line, exitcounts_prev)
+                ++nfails
+
+                value = statuscnts [fname, si]
+            }
+            else
+                value = ""
+
+            if ("?" == last_value)
+                last_value = value
+            else if (value == last_value)
+                ++repeat
+            else {
+                row = row "          <td class=\"total\""
+
+                if (1 < repeat) {
+                    row = row " colspan=" repeat
+                    row = row " title=\"columns " i - repeat " to " i - 1 "\""
+                }
+                else {
+                    row = row " title=\"column " i - 1 "\""
+                }
+
+                row = row ">" last_value "</td>\n"
+
+                last_value = value
+                repeat     = 1
+            }
+        }
 
-        getline line < totalsfile
-        split(line, signalcounts_prev)
+        if (0 < nfails) {
+            row = row "          <td class=\"total\""
 
-        getline line < totalsfile
-        split(line, sighupcounts_prev)
+            if (1 < repeat) {
+                row = row " colspan=" repeat
+                row = row " title=\"columns " i - repeat " to " i - 1 "\""
+            }
+            else {
+                row = row " title=\"column " i - 1 "\""
+            }
 
-        getline line < totalsfile
-        split(line, missingcounts_prev)
+            row = row ">" last_value "</td>\n"
 
-        close(totalsfile)
+            print row "        </tr>"
+        }
     }
 
-    if (name == "@") {
+    ##################################################################
+    # print number of expected failures
+    row    = ""
+    nfails = 0
+
+    # the number of times the same value consecutively repeats 
+    repeat     = 1
+    last_value = "?"
 
-        # the special (bogus) name indicates a request to format
-        # totals from the totals file
+    for (i = 1; i <= logcount; ++i) {
 
-        if (comptype == "test")
-            extra_cell = "            <td class=\"header\">&mdash;</td>"
+        fname = logfnames [i]
+
+        if ((section, fname) in xfailcounts) {
+
+            ++nfails
+
+            value = xfailcounts [section, fname]
+        }
         else
-            extra_cell = ""
+            value = ""
 
-        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\">&mdash;</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);
+        if ("?" == last_value)
+            last_value = value
+        else if (value == last_value)
+            ++repeat
+        else {
+            row = row "          <td class=\"total\""
 
-        print "        </tfoot>"
+            if (1 < repeat) {
+                row = row " colspan=" repeat
+                row = row " title=\"columns " i - repeat " to " i - 1 "\""
+            }
+            else {
+                row = row " title=\"column " i - 1 "\""
+            }
 
-        close(totalsfile)
-        system("rm -f " totalsfile)
+            row = row ">" last_value "</td>\n"
+
+            last_value = value
+            repeat     = 1
+        }
     }
-    else {
-        # increment counts in the totals file for each component
 
-        # set the Output Record Separator to space
-        ORS=" "
+    if (0 < nfails) {
+        row = row "          <td class=\"total\""
 
-        for (i = 1; i <= nfields; ++i)
-            print logcounts [i] + logcounts_prev [i] > totalsfile
+        if (1 < repeat) {
+            row = row " colspan=" repeat
+            row = row " title=\"columns " i - repeat " to " i - 1 "\""
+        }
+        else {
+            row = row " title=\"column " i - 1 "\""
+        }
 
-        print "\n" >> totalsfile
+        row = row ">" last_value "</td>\n"
 
-        for (i = 1; i <= nfields; ++i)
-            print logfails [i] + logfails_prev [i] >> totalsfile
+        print "        <tr>"
+        print "          <td class=\"header\"></td>"
+        print "          <td class=\"header\" title=\"number "          \
+            "of expected failures\"" colspan ">expected failures</td>"
+        print row "        </tr>"
+    }
+
+    ##################################################################
+    # print expected/unexpected mismatches
+    row    = ""
+    nfails = 0
+
+    # the number of times the same value consecutively repeats 
+    repeat     = 1
+    last_value = "?"
+
+    for (i = 1; i <= logcount; ++i) {
 
-        print "\n" >> totalsfile
+        fname = logfnames [i]
+
+        if ((section, fname) in xmatchcounts) {
+
+            ++nfails
+
+            value = xmatchcounts [section, fname]
+        }
+        else
+            value = ""
 
-        for (i = 1; i <= nfields; ++i)
-            print assertcounts [i] + assertcounts_prev [i] >> totalsfile
+        if ("?" == last_value)
+            last_value = value
+        else if (value == last_value)
+            ++repeat
+        else {
+            row = row "          <td class=\"total\""
+
+            if (1 < repeat) {
+                row = row " colspan=" repeat
+                row = row " title=\"columns " i - repeat " to " i - 1 "\""
+            }
+            else {
+                row = row " title=\"column " i - 1 "\""
+            }
+
+            row = row ">" last_value "</td>\n"
+
+            last_value = value
+            repeat     = 1
+        }
+    }
 
-        print "\n" >> totalsfile
+    if (0 < nfails) {
+        row = row "          <td class=\"total\""
 
-        for (i = 1; i <= nfields; ++i)
-            print buildfails [i] + buildfails_prev [i] >> totalsfile
+        if (1 < repeat) {
+            row = row " colspan=" repeat
+            row = row " title=\"columns " i - repeat " to " i - 1 "\""
+        }
+        else {
+            row = row " title=\"column " i - 1 "\""
+        }
 
-        print "\n" >> totalsfile
+        row = row ">" last_value "</td>\n"
 
-        for (i = 1; i <= nfields; ++i)
-            print diffcounts [i] + diffcounts_prev [i] >> totalsfile
+        print "        <tr>"
+        print "          <td class=\"header\"></td>"
+        print "          <td class=\"header\" title=\"number "          \
+            "of mismatches between expected and actual statuses\"" colspan \
+            ">expected/actual mismatches</td>"
+        print row "        </tr>"
+    }
 
-        print "\n" >> totalsfile
+    ##################################################################
+    # print total number of failures
+    row    = ""
+    nfails = 0
 
-        for (i = 1; i <= nfields; ++i)
-            print exitcounts [i] + exitcounts_prev [i] >> totalsfile
+    # the number of times the same value consecutively repeats 
+    repeat     = 1
+    last_value = "?"
 
-        print "\n" >> totalsfile
+    for (i = 1; i <= logcount; ++i) {
 
-        for (i = 1; i <= nfields; ++i)
-            print signalcounts [i] + signalcounts_prev [i] >> totalsfile
+        fname = logfnames [i]
 
-        print "\n" >> totalsfile
+        if (fname in logcompfails) {
 
-        for (i = 1; i <= nfields; ++i)
-            print sighupcounts [i] + sighupcounts_prev [i] >> totalsfile
+            ++nfails
 
-        print "\n" >> totalsfile
+            value = logcompfails [fname]
+        }
+        else
+            value = ""
 
-        for (i = 1; i <= nfields; ++i)
-            print missingcounts [i] + missingcounts_prev [i] >> totalsfile
+        if ("?" == last_value)
+            last_value = value
+        else if (value == last_value)
+            ++repeat
+        else {
+            row = row "          <td class=\"total\""
 
-        print "\n" >> totalsfile
+            if (1 < repeat) {
+                row = row " colspan=" repeat
+                row = row " title=\"columns " i - repeat " to " i - 1 "\""
+            }
+            else {
+                row = row " title=\"column " i - 1 "\""
+            }
 
-        close(totalsfile)
+            row = row ">" last_value "</td>\n"
 
-        # append a newline to the file
-        # ORS="\n"
-        # print "" >> totalsfile
-        # close(totalsfile)
+            last_value = value
+            repeat     = 1
+        }
     }
-}
 
-function component_summary () {
-    print columns;
-}
+    if (0 < nfails) {
+        row = row "          <td class=\"total\""
 
-END {
-    if (comptype != "") {
-        if (found_in_file < fileno) {
+        if (1 < repeat) {
+            row = row " colspan=" repeat
+            row = row " title=\"columns " i - repeat " to " i - 1 "\""
+        }
+        else {
+            row = row " title=\"column " i - 1 "\""
+        }
 
-            ++missingcounts [fileno]
+        row = row ">" last_value "</td>\n"
 
-            # the component wasn't found in the last file processed
-            columns = columns "\n          <td class=\"missing\">N/A</td>"
+        print "        <tr>"
+        print "          <td class=\"header\"></td>"
+        print "          <td class=\"header\" title=\"total number "    \
+            "of failed " sectname "s\"" colspan ">failures</td>"
+        print row "        </tr>"
+    }
+
+    ##################################################################
+    # print total number of components exercised
+    row    = ""
+    nfails = 0
+
+    # the number of times the same value consecutively repeats 
+    repeat     = 1
+    last_value = "?"
+
+    for (i = 1; i <= logcount; ++i) {
+
+        fname = logfnames [i]
+
+        if ((section, fname) in logcompcnts) {
+
+            ++nfails
+
+            value = logcompcnts [section, fname]
         }
+        else
+            value = ""
 
-        build_summary()
+        if ("?" == last_value)
+            last_value = value
+        else if (value == last_value)
+            ++repeat
+        else {
+            row = row "          <td class=\"total\""
+
+            if (1 < repeat) {
+                row = row " colspan=" repeat
+                row = row " title=\"columns " i - repeat " to " i - 1 "\""
+            }
+            else {
+                row = row " title=\"column " i - 1 "\""
+            }
+
+            row = row ">" last_value "</td>\n"
+
+            last_value = value
+            repeat     = 1
+        }
     }
-    else {
-        component_summary()
+
+    if (0 < nfails) {
+        row = row "          <td class=\"total\""
+
+        if (1 < repeat) {
+            row = row " colspan=" repeat
+            row = row " title=\"columns " i - repeat " to " i - 1 "\""
+        }
+        else {
+            row = row " title=\"column " i - 1 "\""
+        }
+
+        row = row ">" last_value "</td>\n"
+
+        print "        <tr>"
+        print "          <td class=\"header\"></td>"
+        print "          <td  class=\"header\" title=\"total number of " \
+            sectname "s exercised\"" colspan ">total</td>"
+
+        print row "        </tr>"
+    }
+
+    ##################################################################
+    print "      </tfooter>"
+    print "    </table>"
+}
+
+
+END {
+
+    if (0 == bodyonly) {
+        print "<html>"
+        print "  <head>"
+        print "    <link rel=\"stylesheet\" href=\"resultstyle.css\">"
+        print "  </head>"
+        print "  <body>"
+    }
+
+    for (section = 1; section <= 3; ++section)
+        print_section(section)
+
+    if (0 == bodyonly) {
+        print "  </body>"
+        print "</html>"
     }
 }

Added: incubator/stdcxx/trunk/etc/config/xfail.txt
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/xfail.txt?rev=607788&view=auto
==============================================================================
--- incubator/stdcxx/trunk/etc/config/xfail.txt (added)
+++ incubator/stdcxx/trunk/etc/config/xfail.txt Mon Dec 31 17:21:34 2007
@@ -0,0 +1,44 @@
+########################################################################
+#
+# Expected/known failures in stdcxx examples, locales, and tests.
+#
+# Record format:
+#   <program-name>  <config> <status> <issue>
+#                  [<config> <status> <issue>]*
+#
+#   where <program-name>, <status>, and <issue> are ordinary strings
+#   (containing no whitespace), and <config> is a shell globbing
+#   pattern in the format below. All fields are required, as are all
+#   the components the <status> field.
+#
+#   <config> ::= <os>-<version>-<arch><compiler>-<version>-<buildtype>
+#
+########################################################################
+# Known example failures
+#
+# EXAMPLE                                           EXPECTED  ISSUE
+# NAME              PLATFORM AND BUILD TYPE         STATUS    NUMBER
+# ---------------   ------------------------------  --------  ----------
+codecvt1            *-*-*-*-*                       1         STDCXX-520
+dynatype            *-*-*-vacpp-9.0-*               COMP      STDCXX-605
+limits              aix-*-*-*-*                     DIFF      STDCXX-458
+
+########################################################################
+# Known locale failures
+#
+# LOCALE                                            EXPECTED  ISSUE
+# NAME              PLATFORM AND BUILD TYPE         STATUS    NUMBER
+# --------------    ------------------------------  --------  ----------
+br_FR.ISO-8859-1    *.*.*.*.*                       1         STDCXX-372
+hu_HU.ISO-8859-2    *.*.*.*.*                       1         STDCXX-372
+
+
+########################################################################
+# Known test failures
+#
+# TEST                                              EXPECTED  ISSUE
+# NAME              PLATFORM AND BUILD TYPE         STATUS    NUMBER
+# --------          ------------------------------  --------  ----------
+0.process           aix-5.3-*-vacpp-9.0-*           SEGV      STDCXX-625
+2.smartptr.shared   aix-*-*-vacpp-9.0-*             COMP      STDCXX-360
+19.exceptions.mt    aix-5.3-*-vacpp-9.0-{12,15}?    HUP       STDCXX-644

Propchange: incubator/stdcxx/trunk/etc/config/xfail.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/stdcxx/trunk/etc/config/xfail.txt
------------------------------------------------------------------------------
    svn:keywords = Id