This is the mail archive of the
sid@sources.redhat.com
mailing list for the SID project.
Small PATCH to dejagnu/lib/utils.exp
- To: gdb-patches at sources dot redhat dot com
- Subject: Small PATCH to dejagnu/lib/utils.exp
- From: Jason Merrill <jason_merrill at redhat dot com>
- Date: 17 Jul 2001 16:07:47 +0100
- Cc: sid at sources dot redhat dot com, rob at welcomehome dot org, jason_merrill at redhat dot com
This patch tweaks runtest_file_p so that a user can say
"foo.exp=bar/baz.C"; currently only "foo.exp=baz.C" and
"foo.exp=/full/path/to/bar/baz.C" are accepted. I suppose the user could
provide the initial wildcard themselves, but this seems more friendly.
The patch also corrects the erroneous documentation for the function.
OK to apply? Anyone?
2001-07-17 Jason Merrill <jason_merrill@redhat.com>
* lib/utils.exp (runtest_file_p): An argument can match trailing
directories as well as the basename.
*** ./doc/dejagnu.texi.~1~ Tue Nov 9 01:28:42 1999
--- ./doc/dejagnu.texi Tue Jul 17 15:57:12 2001
*************** otherwise it returns @code{NULL}.
*** 2181,2190 ****
@cindex selecting a range of tests
@cindex tests, running specifically
Search @var{runtests} for @var{testcase} and return 1 if found, 0 if not.
! @var{runtests} is a list of two elements. The first is the pathname of
! the testsuite expect script running. The second is a copy of what was
on the right side of the @code{=} if @samp{foo.exp="@dots{}"} was specified,
! or an empty string if no such argument is present.
This is used by tools like compilers where each testcase is a file.
@item prune_system_crud @var{system} @var{text}
--- 2181,2190 ----
@cindex selecting a range of tests
@cindex tests, running specifically
Search @var{runtests} for @var{testcase} and return 1 if found, 0 if not.
! @var{runtests} is a list of two elements. The first is a copy of what was
on the right side of the @code{=} if @samp{foo.exp="@dots{}"} was specified,
! or an empty string if no such argument is present. The second is the
! pathname of the current testcase under consideration.
This is used by tools like compilers where each testcase is a file.
@item prune_system_crud @var{system} @var{text}
*** ./doc/ref.sgml.~1~ Tue Nov 9 01:28:42 1999
--- ./doc/ref.sgml Tue Jul 17 15:56:49 2001
***************
*** 3458,3468 ****
<para>Search <emphasis>runtest</emphasis>s for
<emphasis>testcase</emphasis> and return <emphasis>1</emphasis> if
found, <emphasis>0</emphasis> if not. <emphasis>runtests</emphasis>
! is a list of two elements. The first is the pathname of the
! testsuite expect script running. The second is a copy of what was on
the right side of the <emphasis>=</emphasis> if
<programlisting>foo.exp="..."</programlisting>" was specified, or
! an empty string if no such argument is present. This is used by tools
like compilers where each testcase is a file.</para>
<funcsynopsis role="tcl">
--- 3458,3469 ----
<para>Search <emphasis>runtest</emphasis>s for
<emphasis>testcase</emphasis> and return <emphasis>1</emphasis> if
found, <emphasis>0</emphasis> if not. <emphasis>runtests</emphasis>
! is a list of two elements. The first is a copy of what was on
the right side of the <emphasis>=</emphasis> if
<programlisting>foo.exp="..."</programlisting>" was specified, or
! an empty string if no such argument is present. The second is the
! pathname of the current testcase under consideration.
! This is used by tools
like compilers where each testcase is a file.</para>
<funcsynopsis role="tcl">
***************
*** 3473,3480 ****
<variablelist>
<varlistentry>
<term><parameter>runtests</parameter></term>
! <listitem><para>The pathname of the testsuite expect script
! running</para></listitem>
</varlistentry>
<varlistentry>
<term><parameter>testcase</parameter></term>
--- 3474,3481 ----
<variablelist>
<varlistentry>
<term><parameter>runtests</parameter></term>
! <listitem><para>The list of patterns to compare against.
! </para></listitem>
</varlistentry>
<varlistentry>
<term><parameter>testcase</parameter></term>
*** ./lib/utils.exp.~1~ Tue Aug 8 23:09:44 2000
--- ./lib/utils.exp Tue Jul 17 11:34:41 2001
*************** proc psource { file } {
*** 308,320 ****
# file names (ie: the "foo" in make check RUNTESTFLAGS="bar.exp=foo").
# "glob" style expressions are supported as well as multiple files (with
# spaces between them).
! # Eg: RUNTESTFLAGS="bar.exp=foo1.c foo2.c foo3*.c bar*.c"
#
proc runtest_file_p { runtests testcase } {
if [string length [lindex $runtests 1]] {
- set basename [file tail $testcase]
foreach ptn [lindex $runtests 1] {
! if [string match $ptn $basename] {
return 1
}
if [string match $ptn $testcase] {
--- 308,319 ----
# file names (ie: the "foo" in make check RUNTESTFLAGS="bar.exp=foo").
# "glob" style expressions are supported as well as multiple files (with
# spaces between them).
! # Eg: RUNTESTFLAGS="bar.exp=foo1.c foo2.c foo3*.c bar/baz*.c"
#
proc runtest_file_p { runtests testcase } {
if [string length [lindex $runtests 1]] {
foreach ptn [lindex $runtests 1] {
! if [string match "*/$ptn" $testcase] {
return 1
}
if [string match $ptn $testcase] {