diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /contrib/regression | |
download | cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2 cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz |
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig;
imported gcc-4.6.4 source tree from verified upstream tarball.
downloading a git-generated archive based on the 'upstream' tag
should provide you with a source tree that is binary identical
to the one extracted from the above tarball.
if you have obtained the source via the command 'git clone',
however, do note that line-endings of files in your working
directory might differ from line-endings of the respective
files in the upstream repository.
Diffstat (limited to 'contrib/regression')
-rw-r--r-- | contrib/regression/ChangeLog | 158 | ||||
-rw-r--r-- | contrib/regression/GCC_Regression_Tester.wdgt/Default.png | bin | 0 -> 81 bytes | |||
-rw-r--r-- | contrib/regression/GCC_Regression_Tester.wdgt/Icon.png | bin | 0 -> 2122 bytes | |||
-rw-r--r-- | contrib/regression/GCC_Regression_Tester.wdgt/Info.plist | 32 | ||||
-rw-r--r-- | contrib/regression/GCC_Regression_Tester.wdgt/de.lproj/InfoPlist.strings | bin | 0 -> 126 bytes | |||
-rw-r--r-- | contrib/regression/GCC_Regression_Tester.wdgt/en.lproj/InfoPlist.strings | bin | 0 -> 96 bytes | |||
-rw-r--r-- | contrib/regression/GCC_Regression_Tester.wdgt/ja.lproj/InfoPlist.strings | bin | 0 -> 74 bytes | |||
-rw-r--r-- | contrib/regression/GCC_Regression_Tester.wdgt/widget.html | 152 | ||||
-rw-r--r-- | contrib/regression/README | 24 | ||||
-rwxr-xr-x | contrib/regression/btest-gcc.sh | 234 | ||||
-rwxr-xr-x | contrib/regression/mkindex.pl | 107 | ||||
-rwxr-xr-x | contrib/regression/objs-gcc.sh | 128 | ||||
-rw-r--r-- | contrib/regression/site.exp | 18 |
13 files changed, 853 insertions, 0 deletions
diff --git a/contrib/regression/ChangeLog b/contrib/regression/ChangeLog new file mode 100644 index 000000000..5bb1b0884 --- /dev/null +++ b/contrib/regression/ChangeLog @@ -0,0 +1,158 @@ +2013-04-12 Release Manager + + * GCC 4.6.4 released. + +2012-03-01 Release Manager + + * GCC 4.6.3 released. + +2011-10-26 Release Manager + + * GCC 4.6.2 released. + +2011-06-27 Release Manager + + * GCC 4.6.1 released. + +2011-03-25 Release Manager + + * GCC 4.6.0 released. + +2009-09-02 Geoff Keating <geoffk@apple.com> + + * btest-gcc.sh: Continue after bootstrap comparison failure. + +2008-11-27 Geoff Keating <geoffk@geoffk.org> + + * mkindex.pl: New. + +2007-12-24 Geoff Keating <geoffk@geoffk.org> + + * objs-gcc.sh: Revert previous change. + +2007-12-23 Geoff Keating <geoffk@geoffk.org> + + * objs-gcc.sh: Set up the GDB testsuite even if the gdb installed + is just called 'gdb'. + +2007-12-22 Geoff Keating <geoffk@geoffk.org> + + * btest-gcc.sh (TESTLOGS): Add gfortran, and optionally libgomp. + + * GCC_Regression_Tester.wdgt/widget.html: Mark as HTML 4.01, + which it now is, rather than XHTML, which it never was. + (<head>): Mark as UTF-8. Add title. Move CSS to top of + document, specify type. Mark script as 'defer'. + (updateContents): If loaded from HTTP, look for status in same + place as widget. + (gotContents): Use DOM methods to change text rather than innerHTML. + (<body>): Eliminate unnecessary DIV element. + * GCC_Regression_Tester.wdgt/Info.plist: Update version, copyright + notice. + +2006-09-05 Geoffrey Keating <geoffk@apple.com> + + * btest-gcc.sh: .bad_compare has moved to toplevel from gcc/. + +2006-01-18 Andrew Pinski <pinskia@physics.uc.edu> + + * btest-gcc.sh: gcc.sum has moved to gcc/testsuite/gcc/gcc.sum. + g++.sum has moved to gcc/testsuite/g++/g++.sum. + objc.sum has moved to gcc/testsuite/objc/objc.sum. + +2005-12-20 Geoffrey Keating <geoffk@apple.com> + + * btest-gcc.sh: Support -j option. + +2005-11-28 Geoffrey Keating <geoffk@geoffk.org> + + * GCC Regression Tester.wdgt: Rename to GCC_Regression_Tester.wdgt. + * GCC_Regression_Tester.wdgt/Info.plist + (CFBundleDisplayName): Update for rename. + (CFBundleName): Use shorter name. + (CFBundleVersion): Update to 1.0.1. + (CFBundleShortVersionString): Update to 1.0.1. + (LSHasLocalizedDisplayName): New. + (NSHumanReadableCopyright): New. + * GCC_Regression_Tester.wdgt/de.lproj/InfoPlist.strings: New. + * GCC_Regression_Tester.wdgt/en.lproj/InfoPlist.strings: New. + * GCC_Regression_Tester.wdgt/ja.lproj/InfoPlist.strings: New. + + * GCC_Regression_Tester.wdgt/widget.html: Use max-age=30 + to help out intermediate caches. + +2005-11-23 Geoffrey Keating <geoffk@geoffk.org> + + * GCC Regression Tester.wdgt/widget.html: New file. + * GCC Regression Tester.wdgt/Info.plist: New file. + * GCC Regression Tester.wdgt/Icon.png: New file. + * GCC Regression Tester.wdgt/Default.png: New file. + * README: Describe new files. + +2005-06-07 Hans-Peter Nilsson <hp@bitrange.com> + + * btest-gcc.sh: Add support for option + --add-passes-despite-regression. + +2005-06-06 Hans-Peter Nilsson <hp@axis.com> + + * btest-gcc.sh <Build>: Don't pass --with-newlib when target is + "*-linux*". + + * btest-gcc.sh (TESTLOGS): Make libstdc++.sum optional. + +2004-11-07 James A. Morrison <phython@gcc.gnu.org> + + * README: Update website URL. + +2004-10-27 Geoffrey Keating <geoffk@apple.com> + + * btest-gcc.sh (TESTLOGS): The libstdc++-v3 test log is called + libstd++.sum not libstdc++-v3.sum. + +2004-10-26 Geoffrey Keating <geoffk@apple.com> + + * btest-gcc.sh (TESTLOGS): Examine regressions in libstdc++, + libffi, and libjava. + +2004-05-13 Andrew Pinski <pinskia@physics.uc.edu> + + * btest-gcc.sh: Remove g77.sum from TESTLOGS. + +2003-09-18 Andreas Tobler <a.tobler@schweiz.ch> + + * btest-gcc.sh: Add make check-target-libffi. + +2003-07-31 Andreas Tobler <a.tobler@schweiz.ch> + + * btest-gcc.sh: Add make check-target-libjava. + +2002-10-22 Geoffrey Keating <geoffk@apple.com> + + * btest-gcc.sh: Add gdb.sum to TESTLOGS only when GDB testsuite is run. + +2002-10-11 Geoffrey Keating <geoffk@apple.com> + + * objs-gcc.sh: Don't install GDB testsuite if GDB was not built. + * btest-gcc.sh: Don't run GDB testsuite if it doesn't exist. + +2002-10-09 Phil Edwards <pme@gcc.gnu.org> + + * btest-gcc.sh, objs-gcc.sh: Update TARGET comments. + +2002-10-09 Geoffrey Keating <geoffk@apple.com> + + * objs-gcc.sh: On (non-linux) native hosts, use 'make bootstrap'. + +2002-03-09 Geoffrey Keating <geoffk@redhat.com> + + * btest-gcc.sh: For crosses, assume newlib and GNU binutils. + * site.exp: Correct mips-elf triplet. + +2002-01-31 Geoffrey Keating <geoffk@redhat.com> + + * btest-gcc.sh: New file. + * objs-gcc.sh: New file. + * site.exp: New file. + * ChangeLog: New file. + * README: New file. diff --git a/contrib/regression/GCC_Regression_Tester.wdgt/Default.png b/contrib/regression/GCC_Regression_Tester.wdgt/Default.png Binary files differnew file mode 100644 index 000000000..a6dfd4655 --- /dev/null +++ b/contrib/regression/GCC_Regression_Tester.wdgt/Default.png diff --git a/contrib/regression/GCC_Regression_Tester.wdgt/Icon.png b/contrib/regression/GCC_Regression_Tester.wdgt/Icon.png Binary files differnew file mode 100644 index 000000000..662b5169d --- /dev/null +++ b/contrib/regression/GCC_Regression_Tester.wdgt/Icon.png diff --git a/contrib/regression/GCC_Regression_Tester.wdgt/Info.plist b/contrib/regression/GCC_Regression_Tester.wdgt/Info.plist new file mode 100644 index 000000000..a011e69a3 --- /dev/null +++ b/contrib/regression/GCC_Regression_Tester.wdgt/Info.plist @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>AllowNetworkAccess</key> + <true/> + <key>CFBundleDisplayName</key> + <string>GCC_Regression_Tester</string> + <key>CFBundleIdentifier</key> + <string>org.geoffk.widget.regress</string> + <key>CFBundleName</key> + <string>GCC Regr. Tester</string> + <key>CFBundleShortVersionString</key> + <string>1.0.2</string> + <key>CFBundleVersion</key> + <string>1.0.2</string> + <key>CloseBoxInsetX</key> + <integer>0</integer> + <key>CloseBoxInsetY</key> + <integer>0</integer> + <key>Height</key> + <integer>192</integer> + <key>LSHasLocalizedDisplayName</key> + <true/> + <key>MainHTML</key> + <string>widget.html</string> + <key>NSHumanReadableCopyright</key> + <string>Copyright © 2005, 2007 Free Software Foundation, Inc.</string> + <key>Width</key> + <integer>261</integer> +</dict> +</plist> diff --git a/contrib/regression/GCC_Regression_Tester.wdgt/de.lproj/InfoPlist.strings b/contrib/regression/GCC_Regression_Tester.wdgt/de.lproj/InfoPlist.strings Binary files differnew file mode 100644 index 000000000..7692ed523 --- /dev/null +++ b/contrib/regression/GCC_Regression_Tester.wdgt/de.lproj/InfoPlist.strings diff --git a/contrib/regression/GCC_Regression_Tester.wdgt/en.lproj/InfoPlist.strings b/contrib/regression/GCC_Regression_Tester.wdgt/en.lproj/InfoPlist.strings Binary files differnew file mode 100644 index 000000000..45628a3ef --- /dev/null +++ b/contrib/regression/GCC_Regression_Tester.wdgt/en.lproj/InfoPlist.strings diff --git a/contrib/regression/GCC_Regression_Tester.wdgt/ja.lproj/InfoPlist.strings b/contrib/regression/GCC_Regression_Tester.wdgt/ja.lproj/InfoPlist.strings Binary files differnew file mode 100644 index 000000000..f3110f3e8 --- /dev/null +++ b/contrib/regression/GCC_Regression_Tester.wdgt/ja.lproj/InfoPlist.strings diff --git a/contrib/regression/GCC_Regression_Tester.wdgt/widget.html b/contrib/regression/GCC_Regression_Tester.wdgt/widget.html new file mode 100644 index 000000000..ec24fb54a --- /dev/null +++ b/contrib/regression/GCC_Regression_Tester.wdgt/widget.html @@ -0,0 +1,152 @@ +<!-- Get and update the GCC regression tester's web page. + Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +<http://www.gnu.org/licenses/>. --> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd"> +<head> +<meta http-equiv="Content-Script-Type" content="text/javascript"> +<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> +<title>Regression Tester Status</title> +<style type='text/css'> +body { + margin: 0px; + padding: 0px; +} +pre { + font-family: Monaco; + font-size: 9px; + margin: 0px; + padding: 1px 2px 1px 2px; + color: black; + background-color: white; + opacity: 0.8; +} +</style> +<script type='text/javascript' defer> +// A string representing NUM, with a leading zero if it would be 1 digit long +function dig2 (num) +{ + var result = num.toString(); + if (result.length == 1) + return '0' + result; + else + return result; +} + +// Get DATE as a string in standard ISO format in UTC +function getISO (date) +{ + return (date.getUTCFullYear().toString() + '-' + + dig2 (date.getUTCMonth() + 1) + '-' + + dig2 (date.getUTCDate()) + 'T' + + dig2 (date.getUTCHours()) + ':' + + dig2 (date.getUTCMinutes()) + 'Z'); +} + +// STR is a bunch of lines of the form '<key>: <date>' where <date> is in +// standard ISO UTC format. Return a Date object corresponding to KEY, or null +// if none is found. +function fromISO (str, key) +{ + var rx = new RegExp (key + ": (\\d+)-(\\d+)-(\\d+)T(\\d+):(\\d+):(\\d+)Z"); + var match = rx.exec (str); + if (match == null || match.length != 7) + return null; + var date = new Date(0); + date.setUTCFullYear (match[1], match[2] - 1, match[3]); + date.setUTCHours (match[4], match[5], match[6], 0); + return date; +} + +// Update the data +function updateContents () { + var url = 'http://gcc.gnu.org/regtest/HEAD/status.txt'; + if (document.URL && document.URL.substring (0,5) == 'http:') { + url = document.URL.replace ('widget.html','status.txt'); + } + var xml_request = new XMLHttpRequest(); + + xml_request.onload = function(e) + { + gotContents(e, xml_request); + } + xml_request.open("GET", url); + xml_request.setRequestHeader("Cache-Control", "max-age=30"); + xml_request.send(null); +} + +function gotContents (event, request) { + if (request.status != 200) + return; + + if (! request.responseText) + return; + + var txt = request.responseText; + var today = new Date(); + var date_r = fromISO (txt, "Date"); + var completed_r = fromISO (txt, "Test-Completed"); + var now_test_r = fromISO (txt, "Now-Testing"); + var eta = ""; + + if (date_r != null && completed_r != null && now_test_r != null) + { + var eta_r = new Date (now_test_r.getTime() + + completed_r.getTime() - date_r.getTime()); + eta = "ETA: " + getISO (eta_r) + '\n'; + } + + var val = txt + "Now: " + getISO (today) + '\n' + eta; + var contEl = document.getElementById ("contents"); + contEl.removeChild(contEl.firstChild); + contEl.appendChild (document.createTextNode (val)); +} + +var mainTimer = null; + +function myOnShow () +{ + if (! mainTimer) { + mainTimer = setInterval (updateContents, 60000); + } + updateContents(); +} + +function myOnHide () +{ + if (mainTimer) { + clearInterval (mainTimer); + mainTimer = null; + } +} + +function myOnLoad () +{ + if ( window.widget ) { + widget.onshow = myOnShow; + widget.onhide = myOnHide; + } + myOnShow(); +} +</script> +</head> + +<body onLoad='myOnLoad();'> +<pre id="contents">Loading...</pre> +</body> +</html> diff --git a/contrib/regression/README b/contrib/regression/README new file mode 100644 index 000000000..9e94e5c39 --- /dev/null +++ b/contrib/regression/README @@ -0,0 +1,24 @@ +This directory contains scripts that are used by the regression +tester, <http://gcc.gnu.org/regtest/> + +The primary script is 'btest-gcc.sh'. This is the script that is run +to actually test the compiler. + +'objs-gcc.sh' takes a combined tree and builds (but does not test) the +tools required for 'btest-gcc.sh'. It is run periodically to update +the tools. This script is followed by running 'btest-gcc.sh' using +the newly-build tools to check that they will not cause regressions. + +'site.exp' is what $DEJAGNU points to when the regression tester runs +these scripts. + +'GCC_Regression_Tester.wdgt' is a Dashboard widget that displays the +current state of the tester using Javascript. You can use it without +needing Dashboard by pointing your web browser at +'GCC_Regression_Tester.wdgt/widget.html', if your browser supports +and permits it. + +Note that any changes made here need to be approved by the regression +tester's maintainer (see MAINTAINERS). The changes will be used on +the tester's next run, so `experimental' changes are very strongly +discouraged :-). diff --git a/contrib/regression/btest-gcc.sh b/contrib/regression/btest-gcc.sh new file mode 100755 index 000000000..28985760d --- /dev/null +++ b/contrib/regression/btest-gcc.sh @@ -0,0 +1,234 @@ +#!/bin/sh + +# Test GCC. +# Copyright (C) 1999, 2000, 2001, 2002, 2005, 2006, 2009 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +# INPUT: +# btest <options> <target> <source> <prefix> <state> <build> + +add_passes_despite_regression=0 +dashj='' + +# <options> can be +# --add-passes-despite-regression: +# Add new "PASSes" despite there being some regressions. +# -j<n>: +# Pass '-j<n>' to make. + +case "$1" in + --add-passes-despite-regression) + add_passes_despite_regression=1; shift;; + -j*) + dashj=$1; shift;; + -*) echo "Invalid option: $1"; exit 2;; +esac + +# TARGET is the target triplet. It should be the same one as used in +# constructing PREFIX. Or it can be the keyword 'native', indicating +# a target of whatever platform the script is running on. +TARGET=$1 +# SOURCE is the directory containing the toplevel configure. +SOURCE=$2 + +# PREFIX is the directory for the --prefix option to configure. +# For cross compilers, it needs to contain header files, +# libraries, and binutils. PATH should probably include +# $PREFIX/bin. +PREFIX=$3 +# This script also needs to include the GDB testsuite in +# $PREFIX/share/gdb-testsuite. +GDB_TESTSUITE=$PREFIX/share/gdb-testsuite + +# STATE is where the tester maintains its internal state, +# described below. +STATE=$4 + +# BUILD is a temporary directory that this script will +# delete and recreate, containing the build tree. +BUILD=$5 + +# you also probably need to set these variables: +# PATH: should contain a native gcc, and a cross gdb. +# DEJAGNU: should point to a site.exp suitable for testing +# the compiler and debugger. + + +# OUTPUT: in $RESULT, one of the following keywords: +# error the script failed due to +# a misconfiguration or resource limitation +# build the build failed +# regress-<n> the build succeeded, but there were <n> +# testsuite regressions, listed in $REGRESS +# pass build succeeded and there were no regressions +RESULT=$STATE/RESULT +# in BUILD_LOG, the output of the build +BUILD_LOG=$STATE/build_log +# in FAILED, a list of failing testcases +FAILED=$STATE/failed +# in PASSES, the list of testcases we expect to pass +PASSES=$STATE/passes +# in REGRESS, a list of testcases we expected to pass but that failed +REGRESS=$STATE/regress + +# Make sure various files exist. +[ -d $STATE ] || mkdir $STATE +[ -f $PASSES ] || touch $PASSES + +# These lines should stay in this order, because +# that way if something is badly wrong and $RESULT can't +# be modified then cron will mail the error message. +# The reverse order could lead to the testsuite claiming that +# everything always passes, without running any tests. +echo error > $RESULT || exit 1 +exec > $BUILD_LOG 2>&1 || exit 1 + +set -x + +# Nuke $BUILD and recreate it. +rm -rf $BUILD $REGRESS $FAILED +mkdir $BUILD || exit 1 +cd $BUILD || exit 1 + +H_BUILD=`$SOURCE/config.guess || exit 1` +H_HOST=$H_BUILD +if [ $TARGET = native ] ; then + H_TARGET=$H_HOST +else + H_TARGET=$TARGET +fi +H_REAL_TARGET=`$SOURCE/config.sub $H_TARGET || exit 1` + +# TESTLOGS is the list of dejagnu .sum files that the tester should +# look at. +TESTLOGS="gcc/testsuite/gcc/gcc.sum +gcc/testsuite/g++/g++.sum +gcc/testsuite/gfortran/gfortran.sum +gcc/testsuite/objc/objc.sum" + +# Build. +echo build > $RESULT +if [ $H_HOST = $H_TARGET ] ; then + $SOURCE/configure --prefix=$PREFIX --target=$H_TARGET || exit 1 + if ! make $dashj bootstrap ; then + [ -s .bad_compare ] || exit 1 + cat .bad_compare >> $REGRESS || exit 1 + touch compare || exit 1 # Prevent the comparison from running again + make $dashj all || exit 1 + fi +else + withopt="--with-gnu-ld --with-gnu-as" + case "$H_TARGET" in + *-linux*) ;; + *) withopt="$withopt --with-newlib";; + esac + $SOURCE/configure --prefix=$PREFIX --target=$H_TARGET $withopt || exit 1 + make $dashj || exit 1 +fi +echo error > $RESULT || exit 1 + +# Test GCC against its internal testsuite. +make $dashj -k check + +if [ -f $BUILD/$H_TARGET/libstdc++-v3/testsuite/libstdc++.sum ] ; then + TESTLOGS="$TESTLOGS $H_TARGET/libstdc++-v3/testsuite/libstdc++.sum" +fi + +if [ -f $BUILD/$H_TARGET/libffi/testsuite/libffi.sum ] ; then + TESTLOGS="$TESTLOGS $H_TARGET/libffi/testsuite/libffi.sum" +fi + +if [ -f $BUILD/$H_TARGET/libjava/testsuite/libjava.sum ] ; then + TESTLOGS="$TESTLOGS $H_TARGET/libjava/testsuite/libjava.sum" +fi + +if [ -f $BUILD/$H_TARGET/libgomp/testsuite/libgomp.sum ] ; then + TESTLOGS="$TESTLOGS $H_TARGET/libgomp/testsuite/libgomp.sum" +fi + +# Test the just-built GCC with the GDB testsuite. +if [ -d $GDB_TESTSUITE ] ; then + mkdir test-gdb || exit 1 + cd $GDB_TESTSUITE || exit 1 + for i in gdb.* ; do + if [ -d $i ] ; then + mkdir $BUILD/test-gdb/$i + fi + done + cd $BUILD/test-gdb || exit 1 + echo "set host_alias $H_HOST" > site.exp + echo "set host_triplet $H_HOST" >> site.exp + echo "set target_alias $H_TARGET" >> site.exp + echo "set target_triplet $H_REAL_TARGET" >> site.exp + echo "set build_alias $H_BUILD" >> site.exp + echo "set build_triplet $H_BUILD" >> site.exp + echo "set srcdir $GDB_TESTSUITE" >> site.exp + runtest --tool gdb + TESTLOGS="$TESTLOGS test-gdb/gdb.sum" +fi + +# Sanity-check the testlogs. They should contain at least one PASS. +cd $BUILD || exit 1 +for LOG in $TESTLOGS ; do + if ! grep ^PASS: $LOG > /dev/null ; then + echo build > $RESULT + exit 1 + fi +done + +# Work out what failed +for LOG in $TESTLOGS ; do + L=`basename $LOG` + awk '/^FAIL: / { print "'$L'",$2; }' $LOG || exit 1 +done | sort | uniq > $FAILED || exit 1 +comm -12 $FAILED $PASSES >> $REGRESS || exit 1 +NUMREGRESS=`wc -l < $REGRESS | tr -d ' '` + +if [ $NUMREGRESS -eq 0 ] || [ $add_passes_despite_regression -ne 0 ] ; then + # Update the state. + for LOG in $TESTLOGS ; do + L=`basename $LOG` + awk '/^PASS: / { print "'$L'",$2; }' $LOG || exit 1 + done | sort | uniq | comm -23 - $FAILED > ${PASSES}~ || exit 1 + [ -s ${PASSES}~ ] || exit 1 + if [ $NUMREGRESS -ne 0 ] ; then + # The way we keep track of new PASSes when in "regress-N" for + # --add-passes-despite-regression, is to *add* them to previous + # PASSes. Just as without this option, we don't forget *any* PASS + # lines, because besides the ones in $REGRESS that we definitely + # don't want to lose, their removal or rename may have been a + # mistake (as in, the cause of the "regress-N" state). If they + # come back, we then know they're regressions. + cat ${PASSES}~ ${PASSES} | sort -u > ${PASSES}~~ + mv ${PASSES}~~ ${PASSES} || exit 1 + rm ${PASSES}~ || exit 1 + else + # In contrast to the merging for "regress-N", we just overwrite + # the known PASSes when in the "pass" state, so we get rid of + # stale PASS lines for removed, moved or otherwise changed tests + # which may be added back with a different meaning later on. + mv ${PASSES}~ ${PASSES} || exit 1 + fi +fi + +if [ $NUMREGRESS -ne 0 ] ; then + echo regress-$NUMREGRESS > $RESULT + exit 1 +fi + +echo pass > $RESULT +exit 0 diff --git a/contrib/regression/mkindex.pl b/contrib/regression/mkindex.pl new file mode 100755 index 000000000..46e11069f --- /dev/null +++ b/contrib/regression/mkindex.pl @@ -0,0 +1,107 @@ +#!/usr/bin/perl + +# Copy log files from a GCC build for HTTP access. +# Copyright (C) 2008, 2009 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# INPUT: +# mkindex.pl <srcdir> <destdir> <branchname> + +# This script copies log files from a GCC build directory, compresses +# and indexes them for web browser access. It's aimed at having an +# easy-to-access collection of files for analyzing regressions without +# needing to run the build yourself. Binary files (.o, executables) +# are intentionally not included since usually if they are needed it's +# better to just run a build, and because they take up a lot of space. + +# 'srcdir' is the root directory of a GCC build (was $objdir in the build). +# 'destdir' will be erased and replaced with the log files, and should be an +# absolute path. +# 'branchname' is used only to produce the title of the index page, +# which will be named 'index.html'. + +use warnings; +use strict; +use File::Path qw(mkpath rmtree); +use File::Find qw(find); + +if ($#ARGV != 2) { + print "usage: $0 <srcdir> <destdir> <branchname>\n"; + exit 1; +} + +my ($srcdir, $destdir, $branchname) = @ARGV; +die "destdir is not absolute" unless ($destdir =~ m,^/,); + +# Erase the destination. +rmtree $destdir; +mkdir $destdir or die "${destdir}: $!"; + +# Copy and compress the files into the destination, and keep a list in @files. +my @files = (); +sub my_wanted { + # Copy all files ending with .log or .sum. + if (/\.(log|sum)$/ && -f) { + + die unless (substr ($File::Find::dir,0,(length $srcdir)) eq $srcdir); + my $dir = substr $File::Find::dir,(length $srcdir); + $dir = substr $dir,1 unless ($dir eq ''); + my $name = $_; + $name = $dir . '/' . $_ if ($dir ne ''); + + mkpath $destdir . '/' . $dir; + # Compress the files. Use .gzip instead of .gz for the + # extension to avoid (broken) browser workarounds for broken + # web servers. + system ("gzip -c -q -9 $_ > $destdir/${name}.gzip") == 0 or exit 2; + + # Write the (compressed) size consistently in Kbytes. + my $size = -s $destdir .'/' . $name . '.gzip'; + my $printable_size = (sprintf "%.0fK",$size / 1024); + + push @files,[$name.'.gzip',$name,$printable_size]; + } +} +find ({wanted => \&my_wanted}, $srcdir); + +# Sort the list of files for the index. +@files = sort {$a->[1] cmp $b->[1]} @files; + +# Create the index. +open INDEX,'>',$destdir . '/index.html' or die "${destdir}/index.html: $!"; +# Use strict XHTML 1.0, and set charset to UTF-8. +print INDEX <<EOF or die "writing index: $!"; +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>Log files for $branchname</title> + <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> +</head> +<body> +<h1>Log files for $branchname</h1> +<table><tr><th>Name</th><th align='right'>Size</th></tr> +EOF +# The index will have two columns, filename (without .gzip) and +# compressed size. +foreach my $f (@files) { + printf INDEX "<tr><td><a href=\"%s\">%s</a></td><td align=\'right\'>%s</td></tr>\n", + $f->[0], $f->[1], $f->[2] or die "writing index: $!"; +} + +print INDEX "</table></body></html>\n" or die "writing index: $!"; +close INDEX or die "writing index: $!"; +exit 0; diff --git a/contrib/regression/objs-gcc.sh b/contrib/regression/objs-gcc.sh new file mode 100755 index 000000000..60b0497fe --- /dev/null +++ b/contrib/regression/objs-gcc.sh @@ -0,0 +1,128 @@ +#!/bin/sh + +# Build tools for testing GCC. +# Copyright (C) 1999, 2000, 2001, 2002, 2009 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +# INPUT: +# btest <target> <source> <prefix> <state> <build> +# TARGET is the target triplet. It should be the same one as used in +# constructing PREFIX. Or it can be the keyword 'native', indicating +# a target of whatever platform the script is running on. +TARGET=$1 +# SOURCE is the directory containing the toplevel configure. +SOURCE=$2 + +# PREFIX is the directory for the --prefix option to configure. +PREFIX=$3 + +# STATE is where the tester maintains its internal state, +# described below. +STATE=$4 + +# BUILD is a temporary directory that this script will +# delete and recreate, containing the build tree. +BUILD=$5 + +# you also probably need to set these variables: +# DEJAGNU: should point to a site.exp suitable for testing +# the compiler and debugger. + +# OUTPUT: in $RESULT, one of the following keywords: +# error the script failed due to +# a misconfiguration or resource limitation +# build the build failed +# regress-<n> the build succeeded, but there were <n> +# testsuite regressions, listed in $REGRESS +# pass build succeeded and there were no regressions +RESULT=$STATE/RESULT +# in BUILD_LOG, the output of the build +BUILD_LOG=$STATE/build_log +# in FAILED, a list of failing testcases +FAILED=$STATE/failed +# in PASSES, the list of testcases we expect to pass +PASSES=$STATE/passes +# in REGRESS, a list of testcases we expected to pass but that failed +REGRESS=$STATE/regress + +# Make sure various files exist. +[ -d $STATE ] || mkdir $STATE +[ -f $PASSES ] || touch $PASSES + +# These lines should stay in this order, because +# that way if something is badly wrong and $RESULT can't +# be modified then cron will mail the error message. +# The reverse order could lead to the testsuite claiming that +# everything always passes, without running any tests. +echo error > $RESULT || exit 1 +exec > $BUILD_LOG 2>&1 || exit 1 + +set -x + +# TESTLOGS is the list of dejagnu .sum files that the tester should +# look at. +TESTLOGS="test/gcc/gcc.sum +test/g++/g++.sum" + +# Nuke $BUILD and recreate it. +rm -rf $BUILD $REGRESS $FAILED +mkdir $BUILD $BUILD/build $BUILD/objs || exit 1 +cd $BUILD || exit 1 + +# This script used to use config.guess, but that is not how releng +# determines hostnames. +H_BUILD=`$SOURCE/config.guess || exit 1` +H_HOST=$H_BUILD +if [ $TARGET = native ] ; then + H_TARGET=$H_HOST +else + H_TARGET=$TARGET +fi +H_REAL_TARGET=`$SOURCE/config.sub $H_TARGET || exit 1` +H_REAL_BUILD=`$SOURCE/config.sub $H_BUILD || exit 1` +H_REAL_HOST=`$SOURCE/config.sub $H_HOST || exit 1` + +# Build. +echo build > $RESULT + +cd $BUILD/build || exit 1 +TMP_PREFIX=$BUILD/install +$SOURCE/configure --prefix=$PREFIX --target=$H_TARGET || exit 1 +if [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-gnu ] + then + make all-gdb all-dejagnu all-ld || exit 1 + make install-gdb install-dejagnu install-ld || exit 1 +elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then + make bootstrap || exit 1 + make install || exit 1 +else + make || exit 1 + make install || exit 1 +fi + +if [ -x $PREFIX/bin/$TARGET-gdb ] ; then + mkdir -p $PREFIX/share/gdb-testsuite || exit 1 + cd $SOURCE/gdb/testsuite || exit 1 + find . -print | cpio -pdmu $PREFIX/share/gdb-testsuite || exit 1 + # selftest.exp requires keeping old sources around, which is impractical + rm $PREFIX/share/gdb-testsuite/gdb.base/selftest.exp + # these tests seem to be broken and randomly failing + rm -r $PREFIX/share/gdb-testsuite/gdb.mi +fi + +echo pass > $RESULT +exit 0 diff --git a/contrib/regression/site.exp b/contrib/regression/site.exp new file mode 100644 index 000000000..0892afa3a --- /dev/null +++ b/contrib/regression/site.exp @@ -0,0 +1,18 @@ +global target_list + +case "$target_triplet" in { + { "powerpc*-*eabi*" } { +# if { [info exists tool] && $tool == "gcc" } { +# set target_list { "powerpc-sim{,-fpic}" } +# } else { + set target_list { "powerpc-sim" } +# } + } + { "mips*-*-elf" } { + set target_list { "mips-sim" } + } + + default { + set target_list { "unix" } + } +} |