This is the mail archive of the gcc-patches@gcc.gnu.org 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]
Other format: [Raw text]

C++ Testsuite PATCH: Remove old-dejagnu.exp


The old-dejagnu.exp driver is old, and, more importantly, not the one
we're using everywhere else.

So, this patch removes it; all the g++.old-deja tests are now dg
tests.

I've tested this by running the tests on i686-pc-linux-gnu, and
looking at many of the modified tests.  (I did the conversion
in a mostly-mechanical fashion of course.)

However, it's likely that I've blown something somewhere on some
platform; if you're getting new test failures, send me a target
triplet and the name of the test that's failing and I'll try to figure
it out.

I've only included the part of the diffs that affects the test
drivers; the testsuite changes themselves are too big, even when
compressed.

Installed on the mainline.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

2003-04-30  Mark Mitchell  <mark@codesourcery.com>

	* lib/g++-dg.exp (g++-dg-test): Add "repo" option.
	(dg-gpp-additional-sources): New function.
	(dg-gpp-additional-files): Likewise.
	* lib/g++.exp (additional_sources): New variable.
	(additional_files): Likewise.
	(g++_target_compile): Deal with them.
	* lib/old-dejagnu.exp: Remove.
	* g++.old-deja/old-deja.exp: Use dg.exp, not old-dejagnu.exp.
	* g++.old-deja: Revise all tests to use dg commands.

Index: lib/g++-dg.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/g++-dg.exp,v
retrieving revision 1.8
diff -c -5 -p -r1.8 g++-dg.exp
*** lib/g++-dg.exp	2 Mar 2003 01:52:46 -0000	1.8
--- lib/g++-dg.exp	1 May 2003 01:56:26 -0000
***************
*** 1,6 ****
! #   Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
  
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
  # the Free Software Foundation; either version 2 of the License, or
  # (at your option) any later version.
--- 1,6 ----
! #   Copyright (C) 1997, 1999, 2000, 2003 Free Software Foundation, Inc.
  
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
  # the Free Software Foundation; either version 2 of the License, or
  # (at your option) any later version.
