This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: DejaGnu PATCH to lib/dg.exp: enhance support for "exotic" dir-names


Gabriel Dos Reis wrote:
> 
> I'm sending this patch to gdb-patches@sources.redhat.com since the
> "official" site (according to src/MAINTAINERS)
> 
>         http://dejagnu.sourceforge.net/
> 
> is down.
> 
> While developping a new style DejaGnu-based testsuite framework for
> libstdc++-v3, I came across the fact that dg.exp is unable to properly
> handle directory-names which contain characters having special meaning
> for Tcl regexp machinery.  The patch below is intended to overcome
> that problem.  It is working for me.  Is it OK? If so please install
> it.  If not, please let me know as soon as possible.
> 

We only maintain a local copy of dejagnu, which is used by GDB and SID,
two Open Source projects that use it for testing.

We certainly can incorporate you patch after we are able to ascertain
that 
it does not cause any breakage in our own use of dejagnu.  Your patch
does 
look right (this happens after the globbing, right?), but I can't take
no
chances.

I wonder if this will actually be of any help to you.  It all depends
where
(in which repository) your libstdc++-v3 testsuite will reside and from
where
the dejagnu will come from.  This would be the place where you would
need to
get your changes in for sure.

To avoid seeing it disappearing with a future merge with the so called
"official"
dejagnu site, you should insist that your patch is incorporated there as
well.
I seem to have the impression that things that get in our sources end up
there
somehow (a reverse merge?), but I am not absolutely sure.

I added your patch to my TODO list (a long one).
We don't currently seem to need it as we don't use funny directory names
though.
So, I can't promise you a high priority -- sorry!

Someone from SID would also have to look at it as we are sharing the
repository.

But, again, this will not solve your problem unless this is the dejagnu
you will use.



> Best,
> 
> -- Gaby
> CodeSourcery, LLC            http://www.codesourcery.com
>      http://www.codesourcery.com/gcc-compile.shtml
> 
> Index: ChangeLog
> ===================================================================
> RCS file: /cvs/src/src/dejagnu/ChangeLog,v
> retrieving revision 1.26
> diff -p -r1.26 ChangeLog
> *** ChangeLog   2001/01/15 04:09:15     1.26
> --- ChangeLog   2001/01/18 22:34:28
> ***************
> *** 1,3 ****
> --- 1,8 ----
> + 2001-01-18  Gabriel Dos Reis  <gdr@codesourcery.com>
> +
> +       * lib/dg.exp (dg-trim-dirname): New function.
> +       (dg-test): Use it to rip directory-name out of file name.
> +
>   2001-01-15  Ben Elliston  <bje@redhat.com>
> 
>         * lib/framework.exp (record_test): Invoke a user-defined procedure
> Index: lib/dg.exp
> ===================================================================
> RCS file: /cvs/src/src/dejagnu/lib/dg.exp,v
> retrieving revision 1.1.1.1
> diff -p -r1.1.1.1 dg.exp
> *** dg.exp      1999/11/09 01:28:42     1.1.1.1
> --- dg.exp      2001/01/18 22:34:29
> *************** proc dg-runtest { testcases flags defaul
> *** 586,591 ****
> --- 586,604 ----
>       }
>   }
> 
> + # dg-trim-dirname -- rip DIR_NAME out of FILE_NAME
> + #
> + # Syntax: dg-trim-dirname dir_name file_name
> + # We need to go through this contorsion in order to properly support
> + # directory-names which might have embedded regexp special characters.
> +
> + proc dg-trim-dirname { dir_name file_name } {
> +     set special_character "\[\?\+\-\*\.\$\|\(\)\]"
> +     regsub -all $special_character $dir_name "\\\\&" dir_name
> +     regsub "^$dir_name/?" $file_name "" file_name
> +     return $file_name
> + }
> +
>   # dg-test -- runs a new style DejaGnu test
>   #
>   # Syntax: dg-test [-keep-output] prog tool_flags default_extra_tool_flags
> *************** proc dg-test { args } {
> *** 631,637 ****
> 
>       set text "\[- A-Za-z0-9\.\;\"\_\:\'\`\(\)\!\#\=\+\?\&\*]*"
> 
> !     regsub "^$srcdir/?" $prog "" name
>       # If we couldn't rip $srcdir out of `prog' then just do the best we can.
>       # The point is to reduce the unnecessary noise in the logs.  Don't strip
>       # out too much because different testcases with the same name can confuse
> --- 644,650 ----
> 
>       set text "\[- A-Za-z0-9\.\;\"\_\:\'\`\(\)\!\#\=\+\?\&\*]*"
> 
> !     set name [dg-trim-dirname $srcdir $prog]
>       # If we couldn't rip $srcdir out of `prog' then just do the best we can.
>       # The point is to reduce the unnecessary noise in the logs.  Don't strip
>       # out too much because different testcases with the same name can confuse

-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]