Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: "Pierre Muller" <muller@ics.u-strasbg.fr>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [Commit] testsuite/gdb.pascal
Date: Wed, 18 Feb 2009 18:46:00 -0000	[thread overview]
Message-ID: <m363j71wfa.fsf@fleche.redhat.com> (raw)
In-Reply-To: <001601c991d7$bc899860$359cc920$@u-strasbg.fr> (Pierre Muller's message of "Wed\, 18 Feb 2009 15\:46\:52 +0100")

[-- Attachment #1: Type: text/plain, Size: 2559 bytes --]

>>>>> "Pierre" == Pierre Muller <muller@ics.u-strasbg.fr> writes:

Pierre> PS: Tom, could you help me out with the 
Pierre> patch tester scripts?

Sorry about that -- I saw your ping on irc, but then forgot to send
you a follow-up email.

I use the two attached scripts to regression test patches.

The tester requires that you use archer git.  That is because git
provides a way to select the proper baseline revision for a patch.  It
might be possible to make it work with CVS... I don't plan to do that
but if you want to figure something out, I'll assist if I can.  If you
need the actual tester script to do this I can email that to you (or
you can see it in ~tromey on gcc11).

The first script makes a patch in a format that the tester
understands.  This format is just an ordinary git diff with a short
header describing the baseline revision, where to send email, etc.
You can run this anywhere in your git tree.  You can supply some
options to change how the tester configures and builds gdb; you can
also change this by editing the patch header before submission.  The
default is to configure with --enable-targets=all, and build with -j6.

The second script uploads a patch to the patch tester.  It is
basically a fancy "scp".

My typical pattern is to check out archer's "master" branch (which is
frequently synced with gdb cvs) and write a patch.  I test it locally,
write new tests, etc.  Then I "mkdiff > /tmp/whatever.diff" and
"submit-patch /tmp/whatever.diff".  Then when the patch is approved, I
apply it to gdb cvs for committing.

Once you've uploaded a patch, you'll get an email when the tester
starts work on it.  Then you'll get another message when the test is
done.  Occasionally I have noticed that this second email gets wedged;
I don't know why.  If that happens, let me know, or you can log in and
dig through ~tromey/auto-test-gdb to find the results.

I've noticed that the results comparison script fails to notice if you
introduce new FAILs.  It doesn't consider those as failures.  If
anybody has a bulletproof test result comparison script, I'm
interested.

I periodically go through the old test results and delete them by
hand.  I probably ought to automate this.

The gdb test suite itself is a bit noisy.  There are a few tests that
randomly fail.  So, the tester may report some errors which you can
ignore -- if you resubmit the patch, they will go away.  For example,
this is a common false negative:

    gdb.sum gdb.threads/schedlock.exp: other threads ran - unlocked

Let me know if you have any trouble.

Tom


[-- Attachment #2: mkdiff --]
[-- Type: application/octet-stream, Size: 4326 bytes --]

#!/bin/sh

# Copyright (C) 2003, 2008 Free Software Foundation

# This script is Free Software, and it can be copied, distributed and
# modified as defined in the GNU General Public License.  A copy of
# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html

# Written by Tom Tromey <tromey@redhat.com>

# mkdiff version 2.0

# Usage: mkdiff [OPTION]... [FILE]...
# Make a patch suitable for submission to the GCC patch tester.
# The diff is made relative to the top of the tree, but the FILE
# options are relative the working directory, so this can be invoked
# exactly as one would invoke "svn diff" or "git diff", depending on
# the working tree.

#   --email=ADDR      email address to use (default currentuser@gcc.gnu.org)
#   --branch=BRANCH   branch to use (default from working directory)
#   --revision=REV    revision to use (default from working directory)
#   --config=OPTSTR   set configure options (default none)
#   --make=OPTSTR     set make options (default none)
#   --check=OPTSTR    set check options (default none)

#   --help            print this help, then exit
#   --version         print version number, then exit

# Unrecognized options are assumed to be options to "svn diff"
# or "git diff".

if test -d .svn; then
    vc=svn
elif git status -a > /dev/null 2>&1; then
    vc=git
else
    echo "$name: not in SVN or git-controlled directory" 1>&2
    exit 1
fi

name=mkdiff

diffopts=
email=`id -un`@gcc.gnu.org
branch=
revision=
files=
configopts=
makeopts=
checkopts=

# Parsing loop taken from Alexandre Oliva's cvs scripts.
while test $# -gt 0; do
    case "$1" in
    -v|--version)
	sed '/^# '$name' version / { s/^# //; p; }; d' < $0
	exit 0
	;;
    -\?|-h)
	sed '/^# usage:/ { s/^# //; p; }; d' < $0 &&
	echo
	echo "run \`$name --help | more' for full usage"
	exit 0
	;;
    --help)
	sed '/^# '$name' version /,/^[^#]/ { /^[^#]/ d; s/^# //; p; }; d' < $0
	exit 0
	;;
    --email=*)
        email=`echo "$1" | sed -e 's,--email=,,'`
	;;
    --branch=*)
        branch=`echo "$1" | sed -e 's,--branch=,,'`
	;;
    --revision=*)
        revision=`echo "$1" | sed -e 's,--revision=,,'`
	;;
    --check=*)
        checkopts=`echo "$1" | sed -e 's,--check=,,'`
	;;
    --make=*)
        makeopts=`echo "$1" | sed -e 's,--make=,,'`
	;;
    --config=*)
        configopts=`echo "$1" | sed -e 's,--config=,,'`
	;;
    -*)
	diffopts="$diffopts $1"
	;;
    *)
        files="$files $1"
	;;
    esac
    shift
done

