stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r606538 - in /incubator/stdcxx/trunk/bin: xbuildgen xcomp.awk
Date Sun, 23 Dec 2007 05:40:12 GMT
Author: sebor
Date: Sat Dec 22 21:39:49 2007
New Revision: 606538

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

	* xbuildgen (format_size): New function to format a size in
	an easy-to-read way.
	(get_lib_size): Called format_size and silenced warning when
	unable to find the library in the log to reduce the noise in
	cases when it fails to build.
	(Logs and Columns): Added log sizes and the total number of each
	of the three kinds of components (examples, locales, and tests).
	Reduced false positives when counting warning and error messages.
	Moved awk script here-document to...
	* xcomp.awk: ...here, and (hopefully) correctly handled the case
	of missing components. Added links to locale definition files
	and character set description files in the source repository.
	Added grand totals and totals of failed components.
	
	STDCXX-683
	* xbuildgen (resultstyle.css): Added td.total, td.XPASS, td.XWARN,
	td.XEXIT, td.XRUNWARN, td.XDIFF, td.XASSERT, td.XCOMP, and td.XLINK.
	(Codes and Colors): Added descriptions for the above statuses.

Added:
    incubator/stdcxx/trunk/bin/xcomp.awk   (with props)
Modified:
    incubator/stdcxx/trunk/bin/xbuildgen

Modified: incubator/stdcxx/trunk/bin/xbuildgen
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/bin/xbuildgen?rev=606538&r1=606537&r2=606538&view=diff
==============================================================================
--- incubator/stdcxx/trunk/bin/xbuildgen (original)
+++ incubator/stdcxx/trunk/bin/xbuildgen Sat Dec 22 21:39:49 2007
@@ -250,6 +250,30 @@
 
 
 ######################################################################
+# formats a size value in an easy-to-read way
+format_size ()
+{
+    size=$1
+
+    if [ $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
+        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
+        kbsize="$((size / 1024)).$(((size % 1024) / 100))"
+        size="<div title=\"$size bytes\">$kbsize kB</div>"
+    fi
+
+    echo $size
+}
+
+
+######################################################################
 # extracts the size of the library binary from the build log
 # being careful to avoid the symlink (in the case of a .so)
 get_lib_size ()
@@ -258,8 +282,12 @@
 
     libsize=`awk '/build\/lib\/libstd[^ ]*\$/{ print $5 }' $file`
     if [ "$libsize" = "" ]; then
-        echo "$myname: warning: unable to extract library size from $l" >&2
+        # avoid warning for missing library size to reduce the noise
+        # 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
@@ -610,22 +638,22 @@
 td {
     padding: 2px;
     text-align: center;
-    background-color:powderblue;
+    background:powderblue;
 }
 td.rowno {
     padding: 3px;
     text-align: right;
-    background-color:lightgray;
+    background:lightgray;
 }
 td.name {
     padding: 3px;
     text-align: left;
-    background-color:lightblue;
+    background:lightblue;
 }
 td.number {
     padding: 3px;
     text-align: center;
-    background-color:lightblue;
+    background:lightblue;
 }
 td.na {
     background:white;
@@ -635,12 +663,24 @@
     background:#cccccc;
     text-align:center;
     font-weight:bold;
+    font-family:lucida mono;
+}
+td.total {
+    background:#cccccc;
+    text-align:center;
+    font-weight:bold;
 }
 td.OK {
     background:forestgreen;
     text-align:center;
     font-weight:bold;
 }
+td.XPASS {
+    color:yellow;
+    background:forestgreen;
+    text-align:center;
+    font-weight:bold;
+}
 td.BASE {
     background:lightgreen;
     text-align:center;
@@ -666,7 +706,13 @@
     color:red;
     background:#ffff99;
     text-align:center;
-    font-family:fixed
+    font-weight:bold;
+}
+td.XWARN {
+    color:tomato;
+    background:lightgreen;
+    text-align:center;
+    font-weight:bold;
 }
 td.EXIT {
     color:red;
@@ -674,6 +720,12 @@
     text-align:center;
     font-weight:bold;
 }
+td.XEXIT {
+    color:tomato;
+    background:lightgreen;
+    text-align:center;
+    font-weight:bold;
+}
 td.FORMAT {
     background:#ffffcc;
     text-align:center;
@@ -684,35 +736,71 @@
     text-align:center;
     font-weight:bold;
 }
+td.XRUNWARN {
+    color:dimgray;
+    background:lightgreen;
+    text-align:center;
+    font-weight:bold;
+}
 td.DIFF {
     color:red;
     background:#ffff99;
     font-weight:bold;
     text-align:center;
 }
+td.XDIFF {
+    color:tomato;
+    background:lightgreen;
+    font-weight:bold;
+    text-align:center;
+}
 td.ASSERT {
     color:red;
     background:#ffff99;
     font-weight:bold;
     text-align:center;
 }
+td.XASSERT {
+    color:tomato;
+    background:lightgreen;
+    font-weight:bold;
+    text-align:center;
+}
 td.SIGNAL {
     color:yellow;
     background:red;
     font-weight:bold;
     text-align:center;
 }
+td.XSIGNAL {
+    color:tomato;
+    background:lightgreen;
+    font-weight:bold;
+    text-align:center;
+}
 td.COMP {
     background:violet;
     font-weight:bold;
     text-align:center;
 }
+td.XCOMP {
+    color:violet;
+    background:lightgreen;
+    font-weight:bold;
+    text-align:center;
+}
 td.LINK {
     color:yellow;
     background:mediumpurple;
     font-weight:bold;
     text-align:center;
 }
+td.XLINK {
+    color:mediumpurple;
+    background:lightgreen;
+    font-weight:bold;
+    text-align:center;
+}
 td.xdep {
     color:yellow;
     background:gray;
@@ -744,13 +832,13 @@
     <h2>Index</h2>
 
     <ul>
-        <li><a href="#logs">Logs and Columns</a></li>
-        <li><a href="#timings">Timings</a></li>
-        <li><a href="#examples">Examples</a></li>
-        <li><a href="#tests">Tests</a></li>
-        <li><a href="#locales">Locales</a></li>
-        <li><a href="#codes">Codes and Colors</a></li>
-        <li><a href="#buildtypes">Build Types</a></li>
+      <li><a href="#logs">Logs and Columns</a></li>
+      <li><a href="#timings">Timings</a></li>
+      <li><a href="#examples">Examples</a></li>
+      <li><a href="#tests">Tests</a></li>
+      <li><a href="#locales">Locales</a></li>
+      <li><a href="#codes">Codes and Colors</a></li>
+      <li><a href="#buildtypes">Build Types</a></li>
     </ul>
     <hr>
 EOF
@@ -790,7 +878,7 @@
     <table>
       <thead>
         <tr>
-          <th rowspan=3><div title="column number and log">col.</div></th>
+          <th rowspan=3><div title="column number and log">log</div></th>
           <th rowspan=3>build<br>type</th>
           <th colspan=21>build and run times (M:SS)</th>
         </tr>
@@ -848,19 +936,51 @@
     <table>
       <thead>
         <tr>
-          <th><div title="column number and log">col.</div></th>
-          <th>OS</th>
-          <th>arch</th>
-          <th>compiler</th>
-          <th>build<br>type</th>
-          <th>build start date</th>
-          <th>build<br>age</th>
-          <th>revision</th>
-          <th>library<br>(bytes)</th>
-          <th>build<br>(kB)</th>
-          <th>clean<br>(kB)</th>
-          <th>errors</th>
-          <th>warnings</th>
+          <th rowspan=3><div title="column number and log">log</div></th>
+          <th rowspan=3>operating<br>system</th>
+          <th rowspan=3><div title="hardware architecture">arch</div></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>revision</th>
+          <th colspan=5>sizes</th>
+          <th colspan=2>diagnostics</th>
+          <th colspan=3>components</th>
+        </tr>
+        <tr>
+          <th rowspan=2>
+            <div title="size of the library binary">library</div>
+          </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>
         </tr>
       </thead>
       <tbody>
@@ -881,6 +1001,11 @@
 # 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
+
 for l in $gzlogs; do
     n=$((n + 1))
     fname=`basename $l`
@@ -900,9 +1025,17 @@
     gunzip -c $l > $txtlog
     if [ $? -ne 0 ]; then
         echo "$myname: error unzipping $l" >&2
-        exit 1
+
+        # continue processing the empty log below
     fi
 
+    # determine the size of the compressed and decompressed log
+    gzlogsize=`wc -c $l`
+    gzlogsize=`format_size ${gzlogsize% *}`
+
+    txtlogsize=`wc -c $txtlog`
+    txtlogsize=`format_size ${txtlogsize% *}`
+
     # extract the date and time the build started
     # the date is expected to be introduced by a line like this:
     #   ### date:
@@ -917,6 +1050,8 @@
         # or just seconds, whichever happens to be the most
         # significant
         age=`$HOME/stdcxx/bin/duration "$date" "$today"`
+        full_age=`$HOME/stdcxx/bin/duration -f "$date" "$today"`
+        age="<div title=\"$full_age\">$age</div>"
     fi
 
     # strip the year from the date
@@ -936,6 +1071,12 @@
     else
         fullbuildsize=${buildsizes%%[^0-9]*}
         cleanbuildsize=${buildsizes#[0-9]*[^0-9]}
+
+        fullbuildsize=$((fullbuildsize * 1024))
+        cleanbuildsize=$((cleanbuildsize * 1024))
+
+        fullbuildsize=`format_size $fullbuildsize`
+        cleanbuildsize=`format_size $cleanbuildsize`
     fi
 
     # extract the source repository revision number the build
@@ -959,8 +1100,17 @@
     compiler=`get_compiler $txtlog`
 
     # count the number of errors and warnings in the build
-    errors=`grep -i error $txtlog | wc -l`
-    warnings=`grep -i warning $txtlog | wc -l`
+    # avoid including false positives for words containing
+    # the string "error" or "warning"
+
+    # avoid counting (often ignored) make errors
+    errors=`  grep -i "[^a-z_A-Z0-9]error[^a-z_A-Z0-9]" $txtlog \
+            | grep -v "[^a-z_A-Z0-9]*gmake[^a-z_A-Z0-9]"| wc -l`
+
+    # (try to) avoid counting lines showing the context of the warning
+    # this should be tailored to every compiler
+    warnings=`  grep -i "[^a-z_A-Z0-9]warning[^a-z_A-Z0-9]" $txtlog \
+              | grep -i -v "called from here" | wc -l`
 
     ###
     if [ $components_in_rows -ne 0 ]; then
@@ -987,19 +1137,21 @@
         tbl_hdr_2="$tbl_hdr_2 <th>$buildtype</th>"
 
         output "      <tr>"
-        output "          <td>$colhdr</td>"
-        output "          <td>$osname</td>"
-        output "          <td>$arch</td>"
-        output "          <td>$compiler</td>"
-        output "          <td>$buildtype</td>"
-        output "          <td>$date</td>"
-        output "          <td>$age</td>"
-        output "          <td><a href=$revurl=$revno>$revno</a></td>"
-        output "          <td>$libsize</td>"
-        output "          <td>$fullbuildsize</td>"
-        output "          <td>$cleanbuildsize</td>"
-        output "          <td>$errors</td>"
-        output "          <td>$warnings</td>"
+        output "        <td>$colhdr</td>"
+        output "        <td>$osname</td>"
+        output "        <td>$arch</td>"
+        output "        <td>$compiler</td>"
+        output "        <td>$buildtype</td>"
+        output "        <td>$date</td>"
+        output "        <td>$age</td>"
+        output "        <td><a href=$revurl=$revno>$revno</a></td>"
+        output "        <td>$libsize</td>"
+        output "        <td>$gzlogsize</td>"
+        output "        <td>$txtlogsize</td>"
+        output "        <td>$fullbuildsize</td>"
+        output "        <td>$cleanbuildsize</td>"
+        output "        <td>$errors</td>"
+        output "        <td>$warnings</td>"
 
         cat <<EOF >>$timings_file
 
@@ -1019,8 +1171,6 @@
         get_times "total" $txtlog >>$timings_file
 
         echo "        </tr>" >>$timings_file
-        
-        output "      </tr>"
     fi
 
 
@@ -1087,6 +1237,32 @@
         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
+
     rm $runlog.next
     rm $txtlog
 done
@@ -1142,157 +1318,7 @@
 
 ######################################################################
 
-awkscript=$TMP/stdcxx-cross.$$.awk
-
-cat > $awkscript <<EOF
-BEGIN {
-    columns     = ""
-    compinx     = 0
-    count       = 0
-    max_asserts = 0
-    min_asserts = -1
-}
-# 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\$" {
-
-    status = \$2
-
-    if (status == 0) {
-        if (comp == "example" || \$5 == 0) {
-            if (\$3 == 0) {
-                class = "OK"
-                value = "0"
-            }
-            else {
-                ++count;
-                ++nfailures [compinx]
-                class = "RUNWARN"
-                value = "(" \$3 ")"
-            }
-        }
-        else {
-            ++count
-            ++nfailures [compinx]
-
-            class   = "ASSERT"
-            # value = \$5 " / " \$4
-            value   = "(" \$5 ")"
-        }
-
-        if (comp == "test") {
-            asserts [n] = \$5
-
-            if (max_asserts < \$4) {
-                max_asserts = \$4
-            }
-
-            if (\$4 < min_asserts || min_asserts < 0) {
-                min_asserts = \$4
-            }
-        }
-    }
-    else if (0 < status && status < 256) {
-        ++count
-        ++nfailures [compinx]
-
-        class = "EXIT"
-        value = status
-    }
-    else if (status == "FORMAT" || status == "NOUT" || status == "OUTPUT") {
-        ++count
-
-        class = status
-        value = status == "FORMAT" ? "FMAT" : status
-    }
-    else if (status == "DIFF" || status == "COMP" || status == "LINK") {
-        ++count
-        ++nfailures [compinx]
-
-        class = status
-        value = status
-    }
-    else {
-        ++count
-        ++nfailures [compinx]
-
-        class = "SIGNAL"
-        value = status
-    }
-
-    columns = columns "\n        <td class=\"" class "\">" value "</td>"
-
-    ++compinx
-}
-
-function build_summary () {
-    if (verbose || count) {
-        print "      <tr>"
-        print "        <td class=\"rowno\">" n "</td>"
-        print "        <td class=\"name\"><a name=\"" name "\"></a>"
-
-        if (dir != "")
-            print "        <a href=\"$svnpath/" dir "/" name ".cpp?view=markup\">"
name "</a>"
-        else
-            print "        " name
-        print "        </td>"
-
-        if (comp == "test") {
-            print "        <td class=\"number\">" max_asserts "</td>"
-        }
-
-        print columns;
-        print "      </tr>"
-    }
-
-    tmpfile = "$TMP/.stdcxx-failtotals.$$.txt"
-
-    if (count) {
-        getline < tmpfile
-        close(tmpfile)
-
-        ORS=" "
-        for (i = 0; i < compinx; ++i) {
-            print nfailures [i] + \$(i + 1) > tmpfile
-        }
-
-        ORS="\n"
-        print "" >> tmpfile
-        close(tmpfile)
-    }
-
-    if (FILENAME == "-") {
-
-        if (comp == "test") {
-            print "<td class=\"header\"></td>"
-        }
-
-        getline < tmpfile
-
-        for (i = 1; i < NF + 1; ++i) {
-            print "        <td class=\"header\">" \$(i) "</td>"
-        }
-
-        system("rm -f " tmpfile)
-    }
-}
-
-function component_summary () {
-    print columns;
-}
-
-END {
-    if (comp != "") {
-        build_summary()
-    }
-    else {
-        component_summary()
-    }
-}
-EOF
+awkscript=$HOME/stdcxx/bin/xcomp.awk
 
 ######################################################################
 
@@ -1303,19 +1329,27 @@
     component_name=$1
     component_list=$2
 
+    count=`echo $component_list | wc -w`
+
     if [ "$component_name" = "test" ]; then
         column3="        <th rowspan=2><div title=\"maximum total assertions\">"
-        column3="$column3 asserts</div></th>"
+        column3="$column3 max<br>asserts</div></th>"
     else
         unset column3
     fi
 
     cat <<EOF | output
-    <h2>Results of ${component_name}s</h2>
+    <h2>Results of $count ${component_name}s</h2>
+    <p>
+      Note: ${component_name}s passing across all builds have been omitted
+      for brevity.
+    </p>
     <table>
       <thead>
         <tr>
-          <th rowspan=2><div title="${component_name} number">###</div></th>
+          <th rowspan=2>
+            <div title="${component_name} number of a total of $count">###</div>
+          </th>
           <th rowspan=2>
             <a name="${component_name}s"></a>$component_name name
           </th>
@@ -1327,6 +1361,8 @@
       <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
@@ -1338,18 +1374,33 @@
         # (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_name ]; then
             dir=""
         elif [ "locale" = $component_name ]; then
-            dir=""
+            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_name ]; then
 
             dir="tests"
 
             case $c in
-                *-stdcxx-*) dir="$dir/regress";;
+                *.stdcxx-*) dir="$dir/regress";;
                 0.*)  dir="$dir/self";;
                 17.*) dir="$dir/intro";;
                 18.*) dir="$dir/support";;
