Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] new patch: dejagnu runtest.exp redundant testing
@ 2000-08-11 19:29 Jimmy Guo
  2000-08-14 11:09 ` Jimmy Guo
  0 siblings, 1 reply; 2+ messages in thread
From: Jimmy Guo @ 2000-08-11 19:29 UTC (permalink / raw)
  To: gdb-patches

This patch passes gdb and gcc / g++ testing.  I've also added more
inline comments as compared to the one that's withdrawn.

- Jimmy

2000-08-11	Jimmy Guo	<guo@cup.hp.com>

	* runtest.exp: Eliminate from test_top_dirs entries that
	are subdirectories of other entries, to avoid redundant
	testing on *.exp files in these subdirectories.

Index: runtest.exp
===================================================================
RCS file: /cvs/src/src/dejagnu/runtest.exp,v
retrieving revision 1.4
diff -c -r1.4 runtest.exp
*** runtest.exp	2000/08/05 06:34:02	1.4
--- runtest.exp	2000/08/12 02:24:11
***************
*** 1664,1669 ****
--- 1664,1712 ----
  	set test_top_dirs [lsort [getdirs -all ${srcdir} "${tool}*"]]
  	if { ${test_top_dirs} == "" } {
  	    set test_top_dirs ${srcdir}
+ 	} else {
+ 	    # JYG:
+ 	    # DejaGNU's notion of test tree and test files is very
+ 	    # general:
+ 	    # given ${srcdir} and ${tool}, any subdirectory (at any
+ 	    # level deep) with the "${tool}" prefix starts a test tree;
+ 	    # given a test tree, any *.exp file underneath (at any
+ 	    # level deep) is a test file.
+ 	    #
+ 	    # For test tree layouts with ${tool} prefix on
+ 	    # both a parent and a child directory, we need to eliminate
+ 	    # the child directory entry from test_top_dirs list.
+ 	    # e.g. gdb.hp/gdb.base-hp/ would result in two entries
+ 	    # in the list: gdb.hp, gdb.hp/gdb.base-hp.
+ 	    # If the latter not eliminated, test files under
+ 	    # gdb.hp/gdb.base-hp would be run twice (since test files
+ 	    # are gathered from all sub-directories underneath a
+ 	    # directory).
+ 	    #
+ 	    # Since ${tool} may be g++, etc. which could confuse
+ 	    # regexp, we cannot do the simpler test:
+ 	    #     ...
+ 	    #     if [regexp "${srcdir}/.*${tool}.*/.*${tool}.*" ${dir}]
+ 	    #     ...
+ 	    # instead, we rely on the fact that test_top_dirs is
+ 	    # a sorted list of entries, and any entry that contains
+ 	    # the previous valid test top dir entry in its own pathname
+ 	    # must be excluded.
+ 
+ 	    set temp_top_dirs ""
+ 	    set prev_dir ""
+ 	    foreach dir "${test_top_dirs}" {
+ 		if { [string length ${prev_dir}] == 0 ||
+ 		     [string first ${prev_dir} ${dir}] == -1} {
+ 	            # the first top dir entry, or an entry that
+ 		    # does not share the previous entry's entire
+ 	            # pathname, record it as a valid top dir entry.
+ 		    #
+ 		    lappend temp_top_dirs ${dir}
+ 		    set prev_dir ${dir}
+ 		}
+ 	    }
+ 	    set test_top_dirs ${temp_top_dirs}
  	}
  	verbose "Top level testsuite dirs are ${test_top_dirs}" 2
  	set testlist "";


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

* Re: [RFA] new patch: dejagnu runtest.exp redundant testing
  2000-08-11 19:29 [RFA] new patch: dejagnu runtest.exp redundant testing Jimmy Guo
@ 2000-08-14 11:09 ` Jimmy Guo
  0 siblings, 0 replies; 2+ messages in thread
From: Jimmy Guo @ 2000-08-14 11:09 UTC (permalink / raw)
  To: gdb-patches

