#!/bin/sh # # $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. # # Copyright 2007 Rogue Wave Software. # ######################################################################## # # NAME # xbuildgen - Generate build results across multiple platforms. # # SYNOPSIS # xbuildgen [option(s)...] [log-file(s)...] # # DESCRIPTION # The xbuildgen utility generates a build result in HTML format # across multiple platforms or tests with builds in columns and # components such as examples, locales, and tests in rows by # default. # # OPTIONS # -n No clean. Avoid removing temporary files. # # -s Stylesheet. Create a style sheet named resultstyle.css in # the same directory as the output file when the -o option # is specified, or in the current working directory otherwise. # # -v Verbose. Produce verbose output on stdout. # # -e # Generate a report for the specified list of example programs # with examples listed in columns and builds in rows. # # -l # Generate a report for the specified list of locales with # locales listed in columns and builds in rows. # # -o # Specify the pathname of the output file. The utility will # use stdout when no output file is specified. # # -t # Generate a report for the specified list of tests with # tests listed in columns and builds in rows. # ######################################################################## # by default, display one component (example, locale, or test) per row components_in_rows=1 ## process command line options while getopts ":nsv:e:l:o:t:" opt_name; do case $opt_name in # options with no arguments n) # avoid cleaning up temporary files no_clean=1 ;; s) # create a style sheet create_stylesheet=1 ;; v) # output all components (including passing ones) verbose=1 ;; # options with arguments e) # argument is a list of examples to process example_list=$OPTARG components_in_rows=0 ;; l) # argument is a list of locales to process locale_list=$OPTARG components_in_rows=0 ;; o) # argument is the name of output file (stdout by default) outfile=$OPTARG ;; t) # argument is a list of tests to process test_list=$OPTARG components_in_rows=0 ;; *) echo "unknown option : -$opt_name" >&2; exit 1;; esac; done # remove command line options and their arguments from the command line shift $(($OPTIND - 1)) # take the remaining command line arguments as the names of logs # to process gzlogs=$* # set the TMP variable to /tmp if not set [ -z $TMP ] && TMP=/tmp ###################################################################### # output to output file when specified or to stdout output () { if [ $# -eq 0 ]; then # no arguments provided, copy its own stdin to outfile if [ -z $outfile ]; then cat else cat >>$outfile fi elif [ -z $outfile ]; then echo "$*" else echo "$*" >>$outfile fi } ###################################################################### # remove output file if specified if [ ! -z $outfile ]; then rm -f $outfile fi # overwrite style sheet if [ "$create_stylesheet" = "1" ]; then if [ -z $outfile ]; then dir=. else dir=`dirname $outfile` fi cat <$dir/resultstyle.css table { border-width:0px; background:#000000; font-size:smaller; } th { font-family:fixed font-size:smaller; background:#cccccc; text-align:center; } td { font-family:fixed; font-size:smaller; padding: 3px; text-align: center; background-color: lightblue; } td.rowno { font-family:fixed; font-size:smaller; padding: 3px; text-align: right; background-color:#cccccc; } td.name { font-family:fixed; font-size:smaller; padding: 3px; text-align: left; background-color:lightblue; } td.number { font-family:fixed; font-size:smaller; padding: 3px; text-align: center; background-color:lightblue; } td.na { background:white; text-align:left; font-family:fixed font-size:smaller; } td.header { background:#cccccc; text-align:center; font-family:fixed; font-size:smaller; font-weight:bold; } td.OK { background:forestgreen; text-align:center; font-family:fixed; font-size:smaller; font-weight:bold; } td.BASE { background:lightgreen; text-align:center; font-size:smaller; font-weight:bold; font-family:fixed; } td.NOUT { background:lightgreen; text-align:center; font-size:smaller; font-weight:bold; font-family:fixed; } td.OUTPUT { background:lightgreen; text-align:center; font-size:smaller; font-weight:bold; font-family:fixed; } td.missing { color:white; background:lightgray; text-align:center; font-size:smaller; font-family:fixed; font-weight:bold; } td.WARN { color:red; background:#ffff99; text-align:center; font-family:fixed } td.EXIT { color:red; background:gold; text-align:center; font-weight:bold; font-family:fixed; font-size:smaller; } td.FORMAT { background:#ffffcc; text-align:center; font-family:fixed font-size:smaller; } td.RUNWARN { color:black; background:#ffff99; text-align:center; font-weight:bold; font-family:fixed; font-size:smaller; } td.DIFF { color:red; background:#ffff99; font-weight:bold; text-align:center; font-family:fixed; font-size:smaller; } td.ASSERT { color:red; background:#ffff99; font-weight:bold; text-align:center; font-family:fixed; font-size:smaller; } td.SIGNAL { color:yellow; background:red; font-weight:bold; text-align:center; font-family:fixed; font-size:smaller; } td.COMP { background:violet; font-weight:bold; text-align:center; font-family:fixed; font-size:smaller; } td.LINK { color:yellow; background:mediumpurple; font-weight:bold; text-align:center; font-family:fixed; font-size:smaller; } td.xdep { color:yellow; background:gray; font-weight:bold; text-align:center; font-family:fixed; font-size:smaller; } EOF fi ###################################################################### # output the initial portion of the HTML file cat <