@@ -1364,28 +1415,26 @@
                 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 verbose=$verbose comp=$component_name \
-              $textlogs \
+              n=$n dir=$dir name=$c dispname="$dispname" verbose=$verbose \
+              comp=$component_name totalsfile=$totals_file $textlogs    \
         | output
 
     done
-    cat <<EOF | output
-        <tr>
-          <td class="rowno">$n</th>
-          <td class="header">
-            <div title="total number of ${component_name}s/failed number of ${component_name}s">total/failed</div>
-          </td>
-EOF
 
     # 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="@" | output
+    echo "" | awk -f $awkscript comp=$component_name name="@" \
+              totalsfile=$totals_file svnpath=$svnpath        \
+            | output
 
     cat <<EOF | output
-        </tr>
       </tbody>
     </table>
 EOF
@@ -1423,8 +1472,8 @@
             line=`grep "^$c  *[^-]" $l`
             if [ $? -eq 0 -a "$line" != "" ]; then
                   echo $line \
-                | awk -f $awkscript component=$component_name \
-                      name=$c verbose=$verbose \
+                | awk -f $awkscript component=$component_name   \
+                      name=$c verbose=$verbose svnpath=$svnpath \
                 | output
             else
                 output "        <td class=\"missing\">N/A</td>"
@@ -1462,103 +1511,159 @@
     <h2><a name="codes"></a>Codes and Colors</h2>
     <table>
       <thead>
