From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jimmy Guo To: gdb-patches@sourceware.cygnus.com Subject: [PATCH] dejagnu runtest.exp misc. fixes Date: Mon, 31 Jul 2000 17:00:00 -0000 Message-id: X-SW-Source: 2000-07/msg00386.html Mon Jul 31 16:54:52 Jimmy Guo * 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'). Index: runtest.exp /usr/local/bin/diff -c -L runtest.exp runtest.exp@@/main/cygnus/6 runtest.exp *** runtest.exp --- runtest.exp Mon Jul 31 16:54:33 2000 *************** *** 1734,1740 **** # 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 } } --- 1734,1747 ---- # 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 } } *************** *** 1744,1755 **** # 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 } --- 1751,1772 ---- # 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 } } ! # JYG: Limit find to one level, since we don't want ! # to pick up foo/bar/baz.exp twice ... ! # ${test_top_dirs} includes '... foo/ foo/bar/ ...' ! foreach test_name [lsort [find -maxdepth 1 ${dir} *.exp]] { if { ${test_name} == "" } { continue }