From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jimmy Guo To: Fernando Nasser Cc: Geoff Keating , gdb-patches@sourceware.cygnus.com Subject: [RFA] dejagnu runtest.exp redundant testing Date: Mon, 07 Aug 2000 11:34:00 -0000 Message-id: References: X-SW-Source: 2000-08/msg00142.html Here is the runtest.exp patch which fixes the redundant testing problem without violating the assumption that any *.exp file under a ${tool}* directory tree is a valid test file. Geoff, please try it against GCC testing to see if I break something this time. Thanks! - Jimmy 2000-08-07 Jimmy Guo * runtest.exp: Eliminate from test_top_dirs entries that cause redundant testing. Entries picked up because of their ${tool} prefix under the real top dir with the ${tool} prefix have been making dejagnu run tests under these entries twice, since dejagnu treats all *.exp files under a given directory tree as test files. *** runtest.exp.orig Mon Aug 7 11:01:57 2000 --- runtest.exp Mon Aug 7 11:21:57 2000 *************** *** 1664,1669 **** --- 1664,1689 ---- set test_top_dirs [lsort [getdirs -all ${srcdir} "${tool}*"]] if { ${test_top_dirs} == "" } { set test_top_dirs ${srcdir} + } else { + # JYG: For test tree layouts with ${tool} prefix on + # both a parent and a child directory, 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. + set temp_top_dirs "" + foreach dir "${test_top_dirs}" { + if [regexp "${srcdir}/.*${tool}.*/.*${tool}" ${dir}] { + # skip this directory. + continue + } else { + lappend temp_top_dirs ${dir} + } + } + set test_top_dirs ${temp_top_dirs} } verbose "Top level testsuite dirs are ${test_top_dirs}" 2 set testlist "";