+
         <tr>
-          <td class="header">Symbol</td>
-          <td class="header">Meaning</td>
+          <th colspan=4 class="header">Status</th>
+          <th rowspan=2 class="header">Meaning</th>
+        </tr>
+        <tr>
+          <th class="header">
+            <div title="Unexpected success or ordinary failure">
+
+              Unexpected
+            </div>
+          </th>
+          <th class="header">Severity</th>
+          <th class="header">
+            <div title="Ordinary success or expected failure">
+              Expected
+            </div>
+          </th>
+          <th class="header">Severity</th>
+        </tr>
+      </thead>
+
+      <tbody>
+        <tr>
+          <td class="XPASS">XPASS</td>
+          <td class="na">Success</td>
+          <td class="OK">OK</td>
+          <td class="na">Success</td>
+          <td class="na">
+            Component completed successfully and produced the expected
+            output.
+          </td>
+        </tr>
+        <tr>
+          <td colspan=2 class="na"><center>Not Applicable</center></td>
+          <td class="NOUT">NOUT</td>
+          <td class="na">Success</td>
+          <td class="na">
+            Component completed successfully and produced no output.
+          </td>
+        </tr>
+        <tr>
+          <td colspan=2 class="na"><center>Not Applicable</center></td>
+          <td class="BASE">BASE</td>
+          <td class="na">Success</td>
+          <td class="na">
+            Component completed successfully and matched the baseline.
+          </td>
+        </tr>
+        <tr>
+          <td colspan=2 class="na"><center>Not Applicable</center></td>
+          <td class="FORMAT">FMAT</td>
+          <td class="na">Success</td>
+          <td class="na">
+             Component completed successfully but produced unexpected
+             output.
+          </td>
+        </tr>
+        <tr>
+          <td class="missing">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>
+        </tr>
+        <tr>
+          <td class="XDEP">XDEP</td>
+          <td class="na">Failure</td>
+          <td colspan=2 class="na"><center>Not Applicable</center></td>
+          <td class="na">
+              Component was not attempted due to a missing (or failed)
+              dependency.
+          </td>
+        </tr>
+        <tr>
+          <td class="COMP">COMP</td>
+          <td class="na">Failure</td>
+          <td class="XCOMP">XCOMP</td>
+          <td class="na">Success</td>
+          <td class="na">Component failed to compile.</td>
+        </tr>
+        <tr>
+          <td class="LINK">LINK</td>
+          <td class="na">Failure</td>
+          <td class="XLINK">XLINK</td>
+          <td class="na">Success</td>
+          <td class="na">
+               Component compiled successfully but failed to link.
+          </td>
+        </tr>
+        <tr>
+          <td class="WARN">WARN</td>
+          <td class="na">Success</td>
+          <td class="XWARN">XWARN</td>
+          <td class="na">Success</td>
+          <td class="na">
+             Component compiled and linked successfully but with warnings.
+          </td>
+        </tr>
+        <tr>
+          <td class="RUNWARN">(N)</td>
+          <td class="na">Success</td>
+          <td class="XRUNWARN">(N)</td>
+          <td class="na">Success</td>
+          <td class="na">
+
+            Component compiled and linked successfully, exited with
+            a status of 0, but produced N warnings at runtime.
+          </td>
+        </tr>
+        <tr>
+
+          <td class="EXIT">N</td> 
+          <td class="na">Failure</td>
+          <td class="XEXIT">N</td>
+          <td class="na">Success</td>
+          <td class="na">
+            Component compiled and linked successfully but exited with
+            a non-zero status of N.
+          </td>
+        </tr>
+        <tr>
+          <td class="DIFF">DIFF</td>
+          <td class="na">Failure</td>
+          <td class="XDIFF">XDIFF</td>
+          <td class="na">Success</td>
+          <td class="na">
+            Component compiled and linked successfully, exited with
+            a status of 0, but produced unexpected output.
+          </td>
+        </tr>
+        <tr>
+          <td class="SIGNAL">[SIG]&lt;name&gt;</td>
+          <td class="na">Failure</td>
+          <td class="XSIGNAL">X[SIG]&lt;name&gt;</td>
+          <td class="na">Success</td>
+          <td class="na">
+            Component compiled and linked successfully, but exited
+            with the named signal (for example, SIGABRT).
+          </td>
+        </tr>
+        <tr>
+          <td class="ASSERT">(N)</td>
+          <td class="na">Failure</td>
+          <td class="XASSERT">(N)</td>
+          <td class="na">Success</td>
+          <td class="na">
+            Component compiled and linked successfully, exited with
+            a status of 0, but failed N assertions at runtime.
+          </td>
         </tr>