if test $vc = svn; then
    if test -z "$branch"; then
	repo=`svn info | grep '^URL:' | sed -e 's,^URL: ,,'`
	case $repo in
	    */gcc.gnu.org/svn/gcc/trunk*)
		branch=trunk
		;;
	    */gcc.gnu.org/svn/gcc/branches/*)
		branch=`echo $repo | sed 's,.*/branches/\([^/]*\).*$,\1,'`
		;;
	    *)
		echo "$name: unrecognized repository, use --branch: $repo" 1>&2
		exit 1
		;;
	esac
    fi

    if test -z "$revision"; then
	revision=`svn info | grep '^Revision:' | sed -e 's,^Revision: ,,'`
    fi
else
    if test -z "$revision"; then
	revision=`git log | sed -e 's,^commit *,,' -e 1q`
    fi
fi


here=`pwd`
orig=$here
dirname=

cdie() {
    cd $1 || {
	echo "$name: couldn't cd to $1 from `pwd`" 1>&2
	exit 1
    }
}

if test $vc = svn; then
    while test -e ../.svn; do
	cdie ..
	next=`basename "$here"`
	here=`dirname "$here"`
	if test -z "$dirname"; then
	    dirname="$next/"
	else
	    dirname="$next/$dirname"
	fi
    done
    projecttestdir=.
else
    # We want to find the project type, but we don't have to bother
    # with computing the directory properly -- git diff handles this
    # itself.
    save=`pwd`
    while ! test -e .git; do
	cdie ..
    done
    projecttestdir=`pwd`
    cd $save
fi

if test -d $projecttestdir/gcc; then
    projecttype=gcc
elif test -d $projecttestdir/gdb; then
    projecttype=gdb
else
    echo "$name: couldn't determine project type in $projecttestdir" 1>&2
    exit 1
fi

if test -z "$files"; then
    files=.
fi

# We don't use filterdiff -addprefix since that does not seem to
# handle Index: lines.
newfiles=
for file in $files; do
    newfiles="$newfiles $dirname$file"
done

echo "projecttype:$projecttype"
echo "email:$email"
if test $vc = svn; then
    echo "branch:$branch"
fi
echo "revision:$revision"
echo "configure:$configopts"
echo "make:$makeopts"
echo "check:$checkopts"
echo
$vc diff $diffopts $newfiles

[-- Attachment #3: submit-patch --]
[-- Type: application/octet-stream, Size: 2754 bytes --]

#! /bin/sh

# Copyright (C) 2003, 2008 Free Software Foundation

# This script is Free Software, and it can be copied, distributed and
# modified as defined in the GNU General Public License.  A copy of
# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html

# Written by Tom Tromey <tromey@redhat.com>

# submit-patch version 2.0

# Usage: submit-patch [OPTION]... PATCH-FILE [NAME]
# Regression test a GCC patch.

#   --host=HOST       host to use
#   --dir=DIR         directory to use on host

#   --help            print this help, then exit
#   --version         print version number, then exit

# If NAME is not given, the basename of the patch file is used as
# the patch name.
name=submit-patch
repeat="test $# -gt 0"

host=gcc11.fsffrance.org
# This is used to construct the patch dir if --dir is not given.
patchbase=/home/tromey/auto-test-

# Parsing loop taken from Alexandre Oliva's cvs scripts.
while $repeat; do
    case "$1" in
    -v|--version)
	sed '/^# '$name' version / { s/^# //; p; }; d' < $0
	exit 0
	;;
    -\?|-h)
	sed '/^# usage:/ { s/^# //; p; }; d' < $0 &&
	echo
	echo "run \`$name --help | more' for full usage"
	exit 0
	;;
    --help)
	sed '/^# '$name' version /,/^[^#]/ { /^[^#]/ d; s/^# //; p; }; d' < $0
	exit 0
	;;
    --host=*)
        host=`echo "$1" | sed -e 's,--host=,,'`
	shift
	;;
    --dir=*)
        patchdir=`echo "$1" | sed -e 's,--dir=,,'`
	shift
	;;
    --)
	shift
	repeat=false
	;;
    -*)
	echo "$name: unrecognized option '$1'" 1>&2
	echo "$name: Try '$name --help' for more information" 1>&2
	exit 1
	;;
    *)
	repeat=false
	;;
    esac
done

file=$1
shift
if test -z "$file"; then
   (sed '/^# usage:/ { s/^# //; p; }; d' < $0 &&
      echo
      echo "run \`$name --help | more' for full usage") 1>&2
    exit 1
fi

patch=$1
shift
if test -z "$patch"; then
   if test "x$file" = "x-"; then
      echo "$name: NAME argument required if patch is from stdin" 1>&2
      exit 1
   else
      patch=`basename $file`
   fi
fi

if test "x$file" != "x-"; then
    if ! grep -s "^email:" $file > /dev/null; then
	echo "$name: no email: line in $file; did you use mkdiff?" 1>&2
	exit 1
    fi
fi

if test -z "$patchdir"; then
    if test "x$file" = "x-"; then
	echo "$name: --dir required if patch is from stdin" 1>&2
	exit 1
    fi
    project=`sed -n -e 's/^projecttype://p' -e '/^$/q' $file`
    patchdir=$patchbase$project/patches
fi

# Only run filterdiff on a known non-git patch.
filter=cat
if test "x$file" != "x-"; then
    if ! grep -s "diff --git" $file > /dev/null; then
	filter="filterdiff -x '*ChangeLog*'"
    fi
fi

# FIXME: may be nice to auto-start the patch tester.
# Use 'cat' here so we can accept "-".
cat $file | $filter | ssh $host cat '>' $patchdir/`id -un`-$patch

      reply	other threads:[~2009-02-18 17:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-18 18:44 Pierre Muller
2009-02-18 18:46 ` Tom Tromey [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m363j71wfa.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=muller@ics.u-strasbg.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox