This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

(patch) hpjyg12: dejagnu/runtest.exp


Some cleanups and fixes to the main loop of runtest.exp.  See ChangeLog
item.

ChangeLog:

1999-11-05	Jimmy Guo	<guo@cup.hp.com>

	* runtest.exp (main execution loop): cleanup env() code for
          MULTIPASS / PASS; $dir_to_run / $cmdline_dir_to_run can be
	  a list expr, we should do string match on each individual
          directory specified there against what we have in the
          testsuite tree; limit find $dir *.exp to 1 level to avoid
          running the same test twice when the test is under a testsuite
          hierarchy (e.g. gdb.hp/gdb.base-hp/foo.exp -- find gdb.hp
          *.exp will pick this up, and find gdb.hp/gdb.base-hp will pick
          this up again, and both gdb.hp & gdb.hp/gdb.base-hp is in the
          test suite directory list!)

Index: dejagnu/runtest.exp
/opt/gnu/bin/diff -r -c -N  /view/guo.import//CLO/Components/WDB/Src/gnu/dejagnu/runtest.exp dejagnu/runtest.exp
*** /view/guo.import//CLO/Components/WDB/Src/gnu/dejagnu/runtest.exp	Tue May 11 16:06:24 1999
--- dejagnu/runtest.exp	Wed Aug  4 01:01:17 1999
***************
*** 1594,1617 ****
  # "{ name var1=value1 ... }" where `name' is a generic name for the pass and
  # currently has no other meaning.
  
-     global env
- 
      if { [info exists MULTIPASS] } {
  	set multipass $MULTIPASS
-     } elseif {[info exists env(MULTIPASS)]} {
- 	set multipass $env(MULTIPASS)
      }
      if { $multipass == "" } {
  	set multipass { "" }
      }
  
! # If PASS is specified, either as a TCL variable or in environment, we
! # want to run only the tests specified. Its value should be a number
! # or a list of numbers that specify the passes that we want to run.
      if [info exists PASS] {
  	set pass $PASS
-     } elseif [info exists env(PASS)] {
- 	set pass $env(PASS)
      } else {
  	set pass ""
      }
--- 1594,1611 ----
  # "{ name var1=value1 ... }" where `name' is a generic name for the pass and
  # currently has no other meaning.
  
      if { [info exists MULTIPASS] } {
  	set multipass $MULTIPASS
      }
      if { $multipass == "" } {
  	set multipass { "" }
      }
  
! # If PASS is specified, we want to run only the tests specified.
! # Its value should be a number or a list of numbers that specify the
! # passes that we want to run.
      if [info exists PASS] {
  	set pass $PASS
      } else {
  	set pass ""
      }
***************
*** 1728,1734 ****
  		    # value (for example in MULTIPASS) and the test
  		    # directory matches that directory.
  		    if {[info exists dir_to_run] && $dir_to_run != ""} {
! 			if ![string match "*${dir_to_run}*" $dir] {
  			    continue
  			}
  		    }
--- 1722,1735 ----
  		    # value (for example in MULTIPASS) and the test
  		    # directory matches that directory.
  		    if {[info exists dir_to_run] && $dir_to_run != ""} {
!                         set found 0
!                         foreach directory $dir_to_run { 
!                             if [string match "*${directory}*" $dir] {
!                                 set found 1
!                                 break
!                             }
!                         }
!                         if {!$found} {
  			    continue
  			}
  		    }
***************
*** 1738,1749 ****
  		    # directory matches that directory
  		    if {[info exists cmdline_dir_to_run] \
  			    && $cmdline_dir_to_run != ""} {
! 			if ![string match "*${cmdline_dir_to_run}*" $dir] {
  			    continue
  			}
  		    }
  
! 		    foreach test_name [lsort [find ${dir} *.exp]] {
  			if { ${test_name} == "" } {
  			    continue
  			}
--- 1739,1771 ----
  		    # directory matches that directory
  		    if {[info exists cmdline_dir_to_run] \
  			    && $cmdline_dir_to_run != ""} {
!                         set found 0
!                         foreach directory $cmdline_dir_to_run {
!                             if [string match "*${directory}*" $dir] {
!                                 set found 1
!                                 break
!                             }
!                         }
!                         if {!$found} {
  			    continue
  			}
  		    }
  
! 		    #
! 		    # Since we have a list of all directory paths in
! 		    # ${test_top_dirs}, we don't want to run a test
! 		    # multiple times which could occur if we
! 		    # just did [find ${dir} *.exp] below, e.g.
! 		    # if we want to run a test foo.exp under
! 		    # tool.top_suite/tool.leaf_suite/foo.exp,
! 		    # and we have $test_top_dirs as:
! 		    # 'tool.top_suite tool.top_suite/tool.leaf_suite'
! 		    # we don't want the loop below to find
! 		    # tool.top_suite/tool.leaf_suite/foo.exp twice.
! 		    # By limiting find to 1 level, we avoid such mistake.
! 		    # - guo
! 		    #
! 		    foreach test_name [lsort [find -maxdepth 1 ${dir} *.exp]] {
  			if { ${test_name} == "" } {
  			    continue
  			}

	


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]