Multi-platform Test Result View

Generated `date`

Index


EOF ###################################################################### # 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.$$ # remove temporary files in case they exist rm -f $tests_file $examples_file $locales_file if [ $? -ne 0 ]; then exit 2 fi cat <Logs and Columns
    EOF ###################################################################### # expand gzipped logs and extract the relevant portion from each into # a smaller text file for fast and easy processing n=0 for l in $gzlogs; do n=`expr $n + 1` fname=`basename $l` if [ $components_in_rows -ne 0 ]; then # output one component per row with their results in columns table_header="$table_header
    $n
    " output "
  1. $fname
  2. " fi # runlog=$TMP/.stdcxx-tmplog.$$.$n runlog=$TMP/`basename $l`.$$ textlogs="$textlogs $runlog" gunzip -c $l \ | sed -e "1,/### [g]*make runall/d" \ -e "/^[g]*make\[.\]: .*/d" \ -e "/###/,999999d" \ -e "/^PHDIR/d" \ -e "/\/bin\/sh: /d" > $runlog status=$? if [ $status -eq 0 ]; then # extract the list of locales from the log sed -e "1,2d" $runlog \ | sed -n -e "1,/NAME */p" \ | sed -e "/NAME */d" \ -e "s/ *.*//" >>$locales_file status=$? else exit 3 fi if [ $status -eq 0 ]; then # extract the list of tests from the log sed "1,2d" $runlog \ | sed -e "1,/NAME */d" \ -e "/NAME */,999999d" \ -e "s/ *.*//" >>$tests_file; status=$? else exit 3 fi if [ $status -eq 0 ]; then # extract the list of examples from the log \ sed "1,2d" $runlog \ | sed -e "1,/NAME */d" \ | sed -e "1,/NAME */d" \ | sed -e "/NAME */,999999d" \ -e "s/ *.*//" >>$examples_file else exit 3 fi done n=0 if [ $components_in_rows -eq 0 ]; then for c in $example_list $test_list $locale_list; do n=`expr $n + 1` # output one build per row, with components in columns table_header="$table_header
    $n
    " output "
  3. $c
  4. " done fi output "