*************** load_lib target-supports.exp
*** 22,31 ****
--- 22,41 ----
  load_lib scanasm.exp
  
  proc g++-dg-test { prog do_what extra_tool_flags } {
      # Set up the compiler flags, based on what we're going to do.
  
+     set options [list]
+ 
+     # Tests should be able to use "dg-do repo".  However, the dg test
+     # driver checks the argument to dg-do against a list of acceptable
+     # options, and "repo" is not among them.  Therefore, we resort to
+     # this ugly approach.
+     if [string match "*-frepo*" $extra_tool_flags] then {
+ 	set do_what "repo"
+     }
+ 
      switch $do_what {
  	"preprocess" {
  	    set compile_type "preprocess"
  	    set output_file "[file rootname [file tail $prog]].i"
  	}
*************** proc g++-dg-test { prog do_what extra_to
*** 45,54 ****
--- 55,68 ----
  	    set compile_type "executable"
  	    set output_file "[file rootname [file tail $prog]].exe"
  	    # The following line is needed for targets like the i960 where
  	    # the default output file is b.out.  Sigh.
  	}
+ 	"repo" {
+ 	    set compile_type "object"
+ 	    set output_file "[file rootname [file tail $prog]].o"
+ 	}
  	"run" {
  	    set compile_type "executable"
  	    # FIXME: "./" is to cope with "." not being in $PATH.
  	    # Should this be handled elsewhere?
  	    # YES.
*************** proc g++-dg-test { prog do_what extra_to
*** 60,76 ****
  	default {
  	    perror "$do_what: not a valid dg-do keyword"
  	    return ""
  	}
      }
!     set options ""
      if { $extra_tool_flags != "" } {
  	lappend options "additional_flags=$extra_tool_flags"
      }
  
      set comp_output [g++_target_compile "$prog" "$output_file" "$compile_type" $options];
  
      return [list $comp_output $output_file]
  }
  
  
  proc g++-dg-prune { system text } {
--- 74,97 ----
  	default {
  	    perror "$do_what: not a valid dg-do keyword"
  	    return ""
  	}
      }
! 
      if { $extra_tool_flags != "" } {
  	lappend options "additional_flags=$extra_tool_flags"
      }
  
      set comp_output [g++_target_compile "$prog" "$output_file" "$compile_type" $options];
  
+     if { $do_what == "repo" } {
+ 	set object_file "$output_file"
+ 	set output_file "[file rootname [file tail $prog]].exe"
+ 	concat comp_output \
+ 	       [g++_target_compile "$object_file" "$output_file" "executable" $options]
+     }
+ 
      return [list $comp_output $output_file]
  }
  
  
  proc g++-dg-prune { system text } {
*************** proc g++-dg-prune { system text } {
*** 84,88 ****
--- 105,126 ----
  	return "::unsupported::memory full"
      }
  
      return $text
  }
+ 
+ # Record additional sources files that must be compiled along with the
+ # main source file.
+ 
+ proc dg-gpp-additional-sources { args } {
+     global additional_sources
+     set additional_sources [lindex $args 1]
+ }
+ 
+ # Record additional files -- other than source files -- that must be
+ # present on the system where the compiler runs.
+ 
+ proc dg-gpp-additional-files { args } {
+     global additional_files
+     set additional_files [lindex $args 1]
+ }
+ 
Index: lib/g++.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/g++.exp,v
retrieving revision 1.28
diff -c -5 -p -r1.28 g++.exp
*** lib/g++.exp	18 Dec 2002 15:50:40 -0000	1.28
--- lib/g++.exp	1 May 2003 01:56:26 -0000
***************
*** 1,6 ****
! # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002
  # Free Software Foundation, Inc.
  
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
  # the Free Software Foundation; either version 2 of the License, or
--- 1,6 ----
! # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003
  # Free Software Foundation, Inc.
  
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
  # the Free Software Foundation; either version 2 of the License, or
*************** load_lib gcc-defs.exp
*** 29,39 ****
  # GXX_UNDER_TEST is the compiler under test.
  #
  
  
  set gpp_compile_options ""
! 
  
  #
  # g++_version -- extract and print the version number of the compiler
  #
  
--- 29,40 ----
  # GXX_UNDER_TEST is the compiler under test.
  #
  
  
  set gpp_compile_options ""
! set additional_sources ""
! set additional_files ""
  
  #
  # g++_version -- extract and print the version number of the compiler
  #
  
*************** proc g++_target_compile { source dest ty
*** 303,313 ****
  	 [regexp "\.o(|bj)$" $dest] } then {
  	regsub "\.o(|bj)$" $dest ".rpo" rponame
  	exec rm -f $rponame
      }
  
!     return [target_compile $source $dest $type $options]
  }
  
  #
  # ${tool}_option_help
  #
--- 304,342 ----
  	 [regexp "\.o(|bj)$" $dest] } then {
  	regsub "\.o(|bj)$" $dest ".rpo" rponame
  	exec rm -f $rponame
      }
  
!     global additional_sources
!     global additional_files
!     set to_download ""
!     if { $additional_sources != "" } then {
! 	if [is_remote host] {
! 	    lappend options "additional_flags=$additional_sources"
! 	}
! 	regsub -all " " $additional_sources " [file dirname $source]/" additional_sources
! 	if ![is_remote host] {
! 	    lappend options "additional_flags=$additional_sources"
! 	}
! 	set to_download [concat $to_download $additional_sources]
!     }
!     if { $additional_files != "" } then { 
! 	regsub -all " " $additional_files " [file dirname $source]/" additional_files
! 	set to_download [concat $to_download $additional_files]
!     }
!     if [is_remote host] {
! 	foreach file $to_download {
! 	    remote_download host $file
! 	}
!     }
! 
!     set result [target_compile $source $dest $type $options]
! 
!     set additional_sources ""
!     set additional_files ""
! 
!     return $result
  }
  
  #
  # ${tool}_option_help
  #
