[libstdc++] Also set LD_RUN_PATH in testsuite, add comments

Phil Edwards phil@jaj.com
Mon Jun 30 18:38:00 GMT 2003


While wrestling with a bizarre race condition in a v3 test, I found myself
trying to trace through the maze of dejagnu callbacks for the umpteenth time.
So I added some comments.  Experts will find these to be needlessly verbose,
but as many of us only look at these files every ten weeks, they're a
nice reminder.  (The callback maze turns out to be very simple -- once
you rediscover what these comments indicate.)

In addition to setting various runtime LD_*_PATH env variables, if we
also set LD_RUN_PATH, running and examining troublesome executables by
hand becomes much easier.  In the normal case it doesn't hurt.  So I've
added that, along with a logging message.

Those changes are in the first attachment.  Tested on x86/linux, applied
to the trunk.  The changelog entry is below.


The second attachment is just for reference.  It's a one-line change to
an installation of dejagnu.  The effect is to not delete executables after
trying to run them, so that a maintainence programmer doesn't have to try
and recreate the same environment to build them by hand.

(If a dejagnu expert knows how to make this change outside of system files,
I'd love to hear it.  dg-test is set up to take arbitrary options, and
dg-runtest is sort of set up to do the same, /but/ dg-runtest passes the
flags to dg-test in such a way that only tool-specific flags can be passed,
i.e., compiler otpions, but not dejagnu options.)


2003-06-30  Phil Edwards  <pme@gcc.gnu.org>

	* testsuite/lib/libstdc++-v3-dg.exp:  Add comments.
	(libstdc++-v3-init):  Also set LD_RUN_PATH.

-------------- next part --------------
2003-06-30  Phil Edwards  <pme@gcc.gnu.org>

	* testsuite/lib/libstdc++-v3-dg.exp:  Add comments.
	(libstdc++-v3-init):  Also set LD_RUN_PATH.


Index: testsuite/lib/libstdc++-v3-dg.exp
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp,v
retrieving revision 1.25
diff -u -3 -p -r1.25 libstdc++-v3-dg.exp
--- testsuite/lib/libstdc++-v3-dg.exp	18 Jun 2003 01:52:08 -0000	1.25
+++ testsuite/lib/libstdc++-v3-dg.exp	30 Jun 2003 17:04:27 -0000
@@ -20,6 +20,7 @@ load_lib dg.exp
 load_lib libgloss.exp
 load_lib prune.exp
 
+# Called once, by libstdc++-v3-init below.  "Static" to this file.
 proc libstdc++-v3-copy-files {srcfiles dstdir} {
     foreach f $srcfiles {
 	if { [catch { set symlink [file readlink $f] } x] } then {
@@ -35,6 +36,7 @@ proc libstdc++-v3-copy-files {srcfiles d
     }
 }
 
+# Called once, from libstdc++-v3.dg/dg.exp.
 proc libstdc++-v3-init { args } {
     global srcdir
     global outdir
@@ -96,6 +98,8 @@ proc libstdc++-v3-init { args } {
     setenv  SHLIB_PATH          $ld_library_path
     setenv  LD_LIBRARYN32_PATH  $ld_library_path
     setenv  LD_LIBRARY64_PATH   $ld_library_path
+    setenv  LD_RUN_PATH         $ld_library_path
+    verbose -log "Set LD_*_PATHs to ${ld_library_path}"
 
     # Do a bunch of handstands and backflips for cross compiling and
     # finding simulators...
@@ -135,6 +139,7 @@ proc libstdc++-v3-init { args } {
     }
 }
 
+# Callback from system dg-test.
 proc libstdc++-v3-dg-test { prog do_what extra_tool_flags } {
     # Set up the compiler flags, based on what we're going to do.
 
@@ -181,7 +186,8 @@ proc libstdc++-v3-dg-test { prog do_what
     return [list $comp_output $output_file]
 }
 
-
+# Called from libstdc++-v3-dg-test above.  Calls back into system's
+# target_compile to actually do the work.
 proc libstdc++-v3_target_compile { source dest type options } {
     global gluefile 
     global wrap_flags
@@ -227,6 +233,8 @@ proc libstdc++-v3_target_compile { sourc
 #
 # Selecting individual tests can also be done with RUNTESTFLAGS, but
 # that doesn't really do all that we are trying to accomplish here.
+#
+# Essentially "static" to this file.
 proc v3-compute-tests { } {
     global srcdir
     global outdir
@@ -319,6 +327,7 @@ proc v3-compute-tests { } {
     close $f
 }
 
+# Called once, from libstdc++-v3.dg/dg.exp.
 proc v3-list-tests { filename } {
     global srcdir
     global outdir
-------------- next part --------------
--- /usr/share/dejagnu/dg.exp.orig	2003-05-14 21:59:27.000000000 -0400
+++ /usr/share/dejagnu/dg.exp	2003-06-27 16:15:34.000000000 -0400
@@ -582,7 +582,7 @@ proc dg-runtest { testcases flags defaul
 	    continue
 	}
 	verbose "Testing [file tail [file dirname $testcase]]/[file tail $testcase]"
-	dg-test $testcase $flags ${default-extra-flags}
+	dg-test -keep-output $testcase $flags ${default-extra-flags}
     }
 }
 


More information about the Gcc-patches mailing list