[RFA] new patch: dejagnu runtest.exp redundant testing
Fernando Nasser
fnasser@cygnus.com
Fri Aug 11 19:53:00 GMT 2000
Thanks Jimmy.
Check it in and lets see how it goes with the tests for gas, binutils, ld...
Just kidding ;-)
Cheers,
Fernando
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 "";
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@cygnus.com
2323 Yonge Street, Suite #300 Tel: 416-482-2661 ext. 311
Toronto, Ontario M4P 2C9 Fax: 416-482-6299
More information about the Gdb-patches
mailing list