Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [Commit] testsuite/gdb.pascal
@ 2009-02-18 18:44 Pierre Muller
  2009-02-18 18:46 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Pierre Muller @ 2009-02-18 18:44 UTC (permalink / raw)
  To: gdb-patches; +Cc: 'Tom Tromey'

  Thanks to the GCC  Compile Farm account that I just
got I was able to check pascal tests on amd64,
and immediately found some errors in the testsuite.

  Committed as pascal language maintainer.

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

Pierre Muller
Pascal language support maintainer for GDB




ChangeLog Entry:
2009-02-18  Pierre Muller  <muller@ics.u-strasbg.fr>

       * gdb.pascal/floats.exp: Accept approximate results everywhere.


Index: gdb.pascal/floats.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.pascal/floats.exp,v
retrieving revision 1.2
diff -u -p -r1.2 floats.exp
--- gdb.pascal/floats.exp       3 Jan 2009 05:58:06 -0000       1.2
+++ gdb.pascal/floats.exp       18 Feb 2009 14:26:36 -0000
@@ -76,10 +76,10 @@ gdb_test "print r + t" " = -1\\.9(499.*|
 #Test addition with float constants
 gdb_test "print r + 1.5" " = 2\\.7(499.*|5|500.*)"
 gdb_test "print r + 0.03" " = 1\\.2(799.*|8|800.*)"
-gdb_test "print r + (-0.2)" " = 1\\.0(499|5|500.*)"
+gdb_test "print r + (-0.2)" " = 1\\.0(499.*|5|500.*)"
 gdb_test "print r + 1.5E+3" " = 1501\\.2(499.*|5|500.*)"
 gdb_test "print r + 1.5E+2" " = 151\\.2(499.*|5|500.*)"
-gdb_test "print r + 1.5E+1" " = 16\\.2(499|5|500.*)"
+gdb_test "print r + 1.5E+1" " = 16\\.2(499.*|5|500.*)"
 gdb_test "print r + 1.5E+0" " = 2\\.7(499.*|5|500.*)"
 gdb_test "print r + 1.5E-1" " = 1\\.(399.*|4|400.*)"
 gdb_test "print r + 1.5E-2" " = 1\\.26(499.*|5|500.*)"
@@ -93,7 +93,7 @@ gdb_test "print l + t" " = -2\\.(199.*|2
 gdb_test "print r + 10" " = 11\\.2(499.*|5|500.*)"
 gdb_test "print r + 5" " = 6\\.2(499.*|5|500.*)"
 gdb_test "print r + 1" " = 2\\.2(499.*|5|500.*)"
-gdb_test "print r + 0" " = 1\\.2(499|5|500.*)"
+gdb_test "print r + 0" " = 1\\.2(499.*|5|500.*)"
 gdb_test "print r + (-1)" " = 0\\.2(499.*|5|500.*)"
 gdb_test "print r + (-5)" " = -3\\.7(499.*|5|500.*)"
 gdb_test "print r + (-10)" " = -8\\.7(499.*|5|500.*)"
@@ -120,7 +120,7 @@ gdb_test "print 35 / 2" " = 17\\.(499.*|
 # 'set r' does not work, as there are set sub-commands starting with 'r'
 # Thus we need to use 'set var r'
 gdb_test "set var r := 2.56" " := 2\\.56"
-gdb_test "print r" " = 2\\.56.*" "Testing new r value"
+gdb_test "print r" " = 2\\.5(599.*|6|600.*)" "Testing new r value"

 gdb_test "cont" \
         "Breakpoint .*:${bp_location2}.*" \


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Commit] testsuite/gdb.pascal
  2009-02-18 18:44 [Commit] testsuite/gdb.pascal Pierre Muller
@ 2009-02-18 18:46 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2009-02-18 18:46 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

[-- 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-02-18 17:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-18 18:44 [Commit] testsuite/gdb.pascal Pierre Muller
2009-02-18 18:46 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox