This is the mail archive of the mailing list for the GCC project.

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

libstdc++ testsuite fixes, 1

If you build using a relative pathname to get from the object to the
source directory, testsuite_flags --build-includes will generate -I
switches which are relative to the top level of the libstdc++ build
directory.  runtest executes one level below (in the testsuite
directory), therefore all the paths are wrong, and the test suite
can't find any headers and blows up horribly.

This patch corrects the problem.  I chose to edit the result of
testsuite_flags from libstdc++-v3-dg.exp, rather than change
testsuite_flags, because there are other things (, e.g.)
which use testsuite_flags and may expect it to produce its old

zw  I am a believer in free will.  If my dog chooses to hate the whole human
    race except myself, it must be free to do so.
    	-- Diana Wynne Jones, _Castle in the Air_

	* testsuite/lib/libstdc++-v3-dg.exp: If testsuite_flags
	--build-includes produces -I switches with relative paths,
	add another ../ to each so they work from runtest's cwd.

Index: testsuite/lib/libstdc++-v3-dg.exp
--- testsuite/lib/libstdc++-v3-dg.exp	2001/05/14 01:15:36	1.2
+++ testsuite/lib/libstdc++-v3-dg.exp	2001/05/15 18:23:13
@@ -32,6 +32,19 @@ proc libstdc++-v3-init { args } {
     set cxxflags [exec sh ${blddir}/testsuite_flags --cxxflags]
     set includes [exec sh ${blddir}/testsuite_flags --build-includes]
+    # includes may contain paths which are relative to the top level of
+    # the libstdc++ build directory.  We execute one level below that, so
+    # all those paths have to be adjusted to match.
+    set x {}
+    foreach i $includes {
+	if [string equal -length 5 $i "-I../"] {
+	    lappend x "-I../[string range $i 2 end]"
+	} else {
+	    lappend x $i
+	}
+    }
+    set includes $x
     # By default, we assume we want to run program images.
     global dg-do-what-default
     set dg-do-what-default run

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