Index: lib/old-dejagnu.exp
===================================================================
RCS file: lib/old-dejagnu.exp
diff -N lib/old-dejagnu.exp
*** lib/old-dejagnu.exp	15 Sep 2002 18:52:51 -0000	1.26
--- /dev/null	1 Jan 1970 00:00:00 -0000
***************
*** 1,606 ****
- # Copyright (C) 1988, 90, 91, 92, 1994, 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
- 
- # This program is free software; you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation; either version 2 of the License, or
- # (at your option) any later version.
- # 
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- # GNU General Public License for more details.
- # 
- # You should have received a copy of the GNU General Public License
- # along with this program; if not, write to the Free Software
- # Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- 
- # This file was written by Rob Savoye. (rob@cygnus.com)
- # With modifications by Mike Stump <mrs@cygnus.com>.
- 
- # These tests come from the original DejaGnu test suite 
- # developed at Cygnus Support. If this isn't deja gnu, I
- # don't know what is.
- #
- # Language independence is achieved by:
- #
- # 1) Using global $tool to indicate the language (eg: gcc, g++, etc.).
- #    This should only be used to look up other objects.  We don't want to
- #    have to add code for each new language that is supported.  If this is
- #    done right, no code needs to be added here for each new language.
- #
- # 2) Passing compiler options in as arguments.
- #
- # We require a bit of smarts in our caller to isolate us from the vagaries of
- # each language.  See old-deja.exp for the g++ example.
- 
- # Useful subroutines.
- 
- # process-option -- Look for and process a test harness option in the testcase.
- #
- # PROG is the pathname of the testcase.
- # OPTION is the string to look for.
- # MESSAGE is what to print if $verbose > 1.
- # FLAG_NAME is one of ERROR, WARNING, etc.
- # PATTERN is ???
- 
- proc process-option { prog option message flag_name pattern } {
-     global verbose
- 
-     set result ""
- 
-     set tmp [grep $prog "$option.*" line]
-     if ![string match "" $tmp] then {
- 	foreach i $tmp {
- 	    #send_user "Found: $i\n"
- 	    set xfail_test 0
- 	    set triplet_match 0
- 	    regsub "\\*/$" [string trim $i] "" i
- 	    if [regexp "LINE +\[0-9\]+" $i xopt] then {
- 		regsub "LINE" $xopt "" xopt;
- 		regsub "LINE +\[0-9\]+" $i "" i
- 		set i [lreplace $i 0 0 [expr "${xopt}-0"]];
- 	    }
- 	    if [regexp "XFAIL( +\[^ \]+-\[^ \]+-\[^ \]+)*" $i xopt] then {
- 		set xfail_test 1
- 		regsub "XFAIL( +\[^ \]+-\[^ \]+-\[^ \]+)*" $i "" i
- 		regsub "XFAIL" $xopt "" xopt
- 		if ![string match "" [string trim $xopt]] then {
- 		    foreach triplet $xopt {
- 			if [istarget $triplet] {
- 			    set triplet_match 1;
- 			    break;
- 			}
- 		    }
- 		} else {
- 		    set triplet_match 1
- 		}
- 	    }
- 	    set compos [expr [llength $option] + 1] ;# Start of comment, if any
- 	    if { $xfail_test && $triplet_match } then {
- 		lappend result [list [lindex $i 0] "X$flag_name" [lrange $i $compos end] "$pattern"]
- 	    } else {
- 		lappend result [list [lindex $i 0] "$flag_name" [lrange $i $compos end] "$pattern"]
- 	    }
- 	    if { $verbose > 1 } then {
- 		if [string match "" [lrange $i $compos end]] then {
- 		    send_user "Found $message for line [lindex $i 0]\n"
- 		} else {
- 		    send_user "Found $message \"[lrange $i $compos end]\" for line [lindex $i 0]\n"
- 		}
- 	    }
- 	}
-     }
- 
-     #send_user "Returning: $result\n"
-     return $result
- }
- 
- # old-dejagnu-init -- set up some statistics collectors
- #
- # There currently isn't much to do, but always calling it allows us to add
- # enhancements without having to update our callers.
- # It must be run before calling `old-dejagnu'.
- 
- proc old-dejagnu-init { } {
- }
- 
- # old-dejagnu-stat -- print the stats of this run
- #
- # ??? This is deprecated, and can be removed.
- 
- proc old-dejagnu-stat { } {
- }
- 
- # old-dejagnu -- runs an old style DejaGnu test.
- #
- # Returns 0 if successful, 1 if their were any errors.
- # PROG is the full path name of the file to compile.
- #
- # CFLAGSX is the options to always pass to the compiler.
- #
- # DEFAULT_CFLAGS are additional options if the testcase has none.
- #
- # LIBS_VAR is the name of the global variable containing libraries (-lxxx's).
- # This is also ignored.
- #
- # LIBS is any additional libraries to link with.  This *cannot* be specified
- # with the compiler flags because otherwise gcc will issue, for example, a
- # "-lg++ argument not used since linking not done" warning which will screw up
- # the test for excess errors.  We could ignore such messages instead.
- #
- # Think of "cflags" here as "compiler flags", not "C compiler flags".
- 
- proc old-dejagnu { compiler prog name cflagsx default_cflags libs } {
-     global verbose
-     global tool
-     global subdir		;# eg: g++.old-dejagnu
-     global host_triplet
-     global tmpdir
- 
-     set runflag 1
-     set execbug_flag 0
-     set excessbug_flag 0
-     set pattern ""
-     set text "\[- A-Za-z0-9\.\;\"\_\:\'\`\(\)\!\#\=\+\?\&\*]*"
- 
-     if ![info exists tmpdir] then {
- 	set tmpdir "/tmp"
-     }
- 
- # look for keywords that change the compiler options
- #
- # There are two types of test, negative and affirmative. Negative
- # tests have the keyword of "ERROR - " or "WARNING - " on the line
- # expected to produce an error. This is followed by the pattern. If
- # the desired error or warning message appears, then the test passes.
- # 
- # Affirmative test can have the following keywords "gets bogus error",
- # "causes invalid C code", "invalid assembly code", "causes abort",
- # "causes segfault", "causes linker error", "execution test fails". If
- # the pattern after the keyword matches, then the test is a failure.
- #
- # One can specify particular targets for expected failures of the above
- # keywords by putting "XFAIL target-triplet" after the keyword.
- #
- # Example:
- #
- # void f ()
- #{
- #  int i[2], j;
- #  A a (int (i[1]), j);		// gets bogus error - late parsing XFAIL *-*-*
- #  A b (int (i[1]), int j);	// function
- #  a.k = 0;			// gets bogus error - late parsing XFAIL *-*-*
- #  b (i, j);
- #}
- #
- # Note also, that one can add a comment with the keyword ("late parsing"
- # in the above example).
- #
- # If any of the tests contain the special pattern "FIXME -" that test is
- # not run because it will produce incorrect output.
- #
- # Testcases can supply special options to the compiler with a line containing
- # "Special.*Options: ...", where ".*" can be anything (eg: g++) and "..." are
- # the additional options to pass to the compiler.  Nothing else may appear
- # after the options.  IE: for a C testcase
- # /* Special Options: -fomit-frame-pointer */  /* Oops! */
- # is wrong,
- # /* Special Options: -fomit-frame-pointer */
- # is right.  If no such Special Options are found, $default_cflags is used.
- # FIXME: Can there be multiple lines of these?
- #
- # Other keywords: "Build don't link:", "Build don't run:", "Build then link:",
- #                 "Additional sources: <file>.cc ..."
- 
- # $name is now passed in.
- #    set name "[file tail [file dirname $prog]]/[file tail $prog]"
- 
-     set tmp [grep $prog "FIXME -.*"]
-     if ![string match "" $tmp] then {
- 	foreach i $tmp {
- 	    warning "[file tail [file dirname $prog]]/[file tail $prog] [lrange $i 2 end]"
- 	}
- 	return 1
-     }
- 
-     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]
-     if ![string match "" $tmp] then {
- 	regsub "^.*Special.*Options:" $tmp "" tmp
- 	lappend cflags "additional_flags=$tmp"
- 	verbose "Adding special options $tmp" 2
-     } else {
- 	lappend cflags "additional_flags=$default_cflags"
-     }
- 
-     if { $cflagsx != "" } {
- 	lappend cflags "additional_flags=$cflagsx"
-     }
- 
-     set tmp [lindex [grep $prog "Additional sources: .*"] 0]
-     regsub -all "\n\[^\n\]+(\n|$)" $tmp "\n" tmp
-     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
- 	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;
-     set output "$tmpdir/$output.exe";
-     set compile_type "executable"
- 
-     set tmp [lindex [grep $prog "Build don.t link:"] 0]
-     if ![string match "" $tmp] then {
- 	set compile_type "object"
- 	set runflag 0
- 	set output "$tmpdir/[file tail [file rootname $prog]].o"
- 	verbose "Will compile $prog to object" 3
-     }
- 
-     set tmp [lindex [grep $prog "Build then link:"] 0]
-     if ![string match "" $tmp] then {
- 	set compile_type "object"
- 	set runflag 2
- 	set final_output "$output"
- 	set output "$tmpdir/[file tail [file rootname $prog]].o"
- 	verbose "Will compile $prog to object, then link it" 3
-     }	
- 
-     set tmp [lindex [grep $prog "Build don.t run:"] 0]
-     if ![string match "" $tmp] then {
- 	set runflag 0
- 	verbose "Will compile $prog to binary" 3
-     }
- 
-     set tmp [grep $prog "Skip if (|not )feature:.*"];
-     if { $tmp != "" } {
- 	foreach line $tmp {
- 	    if [regexp "Skip if not feature" $line] {
- 		set not 1;
- 	    } else {
- 		set not 0;
- 	    }
- 	    regsub "^.*Skip if (|not )feature:\[ 	\]*" "$line" "" i;
- 	    set is_set 0;
- 	    foreach j $i {
- 		if [target_info exists $j] {
- 		    set is_set 1;
- 		    break;
- 		}
- 	    }
- 	    if { $is_set != $not } {
- 		untested "$name: Test skipped: ${line}($j set)"
- 		return;
- 	    }
- 	}
-     }
- 
-     set tmp [grep $prog "Skip if (|not )target:.*"];
-     if { $tmp != "" } {
- 	foreach line $tmp {
- 	    if [regexp "Skip if not target:" $line] {
- 		set not 1;
- 	    } else {
- 		set not 0;
- 	    }
- 	    regsub "^.*Skip if (|not )target:\[ 	\]*" "$line" "" i;
- 	    set ist 0;
- 	    foreach j $i {
- 		if [istarget $j] {
- 		    set ist 1;
- 		    break;
- 		}
- 	    }
- 	    if { $ist != $not } {
- 		untested "$name: Test skipped: ${line}"
- 		return;
- 	    }
- 	}
-     }
- 
-     if ![isnative] {
- 	set tmp [lindex [grep $prog "Skip if not native"] 0];
- 	if { $tmp != "" } {
- 	    untested "$name: Test skipped because not native";
- 	    return;
- 	}
-     } else {
- 	set tmp [lindex [grep $prog "Skip if native"] 0];
- 	if { $tmp != "" } {
- 	    untested "$name: Test skipped because native";
- 	    return;
- 	}
-     }
- 
-     lappend cflags "libs=$libs"
- 
- #
- # Look for the other keywords and extract the error messages.
- # `message' contains all the things we found.
- # ??? We'd like to use lappend below instead of concat, but that doesn't
- # work (adds an extra level of nesting to $tmp).
- #
- 
-     set message ""
- 
-     set tmp [process-option $prog "ERROR - " "an error message" ERROR "$text error$text"]
-     if ![string match "" $tmp] then {
- 	set runflag 0
- 	set message [concat $message $tmp]
-     }
- 
-     set tmp [process-option $prog "WARNING - " "a warning message" WARNING "warning"]
-     if ![string match "" $tmp] then {
- 	set runflag 0
- 	set message [concat $message $tmp]
-     }
- 
-     set tmp [process-option $prog "gets bogus error" "a bogus error" BOGUS $text]
-     if ![string match "" $tmp] then {
- 	set message [concat $message $tmp]
-     }
- 
-     set tmp [process-option $prog "causes invalid C code" "a bad C translation" BADC $text]
-     if ![string match "" $tmp] then {
- 	set message [concat $message $tmp]
-     }
- 
-     set tmp [process-option $prog "invalid assembly code" "some invalid assembly code" BADASM $text]
-     if ![string match "" $tmp] then {
- 	set message [concat $message $tmp]
-     }
- 
-     set tmp [process-option $prog "causes abort" "an abort cause" ABORT $text]
-     if ![string match "" $tmp] then {
- 	set message [concat $message $tmp]
-     }
- 
-     set tmp [process-option $prog "causes segfault" "a segfault cause" SEGFAULT $text]
-     if ![string match "" $tmp] then {
- 	set message [concat $message $tmp]
-     }
- 
-     set tmp [process-option $prog "causes linker error" "a linker error" LINKER $text]
-     if ![string match "" $tmp] then {
- 	set message [concat $message $tmp]
-     }
- 
-     set tmp [process-option $prog "execution test fails" "an execution failure" EXECO $text]
-     if ![string match "" $tmp] then {
- 	set execbug_flag 1
- 	set message [concat $message $tmp]
- 	warning "please use execution test - XFAIL *-*-* in $prog instead"
-     }
- 
-     set tmp [process-option $prog "execution test - " "an excess error failure" EXEC $text]
-     if ![string match "" $tmp] then {
- 	set message [concat $message $tmp]
-     }
- 
-     set tmp [process-option $prog "excess errors test fails" "an excess error failure" EXCESSO $text]
-     if ![string match "" $tmp] then {
- 	set excessbug_flag 1
- 	set message [concat $message $tmp]
- 	warning "please use excess errors test - XFAIL *-*-* in $prog instead"
-     }
- 
-     set tmp [process-option $prog "excess errors test - " "an excess error failure" EXCESS $text]
-     if ![string match "" $tmp] then {
- 	set message [concat $message $tmp]
-     }
- 
-     set expect_crash \
-       [process-option $prog "crash test - " "a crash" CRASH $text]
-     if {$expect_crash != "" 
-         && [lindex [lindex $expect_crash 0] 1] == "XCRASH"} then {
-        set expect_crash 1
-     } else {
-        set expect_crash 0
-     }
- 
- #
- #  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.
-     remote_file build delete $output
-     set comp_output [${tool}_target_compile $prog $output $compile_type $cflags]
-     if { $runflag == 2 && [file exists $output] } then {
- 	set runflag 0
- 	set comp_output [concat $comp_output [${tool}_target_compile $output $final_output "executable" $cflags]]
- 	set output $final_output
-     }
- 
-     # Delete things like "ld.so: warning" messages.
-     set comp_output [prune_gcc_output [prune_warnings $comp_output]]
- 
-     if [regexp "\[Ii\]nternal (compiler )?error" $comp_output] then {
-         if $expect_crash then {
- 	    setup_xfail "*-*-*"
- 	}
-         fail "$name caused compiler crash"
-         remote_file build delete $output
-         return 1
-     }
- 
-     #send_user "\nold_dejagnu.exp: comp_output1 = :$comp_output:\n\n"
-     #send_user "\nold_dejagnu.exp: message = :$message:\n\n"
-     #send_user "\nold_dejagnu.exp: message length = [llength $message]\n\n"
- 
-     set last_line 0
-     foreach i $message {
- 
- 	#send_user "\nold_dejagnu.exp: i = :$i:\n\n"
- 
- 	# Remove all error messages for the line [lindex $i 0]
- 	# in the source file.  If we find any, success!
- 	set line [lindex $i 0]
- 	set pattern [lindex $i 2]
- 
- 	# Multiple tests one one line don't work, because we remove all 
- 	# messages on the line for the first test.  So skip later ones.
- 	if { $line == $last_line } {
- 	    continue
- 	}
- 	set last_line $line
- 
- 	if [regsub -all "(^|\n)\[^\n\]+:$line:\[^\n\]*" $comp_output "" comp_output] {
-             set comp_output [string trimleft $comp_output]
- 	    set ok pass
- 	    set uhoh fail
- 	} else {
- 	    set ok fail
- 	    set uhoh pass
- 	}
- 
- 	case [lindex $i 1] {
- 	    "ERROR" {
- 		$ok "$name $pattern (test for errors, line $line)"
- 	    }
- 	    "XERROR" {
- 		x$ok "$name $pattern (test for errors, line $line)"
- 	    }
- 	    "WARNING" {
- 		$ok "$name $pattern (test for warnings, line $line)"
- 	    }
- 	    "XWARNING" {
- 		x$ok "$name $pattern (test for warnings, line $line)"
- 	    }
- 	    "BOGUS" {
- 		$uhoh "$name $pattern (test for bogus messages, line $line)"
- 	    }
- 	    "XBOGUS" {
- 		x$uhoh "$name $pattern (test for bogus messages, line $line)"
- 	    }
- 	    "ABORT" {
- 		$uhoh "$name $pattern (test for compiler aborts, line $line)"
- 	    }
- 	    "XABORT" {
- 		x$uhoh "$name $pattern (test for compiler aborts, line $line)"
- 	    }
- 	    "SEGFAULT" {
- 		$uhoh "$name $pattern (test for compiler segfaults, line $line)"
- 	    }
- 	    "XSEGFAULT" {
- 		x$uhoh "$name $pattern (test for compiler segfaults, line $line)"
- 	    }
- 	    "LINKER" {
- 		$uhoh "$name $pattern (test for linker problems, line $line)"
- 	    }
- 	    "XLINKER" {
- 		x$uhoh "$name $pattern (test for linker problems, line $line)"
- 	    }
- 	    "BADC" {
- 		$uhoh "$name $pattern (test for Bad C code, line $line)"
- 	    }
- 	    "XBADC" {
- 		x$uhoh "$name $pattern (test for Bad C code, line $line)"
- 	    }
- 	    "BADASM" {
- 		$uhoh "$name $pattern (test for bad assembler, line $line)"
- 	    }
- 	    "XBADASM" {
- 		x$uhoh "$name $pattern (test for bad assembler, line $line)"
- 	    }
- 	    "XEXEC" {
- 		set execbug_flag 1
- 	    }
- 	    "XEXCESS" {
- 		set excessbug_flag 1
- 	    }
- 	}
- 	#send_user "\nold_dejagnu.exp: comp_output2= :$comp_output:\n\n"
-     }
-     #send_user "\nold_dejagnu.exp: comp_output3 = :$comp_output:\n\n"
- 
-     #look to see if this is all thats left, if so, all messages have been handled
-     #send_user "comp_output: $comp_output\n"
-     regsub -all "(^|\n)\[^\n\]*: In (\[^\n\]*function|method|\[^\n\]*structor) \[^\n\]*" $comp_output "" comp_output
-     regsub -all "(^|\n)\[^\n\]*: In instantiation of \[^\n\]*" $comp_output "" comp_output
-     regsub -all "(^|\n)\[^\n\]*:   instantiated from \[^\n\]*" $comp_output "" comp_output
-     regsub -all "(^|\n)\[^\n\]*: At (top level|global scope):\[^\n\]*" $comp_output "" comp_output
-     regsub -all "(^|\n)\[^\n\]*file path prefix \[^\n\]* never used" $comp_output "" comp_output
-     regsub -all "(^|\n)\[^\n\]*linker input file unused since linking not done" $comp_output "" comp_output
-     regsub -all "(^|\n)collect: re(compiling|linking)\[^\n\]*" $comp_output "" comp_output
- 
-     set unsupported_message [${tool}_check_unsupported_p $comp_output]
-     if { $unsupported_message != "" } {
- 	unsupported "$name: $unsupported_message"
- 	return
-     }
- 
-     # someone forgot to delete the extra lines
-     regsub -all "\n+" $comp_output "\n" comp_output
-     regsub "^\n+" $comp_output "" comp_output
-     #send_user "comp_output: $comp_output\n"
-     
-     # excess errors
-     if $excessbug_flag then {
- 	setup_xfail "*-*-*"
-     }
-     if ![string match "" $comp_output] then {
- 	fail "$name (test for excess errors)"
- 	send_log "$comp_output\n"
-     } else {
- 	pass "$name (test for excess errors)"
-     }
- 
-     # run the executable image
-     if $runflag then {
- 	set executable $output
- 	if ![file exists $executable] then {
- 	    # Since we couldn't run it, we consider it an expected failure,
- 	    # so that test cases don't appear to disappear, and reappear.
- 	    setup_xfail "*-*-*"
- 	    fail "$name $pattern Execution test"
- 	} else {
- 	    set status -1
- 	    set result [eval [format "%s_load %s" $tool $executable]]
- 	    set status [lindex $result 0];
- 	    set output [lindex $result 1];
- 	    if { $status == "pass" } {
- 		remote_file build delete $executable;
- 	    }
- 	    if { $execbug_flag || $excessbug_flag } then {
- 		setup_xfail "*-*-*"
- 	    }
- 	    $status "$name $pattern Execution test"
- 	}
-     } else {
-       verbose "deleting $output"
-       remote_file build delete $output
-     }
- 
-     return 0
- }
--- 0 ----
Index: g++.old-deja/old-deja.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/old-deja.exp,v
retrieving revision 1.7
diff -c -5 -p -r1.7 old-deja.exp
*** g++.old-deja/old-deja.exp	9 Oct 2001 10:16:17 -0000	1.7
--- g++.old-deja/old-deja.exp	1 May 2003 01:56:26 -0000
***************
*** 1,6 ****
! # Copyright (C) 1988, 90, 91, 92, 1994, 1997, 2000 Free Software Foundation, Inc.
  
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
  # the Free Software Foundation; either version 2 of the License, or
  # (at your option) any later version.