I've committed this patch, with a slight modification to match for
"${prev_dir}/" instead of ${prev_dir} in ${dir}, i.e.
...
if { [string first "${prev_dir}/" ${dir}] == -1} {
...

This change is necessary to guard against the cases where you have
<tool>.a and <tool>.aa test_top_dirs entries ... although not seen in
GDB / GCC / G++ testsuite trees.  Again, tested w/ GDB / GCC / G++
testsuites with no regression.

- Jimmy


On Fri, 11 Aug 2000, Jimmy Guo wrote:

>This patch passes gdb and gcc / g++ testing.  I've also added more
>inline comments as compared to the one that's withdrawn.
>
>- Jimmy
>
>2000-08-11	Jimmy Guo	<guo@cup.hp.com>
>
>	* runtest.exp: Eliminate from test_top_dirs entries that
>	are subdirectories of other entries, to avoid redundant
>	testing on *.exp files in these subdirectories.
>
>Index: runtest.exp
>===================================================================
>RCS file: /cvs/src/src/dejagnu/runtest.exp,v
>retrieving revision 1.4
>diff -c -r1.4 runtest.exp
>*** runtest.exp	2000/08/05 06:34:02	1.4
>--- runtest.exp	2000/08/12 02:24:11
>***************
>*** 1664,1669 ****
>--- 1664,1712 ----
>  	set test_top_dirs [lsort [getdirs -all ${srcdir} "${tool}*"]]
>  	if { ${test_top_dirs} == "" } {
>  	    set test_top_dirs ${srcdir}
>+ 	} else {
>+ 	    # JYG:
>+ 	    # DejaGNU's notion of test tree and test files is very
>+ 	    # general:
>+ 	    # given ${srcdir} and ${tool}, any subdirectory (at any
>+ 	    # level deep) with the "${tool}" prefix starts a test tree;
>+ 	    # given a test tree, any *.exp file underneath (at any
>+ 	    # level deep) is a test file.
>+ 	    #
>+ 	    # For test tree layouts with ${tool} prefix on
>+ 	    # both a parent and a child directory, we need to eliminate
>+ 	    # the child directory entry from test_top_dirs list.
>+ 	    # e.g. gdb.hp/gdb.base-hp/ would result in two entries
>+ 	    # in the list: gdb.hp, gdb.hp/gdb.base-hp.
>+ 	    # If the latter not eliminated, test files under
>+ 	    # gdb.hp/gdb.base-hp would be run twice (since test files
>+ 	    # are gathered from all sub-directories underneath a
>+ 	    # directory).
>+ 	    #
>+ 	    # Since ${tool} may be g++, etc. which could confuse
>+ 	    # regexp, we cannot do the simpler test:
>+ 	    #     ...
>+ 	    #     if [regexp "${srcdir}/.*${tool}.*/.*${tool}.*" ${dir}]
>+ 	    #     ...
>+ 	    # instead, we rely on the fact that test_top_dirs is
>+ 	    # a sorted list of entries, and any entry that contains
>+ 	    # the previous valid test top dir entry in its own pathname
>+ 	    # must be excluded.
>+ 
>+ 	    set temp_top_dirs ""
>+ 	    set prev_dir ""
>+ 	    foreach dir "${test_top_dirs}" {
>+ 		if { [string length ${prev_dir}] == 0 ||
>+ 		     [string first ${prev_dir} ${dir}] == -1} {
>+ 	            # the first top dir entry, or an entry that
>+ 		    # does not share the previous entry's entire
>+ 	            # pathname, record it as a valid top dir entry.
>+ 		    #
>+ 		    lappend temp_top_dirs ${dir}
>+ 		    set prev_dir ${dir}
>+ 		}
>+ 	    }
>+ 	    set test_top_dirs ${temp_top_dirs}
>  	}
>  	verbose "Top level testsuite dirs are ${test_top_dirs}" 2
>  	set testlist "";
>
>


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

end of thread, other threads:[~2000-08-14 11:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-11 19:29 [RFA] new patch: dejagnu runtest.exp redundant testing Jimmy Guo
2000-08-14 11:09 ` Jimmy Guo

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