This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Allow listing of testsuite tests (a la mkcheck)
- To: libstdc++ at gcc dot gnu dot org
- Subject: Allow listing of testsuite tests (a la mkcheck)
- From: Phil Edwards <pedwards at disaster dot jaj dot com>
- Date: Thu, 20 Sep 2001 16:11:42 -0400
One of the things I liked using with mkcheck was the "mkcheckfiles"
listing of source files. If a testsuite run showed a problematic test,
the generated mkcheckfiles could be trimmed down to that test(s). Then the
testsuite would only run those tests.
This adds the same capability to the dejagnu harness. It's been over two
years since I wrote any Tcl, so I'll cheerfully ignore any flames about
my crappy Tcl coding style. :-) However, if there are conventions about
procedure names, etc, I'll cheerfully change those to suit.
The generated file is called "testsuite_files" and it's placed in the
testsuite directory. As with mkcheck, only the last part of the pathname
is listed (e.g., "17_intro/headers.cc").
Comments? Okay to apply?
Phil
Index: lib/libstdc++-v3-dg.exp
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp,v
retrieving revision 1.9
diff -u -3 -p -r1.9 libstdc++-v3-dg.exp
--- lib/libstdc++-v3-dg.exp 13 Aug 2001 20:43:13 -0000 1.9
+++ lib/libstdc++-v3-dg.exp 20 Sep 2001 19:47:08 -0000
@@ -167,3 +167,36 @@ proc libstdc++-v3_target_compile { sourc
return [target_compile $source $dest $type $options]
}
+# A bit sloppy... Returns a list of source files (full pathnames) to
+# compile. We mimic the mkcheck script in that the first time this is run,
+# all existing files are listed in "testsuite_files" in the output
+# directory. Subsequent runs pull the list from that file, allowing users
+# to trim the list down to problematic tests.
+proc libstdc++-v3-list-sourcefiles { } {
+ global srcdir
+ global outdir
+
+ set files_file "${outdir}/testsuite_files"
+ set sfiles ""
+ if { [file exists $files_file] } {
+ set f [open $files_file]
+ while { ! [eof $f] } {
+ set t [gets $f]
+ if { [string length "$t"] != 0 } {
+ lappend sfiles ${srcdir}/${t}
+ }
+ }
+ } else {
+ set f [open $files_file "w"]
+ set where_we_were [pwd]
+ cd $srcdir
+ foreach s [lsort [glob -nocomplain */*.cc]] {
+ lappend sfiles ${srcdir}/${s}
+ puts $f $s
+ }
+ cd $where_we_were
+ }
+ close $f
+ return $sfiles
+}
+
Index: libstdc++-v3.dg/dg.exp
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/testsuite/libstdc++-v3.dg/dg.exp,v
retrieving revision 1.1
diff -u -3 -p -r1.1 dg.exp
--- libstdc++-v3.dg/dg.exp 12 May 2001 17:49:16 -0000 1.1
+++ libstdc++-v3.dg/dg.exp 20 Sep 2001 19:44:27 -0000
@@ -40,8 +40,7 @@ remote_exec host ${shell-ulimit-command}
remote_exec host ${shell-ulimit-command} "-v ${maximum-memory-usage}"
# Main loop.
-dg-runtest [lsort [glob -nocomplain $srcdir/*/*.cc]] \
- "" $DEFAULT_CXXFLAGS
+dg-runtest [libstdc++-v3-list-sourcefiles] "" $DEFAULT_CXXFLAGS
# All done.
dg-finish