--- 1,6 ----
! # Copyright (C) 1988, 90, 91, 92, 1994, 1997, 2000, 2003 Free Software Foundation, Inc.
  
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
  # the Free Software Foundation; either version 2 of the License, or
  # (at your option) any later version.
***************
*** 12,62 ****
  # 
  # You should have received a copy of the GNU General Public License
  # along with this program; if not, write to the Free Software
  # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
  
! # This file was written by Rob Savoye. (rob@cygnus.com)
! 
! #
! # these tests come from the original DejaGnu test suite 
! # developed at Cygnus Support. If this isn't deja gnu, I
! # don't know what is...
! #
! 
! # load support procs
! load_lib old-dejagnu.exp
! load_lib g++.exp
! 
! 
! # When a testcase doesn't have any special options, use these.
! if ![info exists DEFAULT_CXXFLAGS] {
!     set DEFAULT_CXXFLAGS "-ansi -pedantic-errors -Wno-long-long"
  
  }
  
! old-dejagnu-init
! global GXX_UNDER_TEST
  
! #
! # main test loop
! #
! 
! set dirlen [expr [string length "$srcdir/$subdir"] + 1];
! foreach file [lsort [find $srcdir/$subdir *.C]] {
!     # If we're only testing specific files and this isn't one of them, skip it.
!     set tfile [string range $file $dirlen end];
!     if ![runtest_file_p $runtests $tfile] then {
! 	continue
!     }
!     verbose "Testing $file"
! 
!     # We don't want old-dejagnu.exp to have to know about all the global
!     # variables we use.  For now we tell it about CXXFLAGS and LIBS and
!     # leave LDFLAGS alone.
!     old-dejagnu $GXX_UNDER_TEST "$file" "$tfile" "" "$DEFAULT_CXXFLAGS" "-lstdc++"
  }
  
