dejagnu
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: # XXX not the right thing to do.


From: Dave Korn
Subject: Re: # XXX not the right thing to do.
Date: Tue, 15 Mar 2011 20:40:50 +0000
User-agent: Thunderbird 2.0.0.17 (Windows/20080914)

On 15/03/2011 03:40, Ben Elliston wrote:
> Hi Dave
> 
> On Sat, Apr 22, 2006 at 06:52:23PM +0100, Dave Korn wrote:
> 
>>     Hello whoever's still out here,
> 
> I hope you're still out there. :-)

  Heh yeah, but I certainly had to refresh my memory of what it was about.

>> ./gcc.dg/dg.exp=\"builtin*.c W*.c\"

> So what you're trying to do is run a set of tests that cannot be
> lumped together with a single wildcard, is that right?

  Well, that was the general idea, but looking back at it, I think probably
what triggered the problem was that I was using a path fragment to the exp
file instead of just plain

>> dg.exp=\"builtin*.c W*.c\"

  I'm not 100% certain I've understood this code right, without having done
any testruns and ploughed through the debug (so far this time round; I must
have been doing it last time), but it looks to me like that during normal
usage, this hunk:

verbose "Top level testsuite dirs are ${test_top_dirs}" 2
set testlist "";
if [info exists all_runtests] {
    foreach x [array names all_runtests] {
        verbose "trying to glob ${srcdir}/${x}" 2
        set s [glob -nocomplain ${srcdir}/$x];
        if { $s != "" } {
            set testlist [concat $testlist $s];
        }
    }
}

sets testlist to the names of any .exp file options passed on the command line
that can be found in the top-level $srcdir, and that if that list is
non-empty, this clause triggers:

#
# If we have a list of tests, run all of them.
#
if { $testlist != "" } {
    foreach test_name $testlist {
        if { ${ignoretests} != "" } {
            if { 0 <= [lsearch ${ignoretests} [file tail ${test_name}]]} {
                continue
            }
        }

        # set subdir to the tail of the dirname after $srcdir,
        # for the driver files that want it.  XXX this is silly.
        # drivers should get a single var, not "$srcdir/$subdir"
        set subdir [file dirname $test_name]
        set p [expr [string length $srcdir]-1]
        while {0 < $p && [string index $srcdir $p] == "/"} {
            incr p -1
        }
        if {[string range $subdir 0 $p] == $srcdir} {
            set subdir [string range $subdir [expr $p+1] end];
            regsub "^/" $subdir "" subdir
        }

        # XXX not the right thing to do.
        set runtests [list [file tail $test_name] ""]

        runtest $test_name;
    }

which runs the tests without passing to runtests() any of the patterns that
are stored per .exp filename in the $all_runtests hash. Only if the testlist
loop matches nothing - i.e., none of the .exp files specified in the
command-line are actually found - do we enter the second clause, beginning at
"# Go digging for tests", which is the only place where code exists to match
against the pattern (stored in the value part of the name-value pairs in the
$all_runtests hash).

  IOW, if I've got this right, in our normal mode of operation (in the GCC
and binutils testsuites), where we would usually write something like
RUNTESTFLAGS="dg.exp=pr*.c" or whatever, it only works because there isn't
actually a dg.exp file in the top-level $srcdir, so no match is found, so
$testlist is empty, so we run through the "go digging" code, search the dir
tree for .exp files, match them against the names in $all_runtests and then
apply the pattern filter. If I've read the code right, this ought to already
work even with multiple patterns such as RUNTESTFLAGS="lto.exp='l* p*'".

  That's all fine, but we have more than one dg.exp in the GCC testsuite
(according to language/tool), and I wanted to supply different pattern filters
to different ones.  I naively hoped that specifying a path to the precise
dg.exp would work, and it works in as much as it selects that particular .exp
script to run, but because of the unimplemented functionality at "XXX not the
right thing to do", the pattern filters are ignored (even if there's only a
single pattern).

  So, not multiple patterns, just patterns in general in the presence of
explicit paths to .exp files.  I think that's where I was coming from, and
will try a few experiments next time I'm running a testsuite to verify if I've
remembered it right.

    cheers,
      DaveK




reply via email to

[Prev in Thread] Current Thread [Next in Thread]