stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r661152 - in /stdcxx/branches/4.2.x/bin: duration genxviews xbuildgen xcomp.awk
Date Wed, 28 May 2008 23:52:00 GMT
Author: sebor
Date: Wed May 28 16:52:00 2008
New Revision: 661152

URL: http://svn.apache.org/viewvc?rev=661152&view=rev
Log:
2008-05-28  Martin Sebor  <sebor@roguewave.com>

	* bin/genxviews (date): Defined at the top of the script to make
	it accessible throughout.
	(process_results): Computed and formatted the age of each batch
	of log files in addition to the timestamp of the oldest one.
	* bin/xbuildgen (myrev, myurl, myname): Computed constants from
	the $HeadURL$ Subversion keyword same as in genxviews.
	(print_help): Added -V option.
	(resultstyle.css): Added EXEC entry.
	Passed the version argument to xcomp.awk.
	* bin/duration (convert_windows_date): New function to convert
	date in Windows "Day MM/DD/YYYY" format to the POSIX %c format.
	(convert_ls_date): New function to convert ls-style timestamps
	to the POSIX %c format.
	(seconds_from_epoch): Called convert_windows_date or
	convert_ls_date to convert Windows or ls-style timestamps to
	the expected POSIX %c format.
	* bin/xcomp.awk (version): Added a new variable to make it
	possible to select branches in addition to trunk.

Modified:
    stdcxx/branches/4.2.x/bin/duration
    stdcxx/branches/4.2.x/bin/genxviews
    stdcxx/branches/4.2.x/bin/xbuildgen
    stdcxx/branches/4.2.x/bin/xcomp.awk

Modified: stdcxx/branches/4.2.x/bin/duration
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/bin/duration?rev=661152&r1=661151&r2=661152&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/bin/duration (original)
+++ stdcxx/branches/4.2.x/bin/duration Wed May 28 16:52:00 2008
@@ -194,11 +194,84 @@
 }
 
 