" output "
" 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=$TMP/stdcxx-cross.$$.awk cat > $awkscript <" value "" ++compinx } function build_summary () { if (verbose || count) { print " " print " " n "" print " " \ name "" if (comp == "test") { print " " max_asserts "" } print columns; print " " } 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 "" } getline < tmpfile for (i = 1; i < NF + 1; ++i) { print " " \$(i) "" } system("rm -f " tmpfile) } } function component_summary () { print columns; } END { if (comp != "") { build_summary() } else { component_summary() } } EOF ###################################################################### # process a list of components, one component per row process_components() { component_name=$1 component_list=$2 if [ $component_name = "test" ]; then column3="
asserts
" else unset column3 fi cat <Results of ${component_name}s $column3 $table_header EOF n=0; for c in $component_list; do n=`expr $n + 1` awk -f $awkscript \ n=$n name=$c verbose=$verbose comp=$component_name \ $textlogs \ | output done cat < EOF echo "" | awk -f $awkscript comp=$component_name | output cat <
###
$component_name name
$n
total/failed
EOF } ###################################################################### # process a list of builds, one build per row process_builds() { component_name=$1 component_list=$2 cat <Results of ${component_name}s $table_header EOF for l in $textlogs; do fname=`basename $l .$$` cat < EOF for c in $component_list; do line=`grep "^$c *[^-]" $l` if [ $? -eq 0 -a "$line" != "" ]; then echo $line \ | awk -f $awkscript component=$component_name \ name=$c verbose=$verbose \ | output else output " " fi done output " " done output "
log
$fname N/A
" } 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`" else if [ "$examples_list" != "" ]; then process_builds "example" "$examples_list" fi if [ "$test_list" != "" ]; then process_builds "test" "$test_list" fi if [ "$locale_list" != "" ]; then process_builds "locale" "$locale_list" fi fi ###################################################################### # output the rest of the HTML file cat <Codes and Colors
Symbol Meaning
OK Component completed successfully and produced the expected output.
NOUT Component completed successfully and produced no output.
BASE Component completed successfully and matched the baseline.
N/A Component was not tested.
XDEP Component was not attempted due to a missing (or failed) dependency.
COMP Component failed to compile.
Component compiled successfully but failed to link.
WARN Component compiled and linked successfully but with warnings.
(N) Component compiled and linked successfully, exited with a status of 0, but produced N warnings at runtime.
N Component compiled and linked successfully but exited with a non-zero status of N.
DIFF Component compiled and linked successfully, exited with a status of 0, but produced unexpected output.
[SIG]<name> Component compiled and linked successfully, but exited with the named signal (for example, SIGABRT).
(N) Component compiled and linked successfully, exited with a status of 0, but failed Nassertions at runtime.

Build Types

Library: Archive Library Shared Library Shared Archive (AIX)
Number/Symbol s
(32-bit)
S
(64-bit)
d
(32-bit)
D
(64-bit)
a
(32-bit)
A
(64-bit)
8
(optimized)
8s: Debugging off, optimized, not reentrant. 8S: Debugging off, optimized, not reentrant. 8d: Debugging off, optimized, not reentrant. 8D: Debugging off, optimized, not reentrant. 8a: Debugging off, optimized, not reentrant. 8A: Debugging off, optimized, not reentrant.
11
(debug)
11s: Debug, not optimized, not reentrant. 11S: Debug, not optimized, not reentrant. 11d: Debug, not optimized, not reentrant. 11D: Debug, not optimized, not reentrant. 11a: Debug, not optimized, not reentrant. 11A: Debug, not optimized, not reentrant.
12
(optimized)
12s: Debugging off, optimized, reentrant. 12S: Debugging off, optimized, reentrant. 12d: Debugging off, optimized, reentrant. 12D: Debugging off, optimized, reentrant. 12a: Debugging off, optimized, reentrant. 12A: Debugging off, optimized, reentrant.
15
(debug)
15s: Debug, not optimized, reentrant. 15S: Debug, not optimized, reentrant. 15d: Debug, not optimized, reentrant. 15D: Debug, not optimized, reentrant. 15a: Debug, not optimized, reentrant. 15A: Debug, not optimized, reentrant.
EOF ###################################################################### if [ -z $no_clean ]; then # clean up rm $awkscript $examples_file $tests_file $locales_file for l in $textlogs; do rm $l done fi