Re: recent dejagnu changes

Jimmy Guo
2000-08-04T23:40:00Z

Actually, the dir_to_run and cmdline_dir_to_run change is OK ... that
allows specification of a list of test suites, instead of one at a time.

The problem is exactly with the one line find change in runtest.exp, and
the related find proc enhancement in utils.exp.

- Jimmy

>
>OK, here's the patch I'm about to commit:
>
>--
>- Geoffrey Keating <geoffk@cygnus.com>
>
>Index: ChangeLog
>===================================================================
>RCS file: /cvs/src/src/dejagnu/ChangeLog,v
>retrieving revision 1.19
>diff -p -u -u -p -r1.19 ChangeLog
>--- ChangeLog 2000/08/02 22:38:52 1.19
>+++ ChangeLog 2000/08/05 06:25:30
>@@ -1,3 +1,14 @@
>+2000-08-04 Geoff Keating <geoffk@cygnus.com>
>+
>+ Back out this change:
>+
>+ * lib/utils.exp: Add support for a -maxdepth <n>
>+ option to limit find to <n> directories deep.
>+ * runtest.exp: Handle multiple directories in TCL variables
>+ dir_to_run and cmdline_dir_to_run; limit *.exp find to
>+ one directory level to avoid foo/bar/baz.exp getting tested
>+ twice (when ${dir} is 'foo', and when ${dir} is 'foo/bar').
>+
> 2000-08-02 Jimmy Guo <guo@hpcleara.cup.hp.com>
>
> * lib/target.exp (default_target_compile,default_target_assemble,
>@@ -8,14 +19,14 @@
>
> * lib/utils.exp: Add support for a -maxdepth <n>
> option to limit find to <n> directories deep.
>-
>- * runtest.exp: Cleanup reference to $env(MULTIPASS) and
>- $env(PASS). These were added by HP but unused since.
>- Handle multiple directories in TCL variables
>+ * runtest.exp: Handle multiple directories in TCL variables
> dir_to_run and cmdline_dir_to_run; limit *.exp find to
> one directory level to avoid foo/bar/baz.exp getting tested
> twice (when ${dir} is 'foo', and when ${dir} is 'foo/bar').
>
>+ * runtest.exp: Cleanup reference to $env(MULTIPASS) and
>+ $env(PASS). These were added by HP but unused since.
>+
> * lib/framework.exp (pass): make compiler_conditional_xfail_data
> a global, corresponding to a recent change to 'proc fail'.
>
>Index: runtest.exp
>===================================================================
>RCS file: /cvs/src/src/dejagnu/runtest.exp,v
>retrieving revision 1.3
>diff -p -u -u -p -r1.3 runtest.exp
>--- runtest.exp 2000/08/02 22:35:10 1.3
>+++ runtest.exp 2000/08/05 06:25:30
>@@ -1730,16 +1730,7 @@ foreach current_target $target_list {
> # value (for example in MULTIPASS) and the test
> # directory matches that directory.
> if {[info exists dir_to_run] && $dir_to_run != ""} {
>- # JYG: dir_to_run might be a space delimited list
>- # of directories. Look for match on each item.
>- set found 0
>- foreach directory $dir_to_run {
>- if [string match "*${directory}*" $dir] {
>- set found 1
>- break
>- }
>- }
>- if {!$found} {
>+ if ![string match "*${dir_to_run}*" $dir] {
> continue
> }
> }
>@@ -1749,30 +1740,12 @@ foreach current_target $target_list {
> # directory matches that directory
> if {[info exists cmdline_dir_to_run] \
> && $cmdline_dir_to_run != ""} {
>- # JYG: cmdline_dir_to_run might be a space delimited
>- # list of directories. Look for match on each item.
>- set found 0
>- foreach directory $cmdline_dir_to_run {
>- if [string match "*${directory}*" $dir] {
>- set found 1
>- break
>- }
>- }
>- if {!$found} {
>+ if ![string match "*${cmdline_dir_to_run}*" $dir] {
> continue
> }
> }
>
>- # JYG: Limit find to one directory level to treat
>- # each test directory as a base directory.
>- # test_top_dirs includes all subdirectory paths,
>- # e.g. for gdb.hp/gdb.base-hp/, test_top_dirs
>- # has two entries: gdb.hp/, and gdb.base-hp/.
>- # If we just use '[find ${dir} *.exp]', all
>- # *.exp files in gdb.hp/gdb.base-hp/ would be
>- # picked up twice and tested twice, which is
>- # what we don't need.
>- foreach test_name [lsort [find -maxdepth 1 ${dir} *.exp]] {
>+ foreach test_name [lsort [find ${dir} *.exp]] {
> if { ${test_name} == "" } {
> continue
> }
>Index: lib/utils.exp
>===================================================================
>RCS file: /cvs/src/src/dejagnu/lib/utils.exp,v
>retrieving revision 1.2
>diff -p -u -u -p -r1.2 utils.exp
>--- utils.exp 2000/08/02 22:35:10 1.2
>+++ utils.exp 2000/08/05 06:25:30
>@@ -87,34 +87,18 @@ proc getdirs { args } {
>
> #
> # Finds all the files recursively
>-# Args:
>-# [-maxdepth <n>]
>-# limit recursive find depth to <n> level;
>-# default is to recursively find in all subdirectories
>-# rootdir
>-# the directory to start the search from. This is and all
>-# subdirectories are searched for filenames. Directory names
>-# are not included in the list, but the filenames have path
>-# information.
>-# pattern
>-# the pattern to match. Patterns are csh style globbing rules.
>-# Returns:
>-# a list or a NULL.
>+# rootdir - this is the directory to start the search
>+# from. This is and all subdirectories are search for
>+# filenames. Directory names are not included in the
>+# list, but the filenames have path information.
>+# pattern - this is the pattern to match. Patterns are csh style
>+# globbing rules.
>+# returns: a list or a NULL.
> #
>-proc find { args } {
>- if { [lindex $args 0] == "-maxdepth" } {
>- set maxdepth [lindex $args 1]
>- set args [lrange $args 2 end]
>- } else {
>- set maxdepth 0
>- }
>- set rootdir [lindex $args 0]
>- set pattern [lindex $args 1]
>-
>+proc find { rootdir pattern } {
> # first find all the directories
> set dirs "$rootdir "
>- set depth 1
>- while { $maxdepth == 0 || $depth < $maxdepth } {
>+ while 1 {
> set tmp $rootdir
> set rootdir ""
> if [string match "" $tmp] {
>@@ -131,7 +115,6 @@ proc find { args } {
> }
> }
> set tmp ""
>- set depth [expr $depth + 1]
> }
>
> # find all the files that match the pattern
>

Jimmy Guo, guo@cup.hp.com ADO eDL WDB
Voice: 800-477-6111 ext. 7451 Hewlett-Packard Company
(HP T-447-5229) 11000 Wolfe Road, MS 42UD
Fax: 408-447-4629 Cupertino, CA 95014-0678