-        </thead>
-        <tbody>
-          <tr>
-            <td class="OK">OK</td>
-            <td class="na">
-              Component completed successfully and produced the expected
-              output.
-            </td>
-          </tr>
-          <tr>
-            <td class="NOUT">NOUT</td>
-            <td class="na">
-              Component completed successfully and produced no output.
-            </td>
-          </tr>
-          <tr>
-            <td class="BASE">BASE</td>
-            <td class="na">
-              Component completed successfully and matched the baseline.
-            </td>
-          </tr>
-          <tr>
-            <td class="FORMAT">FMAT</td>
-            <td class="na">
-               Component completed successfully but produced unexpected
-               output.
-            </td>
-          </tr>
-          <tr>
-            <td class="missing">N/A</td>
-            <td class="na">Component was not tested.</td>
-          </tr>
-          <tr>
-            <td class="XDEP">XDEP</td>
-            <td class="na">
-                Component was not attempted due to a missing (or failed)
-                dependency.
-            </td>
-          </tr>
-          <tr>
-            <td class="COMP">COMP</td>
-            <td class="na">Component failed to compile.</td>
-          </tr>
-          <tr>
-            <td class="LINK">LINK</td>
-            <td class="na">
-                 Component compiled successfully but failed to link.
-            </td>
-          </tr>
-          <tr>
-            <td class="WARN">WARN</td>
-            <td class="na">
-               Component compiled and linked successfully but with warnings.
-            </td>
-          </tr>
-          <tr>
-            <td class="runwarn">(N)</td>
-            <td class="na">
-              Component compiled and linked successfully, exited with
-              a status of 0, but produced N warnings at runtime.
-            </td>
-          </tr>
-          <tr>
-            <td class="EXIT">N</td>
-            <td class="na">
-              Component compiled and linked successfully but exited with
-              a non-zero status of N.
-            </td>
-          </tr>
-          <tr>
-            <td class="DIFF">DIFF</td>
-            <td class="na">
-              Component compiled and linked successfully, exited with
-              a status of 0, but produced unexpected output.
-            </td>
-          </tr>
-          <tr>
-            <td class="SIGNAL">[SIG]&lt;name&gt;</td>
-            <td class="na">
-              Component compiled and linked successfully, but exited
-              with the named signal (for example, SIGABRT).
-            </td>
-          </tr>
-          <tr>
-            <td class="assert">(N)</td>
-            <td class="na">
-              Component compiled and linked successfully, exited with
-              a status of 0, but failed N assertions at runtime.
-            </td>
-          </tr>
       </tbody>
     </table>