+# converts date in the Windows "Day MM/DD/YYYY" format
+# to POSIX %c
+convert_windows_date()
+{
+    date=$1
+
+    wday=${date%% *}
+    date=${date#* }
+
+    mon=${date%%/*}
+    date=${date#*/}
+
+    mday=${date%%/*}
+    year=${date#*/}
+
+    case $mon in
+        01) mon="Jan";;
+        02) mon="Feb";;
+        03) mon="Mar";;
+        04) mon="Apr";;
+        05) mon="May";;
+        06) mon="Jun";;
+        07) mon="Jul";;
+        08) mon="Aug";;
+        09) mon="Sep";;
+        10) mon="Oct";;
+        11) mon="Nov";;
+        12) mon="Dec";;
+    esac
+
+    func_return_value="$wday $mon $mday 00:00:00 UTC $year"
+}
+
+
+# converts date in the ls -l format to POSIX %c
+convert_ls_date()
+{
+    date=$1
+
+    mon=${date%% *}
+    date=${date#* }
+
+    mday=${date%% *}
+    time=${date#* }
+
+    if [ ${#time} -eq 4 ]; then
+        year=$time
+        time="00:00:00"
+    else
+        year=`date "+%Y"`
+        time="$time:00"
+    fi
+
+    func_return_value="Mon $mon $mday $time UTC $year"
+}
+
+
 # computes the number of seconds from the Epoch (1/1/1970)
 seconds_from_epoch()
 {
     date=$1
 
+    # remove all leading and trailing whitespace
+    date=${date## }
+    date=${date%% }
+
+    datelen=${#date}
+
+    # check the length to see if the date is in the POSIX %c format
+    if [ $datelen -eq 11 -o $datelen -eq 12 ]; then
+        # assume ls -l format (i.e., "+%b %e %H:%M" or "+%b %e %Y"
+        # POSIX date format)
+        convert_ls_date "$date"; date=$func_return_value
+    elif [ $datelen -eq 14 ]; then
+        # assume Day MM/DD/YYYY
+        convert_windows_date "$date"; date=$func_return_value
+    fi
+
     # extract the year, the 1-based month and day of month, hours,
     # minutes, and seconds (normalized to the GMT time zone) from
     # the date

Modified: stdcxx/branches/4.2.x/bin/genxviews
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/bin/genxviews?rev=661152&r1=661151&r2=661152&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/bin/genxviews (original)
+++ stdcxx/branches/4.2.x/bin/genxviews Wed May 28 16:52:00 2008
@@ -32,6 +32,9 @@
 
 readonly www_stdcxx_dir="/www/stdcxx.apache.org/builds"
 
+# current date and time to compute log ages
+readonly now=`date`
+
 XBUILDGEN=`which xbuildgen 2>/dev/null`
 
 if [ "$XBUILDGEN" = "" ]; then
@@ -252,7 +255,8 @@
     suffixes="a A d D s S"
 
     unset buildlogs
-    unset oldest
+    unset oldest_age
+    unset oldest_time
 
     count=0
 
@@ -292,8 +296,8 @@
     else
         output "          <td><a href=\"$xfile\">$xfile</a></td>"
 
-        oldest=`  cd $logdir && ls -lrt $buildlogs | head -n 1 \
-                | awk '{ print $6 " " $7 " " $8 }'`
+        oldest_time=`  cd $logdir && LANG=C ls -lrt $buildlogs | head -n 1 \
+                    | awk '{ print $6 " " $7 " " $8 }'`
 
         if [ $newlogs -gt 0 ]; then
 
@@ -319,12 +323,18 @@
         end=`expr $end + 60`
     fi
 
+    # compute the amount of time it took to process this batch
     duration=`expr $end - $duration`
 
+    # compute the age of the oldest log
+    if [ "$oldest_time" != "" ]; then
+        oldest_age=`duration "$oldest_time" "$now"`
+    fi
+
     cat<<EOF | output
           <td>$count</td>
           <td>$newlogs</td>
-          <td>$oldest</td>
+          <td title="$oldest_time">$oldest_age</td>
           <td>$duration</td>
         </tr>
 EOF
@@ -637,7 +647,6 @@
 
 
 # compute the number of seconds it took to process all logs
-readonly now=`date`
 processing_time=`duration "$start_time" "$now"`
 
 cat<<EOF | output

Modified: stdcxx/branches/4.2.x/bin/xbuildgen
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/bin/xbuildgen?rev=661152&r1=661151&r2=661152&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/bin/xbuildgen (original)
+++ stdcxx/branches/4.2.x/bin/xbuildgen Wed May 28 16:52:00 2008
@@ -83,9 +83,6 @@
 ######################################################################
 # global constants
 
-# set program name (used in diagnostic messages)
-readonly myname=`basename $0`
-
 # the directory where the script is located to get a hold of other
 # files at locations relative to this one (assumes the script resides
 # within the stdcxx source tree)
@@ -121,14 +118,24 @@
 # default page title (unless overridden on the command line)
 title="Multi-platform Test Result View"
 
-# script's revision number
+# extract the script's revision number
 myrev='$Revision$'
-myrev=${myrev#'$Revision: '}
-myrev=${myrev%' $'}
+myrev=${myrev#'$Revision: '}   # strip leading text
+myrev=${myrev%' $'}            # strip trailing text
+
+# form the URL to this version of the script in the repository
+myurl='$HeadURL$'
+myurl=${myurl#'$HeadURL: '}   # strip leading text
+myurl=${myurl##*asf/}         # strip svn prefix
+myurl=${myurl%' $'}           # strip trailing text
 
-# URL to this version of the script in the repository
-readonly myurl="$svnpath/bin/xbuildgen?view=markup&rev=$myrev"
+# prepend ViewVC prefix
+myurl="http://svn.apache.org/viewvc/$myurl"
 
+# extract program name from the url (used in diagnostic messages)
+readonly myname=${myurl##*/}
+
+myurl="$myurl?view=markup&rev=$myrev"
 
 ######################################################################
 
@@ -175,6 +182,10 @@
     echo "     -t <list-of-tests>"
     echo "          Generate a report for the specified list of tests with"
     echo "          tests listed in columns and builds in rows."
+    echo
+    echo "     -V <version>"
+    echo "          Stdcxx version (branch) to generate results for."
+    echo "          When omitted, trunk is assumed."
 }
 
 ######################################################################
@@ -839,6 +850,12 @@
     font-weight:bold;
     text-align:center;
 }
+td.EXEC {
+    color:white;
+    background:mediumslateblue;
+    font-weight:bold;
+    text-align:center;
+}
 td.xdep {
     color:yellow;
     background:gray;
@@ -947,7 +964,7 @@
     xfails=""
 fi
 
-$xcomp bodyonly=1 logdir=$logdir $xfails $textlogs | output
+$xcomp bodyonly=1 logdir=$logdir version=$version $xfails $textlogs | output
 
 ######################################################################
 # output the rest of the HTML file
@@ -1040,6 +1057,15 @@
           </td>
         </tr>
         <tr>
+          <td class="EXEC">EXEC</td>
+          <td class="na">Failure</td>
+          <td colspan=2 class="na"><center>Not Applicable</center></td>
+          <td class="na">
+             Component compiled and linked successfully but failed
+             to execute (possibly due to a linker error).
+          </td>
+        </tr>
+        <tr>
           <td class="WARN">WARN</td>
           <td class="na">Success</td>
           <td class="XWARN">XWARN</td>

Modified: stdcxx/branches/4.2.x/bin/xcomp.awk
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/bin/xcomp.awk?rev=661152&r1=661151&r2=661152&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/bin/xcomp.awk (original)
+++ stdcxx/branches/4.2.x/bin/xcomp.awk Wed May 28 16:52:00 2008
@@ -23,10 +23,12 @@
 ########################################################################
 #
 # SYNOPSIS
-#     myname [bodyonly=0|1 logdir=<logdir>] logs...
+#     myname [bodyonly=0|1 logdir=<logdir> version=<version>] logs...
 #
 # VARIABLES:
 #   bodyonly     when non-zero, suppresses the <html> tags
+#   logdir
+#   version      stdcxx version (branch) to generate results for.
 #
 ########################################################################
 
@@ -132,8 +134,6 @@
     buildmodes ["15s"] = "archive, debug, reentrant"
     buildmodes ["15S"] = "archive, debug, reentrant, wide"
 
-    svnpath="http://svn.apache.org/viewvc/stdcxx/trunk"
-
     # regular expression to match a name (e.g., compiler or OS)
     re_name    = "[A-Za-z][A-Za-z_0-9]*"
 
@@ -165,6 +165,18 @@
 
 # detect the type of file
 1 == FNR {
+
+    if (svnpath == "") {
+
+        # initialize svnpath using version (assume trunk by default)
+        svnpath = "http://svn.apache.org/viewvc/stdcxx"
+
+        if (version == "" || version == "trunk")
+            svnpath = svnpath "/trunk"
+        else
+            svnpath = svnpath "/branches/" version
+    }
+
     section = 0
 
     if (0 == match(FILENAME, re_logname)) {



Mime
View raw message