! # The framework doesn't like to see any error remnants,
! # so remove them.
! if [info exists errorInfo] then {
!       unset errorInfo
! }
--- 12,48 ----
  # 
  # You should have received a copy of the GNU General Public License
  # along with this program; if not, write to the Free Software
  # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
  
! # Load support procs.
! load_lib g++-dg.exp
  
+ # If a testcase doesn't have special options, use these.
+ global DEFAULT_CXXFLAGS
+ if ![info exists DEFAULT_CXXFLAGS] then {
+     set DEFAULT_CXXFLAGS " -ansi -pedantic-errors -Wno-long-long"
  }
  
! # Initialize `dg'.
! dg-init
  
! # Gather a list of all tests, with the exception of those in directories
! # that are handled specially.
! set tests [lsort [find $srcdir/$subdir *.C]]
! 
! proc g++-dg-prune { system text } {
!     regsub -all "(^|\n)\[^\n\]*: In (\[^\n\]*function|method|\[^\n\]*structor) \[^\n\]*" $text "" text
!     regsub -all "(^|\n)\[^\n\]*: In instantiation of \[^\n\]*" $text "" text
!     regsub -all "(^|\n)\[^\n\]*:   instantiated from \[^\n\]*" $text "" text
!     regsub -all "(^|\n)\[^\n\]*: At (top level|global scope):\[^\n\]*" $text "" text
!     regsub -all "(^|\n)\[^\n\]*file path prefix \[^\n\]* never used" $text "" text
!     regsub -all "(^|\n)\[^\n\]*linker input file unused since linking not done" $text "" text
!     regsub -all "(^|\n)collect: re(compiling|linking)\[^\n\]*" $text "" text
!     return $text
  }
  
! # Main loop.
! dg-runtest $tests "" $DEFAULT_CXXFLAGS
! 
! # All done.
! dg-finish


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