-    
+   
     <h2><a name="buildtypes"></a>Build Types</h2>
 
     <table>
@@ -1677,10 +1782,10 @@
 
     if [ $verbose -eq 1 ]; then
         echo "$myname: " \
-             "rm $awkscript $examples_file $tests_file $locales_file " \
+             "rm $examples_file $tests_file $locales_file " \
              "$textlogs $timings_file"
     fi
 
-    rm $awkscript $examples_file $tests_file $locales_file $textlogs \
+    rm $examples_file $tests_file $locales_file $textlogs \
        $timings_file
 fi

Added: incubator/stdcxx/trunk/bin/xcomp.awk
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/bin/xcomp.awk?rev=606538&view=auto
==============================================================================
--- incubator/stdcxx/trunk/bin/xcomp.awk (added)
+++ incubator/stdcxx/trunk/bin/xcomp.awk Sat Dec 22 21:39:49 2007
@@ -0,0 +1,294 @@
+#!/bin/awk
+#
+# $Id$
+#
+########################################################################
+#
+#  Licensed to the Apache Software  Foundation (ASF) under one or more
+#  contributor  license agreements.  See  the NOTICE  file distributed
+#  with  this  work  for  additional information  regarding  copyright
+#  ownership.   The ASF  licenses this  file to  you under  the Apache
+#  License, Version  2.0 (the  "License"); you may  not use  this file
+#  except in  compliance with the License.   You may obtain  a copy of
+#  the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the  License is distributed on an  "AS IS" BASIS,
+#  WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+#  implied.   See  the License  for  the  specific language  governing
+#  permissions and limitations under the License.
+#
+########################################################################
+#
+# SYNOPSIS
+#     myname [n=#] [name=$name] [dispname=$dispname]
+#            [svnpath=$svnpath] [verbose=0|1] [comp=$comp]
+#            [totalsfile=$totalsfile] [expectfile=$expectfile]
+#            logs...
+#
+# VARIABLES:
+#   n            component number
+#   name         component name
+#   dispname     component display name
+#   verbose      verbose mode
+#   comp         component kind (example, locale, or test)
+#   totalsfile   name of totals file
+#   expectfile   name of file with expected results
+#
+########################################################################
+
+
+BEGIN {
+    # the text of all columns, output after all logs have been processed
+    columns = ""
+
+    # total number of times the current component has been found to fail
+    # in all logs
+    compfails = 0
+
+    # maximum and minimum number of assertions for the current component
+    max_asserts = 0
+    min_asserts = -1
+
+    # one-based file number (the first file on the command line
+    # is number one, etc.)
+    fileno = 0
+
+    # 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
+
+    # 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 keep track of the current file number
+1 == FNR {
+    if (0 < fileno && found_in_file < fileno) {
+        columns = columns "\n        <td class=\"missing\">N/A</td>"
+        found_in_file = -1
+    }
+
+    ++fileno
+}
+
+
+# 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$" {
+
+    # 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.
+
+    # increment the total of components found in this log
+    ++logcounts [fileno - 1]
+
+    # the second field is always the exit status of the component
+    status = $2
+
+    found_in_file = fileno
+
+    if (status == 0) {
+
+        # successful exit status
+
+        if (comp == "example" || $5 == 0) {
+
+            # component is an example or, when not, had zero failures
+
+            # get the number of warnings (only valid when the number
+            # fields is greater than 5)
+            warnings = 5 < NF ? $3 : 0
+
+            if (warnings == 0) {
+                class = "OK"
+                value = "0"
+            }
+            else {
+                ++compfails;
+                ++logfails [fileno - 1]
+                class = "RUNWARN"
+                value = "<div title=\"" warnings " warnings\">(" warnings \
+                        ")</div>"
+            }
+        }
+        else {
+
+            # component is not an example or, when it is, had failures
+
+            ++compfails
+            ++logfails [fileno - 1]
+
+            class = "ASSERT"
+            value = "<div title=\"" $5 " failed assertions out of " $4 \
+                    "\">(" $5 ")</div>"
+        }
+
+        if (comp == "test") {
+            asserts [n] = $5
+
+            if (max_asserts < $4) {
+                max_asserts = $4
+            }
+
+            if ($4 < min_asserts || min_asserts < 0) {
+                min_asserts = $4
+            }
+        }
+    }
+    else if (0 < status && status < 256) {
+        ++compfails
+        ++logfails [fileno - 1]
+
+        class = "EXIT"
+        value = "<div title=\"exit status of " status "\">" status \
+                "</div>"
+    }
+    else if (status == "FORMAT" || status == "NOUT" || status == "OUTPUT") {
+        ++compfails
+
+        class = status
+        value = status == "FORMAT" ? "FMAT" : status
+    }
+    else if (status == "DIFF" || status == "COMP" || status == "LINK") {
+        ++compfails
+        ++logfails [fileno - 1]
+
+        class = status
+        value = status
+    }
+    else {
+        ++compfails
+        ++logfails [fileno - 1]
+
+        class = "SIGNAL"
+        value = status
+    }
+
+    columns = columns "\n          <td class=\"" class "\">" value "</td>"
+}
+
+
+function build_summary ()
+{
+    if (verbose || compfails) {
+        print "        <tr>"
+        print "          <td class=\"rowno\">" n "</td>"
+        print "          <td class=\"name\"><a name=\"" name "\"></a>"
+        print "            " dispname
+        print "          </td>"
+
+        if (comp == "test") {
+            print "          <td class=\"number\">" max_asserts "</td>"
+        }
+
+        print columns;
+        print "      </tr>"
+    }
+
+    if (compfails) {
+        # increment counts in the totals file
+
+        getline < totalsfile
+        close(totalsfile)
+
+        # set the Output Record Separator to space
+        ORS=" "
+
+        for (i = 0; i < fileno; ++i) {
+            print logcounts [i] + $(i + 1) > totalsfile
+        }
+
+        for (i = 0; i < fileno; ++i) {
+            print logfails [i] + $(i + fileno + 1) > totalsfile
+        }
+
+        # append a newline to the file
+        ORS="\n"
+        print "" >> totalsfile
+        close(totalsfile)
+    }
+
+    if (name == "@") {
+
+        # the special (bogus) name indicates a request to format
+        # totals from the totals file
+
+        # read the totals from the totalsfile
+        getline < totalsfile
+
+        nfields=NF
+
+        # 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>"
+
+        if (comp == "test") {
+            print "          <td class=\"header\"></td>"
+        }
+
+        for (i = nfields / 2; i < nfields; ++i) {
+            print "          <td class=\"total\">" $(i + 1) "</td>"
+        }
+
+        print "        </tr>"
+
+        # 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>"
+
+        if (comp == "test") {
+            print "          <td class=\"header\"></td>"
+        }
+
+        for (i = 0; i < nfields / 2; ++i) {
+            print "          <td class=\"total\">" $(i + 1) "</td>"
+        }
+
+        print "        </tr>"
+
+        system("rm -f " totalsfile)
+    }
+}
+
+function component_summary () {
+    print columns;
+}
+
+END {
+    if (comp != "") {
+        if (found_in_file < fileno) {
+
+            # the component wasn't found in the last file processed
+            columns = columns "\n          <td class=\"missing\">N/A</td>"
+        }
+
+        build_summary()
+    }
+    else {
+        component_summary()
+    }
+}

Propchange: incubator/stdcxx/trunk/bin/xcomp.awk
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/stdcxx/trunk/bin/xcomp.awk
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message