fix c++ testsuite for remote testing

Geoffrey Keating geoffk@cygnus.com
Tue Nov 13 15:03:00 GMT 2001


This patch fixes some spurious failures while testing a cross-built
toolchain, that is a toolchain built on one kind of machine to run on
another.

Tested with an x86-linux native bootstrap.

-- 
Geoff Keating <geoffk@redhat.com>

===File ~/patches/gcc-stormy-morec++tests.patch=============
2001-11-22  Geoffrey Keating  <geoffk@redhat.com>

	* lib/old-dejagnu.exp (old-dejagnu): Copy extra source files
	to the host if it is remote.  Let tests specify extra headers
	they use.
	* g++.old-deja/g++.abi/vtable3a.C: This uses 'vtable3.h'.
	* g++.old-deja/g++.abi/vtable3b.C: This uses 'vtable3.h'.
	* g++.old-deja/g++.abi/vtable3c.C: This uses 'vtable3.h'.
	* g++.old-deja/g++.abi/vtable3d.C: This uses 'vtable3.h'.
	* g++.old-deja/g++.abi/vtable3e.C: This uses 'vtable3.h'.
	* g++.old-deja/g++.abi/vtable3f.C: This uses 'vtable3.h'.
	* g++.old-deja/g++.abi/vtable3g.C: This uses 'vtable3.h'.
	* g++.old-deja/g++.abi/vtable3h.C: This uses 'vtable3.h'.
	* g++.old-deja/g++.abi/vtable3i.C: This uses 'vtable3.h'.
	* g++.old-deja/g++.abi/vtable3j.C: This uses 'vtable3.h'.

Index: gcc/testsuite/g++.old-deja/g++.abi/vtable3a.C
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/testsuite/g++.old-deja/g++.abi/vtable3a.C,v
retrieving revision 1.2
diff -p -u -p -r1.2 vtable3a.C
--- gcc/testsuite/g++.old-deja/g++.abi/vtable3a.C	2001/07/02 13:37:48	1.2
+++ gcc/testsuite/g++.old-deja/g++.abi/vtable3a.C	2001/11/22 20:37:05
@@ -2,6 +2,7 @@
 // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
 
 // Check constructor vtables work.
+// Additional files: vtable3.h
 
 #define A_EMPTY
 #define B1_EMPTY
Index: gcc/testsuite/g++.old-deja/g++.abi/vtable3b.C
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/testsuite/g++.old-deja/g++.abi/vtable3b.C,v
retrieving revision 1.1
diff -p -u -p -r1.1 vtable3b.C
--- gcc/testsuite/g++.old-deja/g++.abi/vtable3b.C	2001/03/02 00:03:10	1.1
+++ gcc/testsuite/g++.old-deja/g++.abi/vtable3b.C	2001/11/22 20:37:05
@@ -2,6 +2,7 @@
 // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
 
 // Check constructor vtables work.
+// Additional files: vtable3.h
 
 #define B1_EMPTY
 #define B2_EMPTY
Index: gcc/testsuite/g++.old-deja/g++.abi/vtable3c.C
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/testsuite/g++.old-deja/g++.abi/vtable3c.C,v
retrieving revision 1.1
diff -p -u -p -r1.1 vtable3c.C
--- gcc/testsuite/g++.old-deja/g++.abi/vtable3c.C	2001/03/02 00:03:10	1.1
+++ gcc/testsuite/g++.old-deja/g++.abi/vtable3c.C	2001/11/22 20:37:05
@@ -2,6 +2,7 @@
 // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
 
 // Check constructor vtables work.
+// Additional files: vtable3.h
 
 #define A_EMPTY
 #define B2_EMPTY
Index: gcc/testsuite/g++.old-deja/g++.abi/vtable3d.C
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/testsuite/g++.old-deja/g++.abi/vtable3d.C,v
retrieving revision 1.1
diff -p -u -p -r1.1 vtable3d.C
--- gcc/testsuite/g++.old-deja/g++.abi/vtable3d.C	2001/03/02 00:03:10	1.1
+++ gcc/testsuite/g++.old-deja/g++.abi/vtable3d.C	2001/11/22 20:37:05
@@ -2,6 +2,7 @@
 // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
 
 // Check constructor vtables work.
+// Additional files: vtable3.h
 
 #define A_EMPTY
 #define B1_EMPTY
Index: gcc/testsuite/g++.old-deja/g++.abi/vtable3e.C
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/testsuite/g++.old-deja/g++.abi/vtable3e.C,v
retrieving revision 1.1
diff -p -u -p -r1.1 vtable3e.C
--- gcc/testsuite/g++.old-deja/g++.abi/vtable3e.C	2001/03/02 00:03:10	1.1
+++ gcc/testsuite/g++.old-deja/g++.abi/vtable3e.C	2001/11/22 20:37:05
@@ -2,6 +2,7 @@
 // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
 
 // Check constructor vtables work.
+// Additional files: vtable3.h
 
 #define A_EMPTY
 #define B1_EMPTY
Index: gcc/testsuite/g++.old-deja/g++.abi/vtable3f.C
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/testsuite/g++.old-deja/g++.abi/vtable3f.C,v
retrieving revision 1.1
diff -p -u -p -r1.1 vtable3f.C
--- gcc/testsuite/g++.old-deja/g++.abi/vtable3f.C	2001/03/02 00:03:10	1.1
+++ gcc/testsuite/g++.old-deja/g++.abi/vtable3f.C	2001/11/22 20:37:05
@@ -2,6 +2,7 @@
 // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
 
 // Check constructor vtables work.
+// Additional files: vtable3.h
 
 #define A_EMPTY
 #define B1_EMPTY
Index: gcc/testsuite/g++.old-deja/g++.abi/vtable3g.C
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/testsuite/g++.old-deja/g++.abi/vtable3g.C,v
retrieving revision 1.1
diff -p -u -p -r1.1 vtable3g.C
--- gcc/testsuite/g++.old-deja/g++.abi/vtable3g.C	2001/03/02 00:03:10	1.1
+++ gcc/testsuite/g++.old-deja/g++.abi/vtable3g.C	2001/11/22 20:37:05
@@ -2,6 +2,7 @@
 // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
 
 // Check constructor vtables work.
+// Additional files: vtable3.h
 
 #define A_EMPTY
 #define B1_EMPTY
Index: gcc/testsuite/g++.old-deja/g++.abi/vtable3h.C
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/testsuite/g++.old-deja/g++.abi/vtable3h.C,v
retrieving revision 1.1
diff -p -u -p -r1.1 vtable3h.C
--- gcc/testsuite/g++.old-deja/g++.abi/vtable3h.C	2001/03/02 00:03:10	1.1
+++ gcc/testsuite/g++.old-deja/g++.abi/vtable3h.C	2001/11/22 20:37:05
@@ -2,6 +2,7 @@
 // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
 
 // Check constructor vtables work.
+// Additional files: vtable3.h
 
 #define A_EMPTY
 #define B1_EMPTY
Index: gcc/testsuite/g++.old-deja/g++.abi/vtable3i.C
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/testsuite/g++.old-deja/g++.abi/vtable3i.C,v
retrieving revision 1.1
diff -p -u -p -r1.1 vtable3i.C
--- gcc/testsuite/g++.old-deja/g++.abi/vtable3i.C	2001/03/02 00:03:10	1.1
+++ gcc/testsuite/g++.old-deja/g++.abi/vtable3i.C	2001/11/22 20:37:05
@@ -2,6 +2,7 @@
 // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
 
 // Check constructor vtables work.
+// Additional files: vtable3.h
 
 #define B1_EMPTY
 #define B2_EMPTY
Index: gcc/testsuite/g++.old-deja/g++.abi/vtable3j.C
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/testsuite/g++.old-deja/g++.abi/vtable3j.C,v
retrieving revision 1.1
diff -p -u -p -r1.1 vtable3j.C
--- gcc/testsuite/g++.old-deja/g++.abi/vtable3j.C	2001/03/02 00:03:10	1.1
+++ gcc/testsuite/g++.old-deja/g++.abi/vtable3j.C	2001/11/22 20:37:05
@@ -2,6 +2,7 @@
 // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
 
 // Check constructor vtables work.
+// Additional files: vtable3.h
 
 #define B1_EMPTY
 #define B2_EMPTY
Index: gcc/testsuite/lib/old-dejagnu.exp
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/testsuite/lib/old-dejagnu.exp,v
retrieving revision 1.66
diff -p -u -p -r1.66 old-dejagnu.exp
--- gcc/testsuite/lib/old-dejagnu.exp	2001/04/30 22:38:07	1.66
+++ gcc/testsuite/lib/old-dejagnu.exp	2001/11/22 20:37:07
@@ -205,6 +205,7 @@ proc old-dejagnu { compiler prog name cf
 
     set tmp [lindex [grep $prog "Special.*Options:.*"] 0]
     set cflags ""
+    set to_download ""
 
     regsub -all "\n\[^\n\]+(\n|$)" $tmp "\n" tmp
     set tmp [string trim $tmp]
@@ -225,11 +226,27 @@ proc old-dejagnu { compiler prog name cf
     set tmp [string trim $tmp]
     if ![string match "" $tmp] then {
 	regsub "^.*Additional.*sources:" $tmp "" tmp
+	if [is_remote host] {
+	    lappend cflags "additional_flags=$tmp"
+	}
 	regsub -all " " $tmp " [file dirname $prog]/" tmp
-	lappend cflags "additional_flags=$tmp"
+	if ![is_remote host] {
+	    lappend cflags "additional_flags=$tmp"
+	}
+	set to_download [concat $to_download $tmp]
 	verbose "Adding sources $tmp"
     }
 
+    set tmp [lindex [grep $prog "Additional files: .*"] 0]
+    regsub -all "\n\[^\n\]+(\n|$)" $tmp "\n" tmp
+    set tmp [string trim $tmp]
+    if ![string match "" $tmp] then {
+	regsub "^.*Additional.*files:" $tmp "" tmp
+	regsub -all " " $tmp " [file dirname $prog]/" tmp
+	set to_download [concat $to_download $tmp]
+	verbose "Downloading files $tmp"
+    }
+
     lappend cflags "compiler=$compiler"
 
     regsub -all "\[./\]" "$name" "-" output;
@@ -408,6 +425,12 @@ proc old-dejagnu { compiler prog name cf
 #
 #  run the compiler and analyze the results
 #
+    # Download any source or header files we might need.
+    if [is_remote host] {
+	foreach file $to_download {
+	    remote_download host $file
+	}
+    }
 
     # Since we don't check return status of the compiler, make sure
     # we can't run a.out when the compilation fails.
============================================================



More information about the Gcc-patches mailing list