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]

[v3] dejagnu + libgloss, preliminary



last patch was wrong.

tested x86/linux

2001-05-09  Benjamin Kosnik  <bkoz@redhat.com>

	* testsuite/lib/libstdc++.exp: Use libgloss.exp. Call
	libgloss_link_flags to find crt0.o for targets that use libgloss
	instead of newlib.
	Change LDFLAGS to LIBS.
	Consistently name procedures libstdc++-XXX.
	* testsuite/libstdc++.tests/tests.exp: Use new procedure names.

Index: testsuite/lib/libstdc++.exp
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/lib/libstdc++.exp,v
retrieving revision 1.8
diff -c -p -r1.8 libstdc++.exp
*** libstdc++.exp	2001/04/12 13:35:24	1.8
--- libstdc++.exp	2001/05/10 08:54:36
***************
*** 27,34 ****
  ## as follows:
  ##    lib_env(CXX)       	The compiler used to run testcases.
  ##    lib_env(CXXFLAGS)  	Special flags passed to the compiler.
  ##    lib_env(INCLUDES)  	Includes options to pass to the compiler.
! ##    lib_env(LDFLAGS)   	Additional library flags.
  ##    lib_env(LIBTOOL)   	Path to the `libtool' script.
  ##    lib_env(SRC_DIR)   	Where V3 master source lives.
  ##    lib_env(BUILD_DIR) 	Where V3 is built.
--- 27,35 ----
  ## as follows:
  ##    lib_env(CXX)       	The compiler used to run testcases.
  ##    lib_env(CXXFLAGS)  	Special flags passed to the compiler.
+ ##    lib_env(LIBGLOSSFLAGS)  	Flags for finding libgloss-using xcompilers.
  ##    lib_env(INCLUDES)  	Includes options to pass to the compiler.
! ##    lib_env(LIBS)   		Libraries to link, and dditional library flags.
  ##    lib_env(LIBTOOL)   	Path to the `libtool' script.
  ##    lib_env(SRC_DIR)   	Where V3 master source lives.
  ##    lib_env(BUILD_DIR) 	Where V3 is built.
***************
*** 41,46 ****
--- 42,48 ----
  
  
  load_lib dg.exp
+ load_lib libgloss.exp
  
  ## Initialization routine.
  proc libstdc++-dg-init { args } {
*************** proc libstdc++-dg-init { args } {
*** 59,65 ****
      # Set proper environment variables for the framework.
      libstdc++-setup-flags ${src-dir} ${build-dir}
      
!     # mkcheck.in used to output these information.
      set output [remote_exec host $lib_env(CXX) -v]
  # XXX don't try clever formatting hacks at the moment
  #    if { [lindex $output 0] == 0 } {
--- 61,67 ----
      # Set proper environment variables for the framework.
      libstdc++-setup-flags ${src-dir} ${build-dir}
      
!     # mkcheck.in used to output this information.
      set output [remote_exec host $lib_env(CXX) -v]
  # XXX don't try clever formatting hacks at the moment
  #    if { [lindex $output 0] == 0 } {
*************** proc libstdc++-dg-init { args } {
*** 77,86 ****
  ##
  ## This is the heart of the framework.  For the time being, it is
  ## pretty much baroque, but it will improve as time goes.
! proc libstdc++_load { prog } {
      global lib_env
      set opts $lib_env(testcase_options)
!     set results [remote_load target $lib_env(LIBTOOL) "--mode=execute $prog"]
  
      if { [lindex $results 0] == "pass" && [info exists opts(diff)] } {
  	# FIXME: We should first test for any mentioned @output@ file here
--- 79,88 ----
  ##
  ## This is the heart of the framework.  For the time being, it is
  ## pretty much baroque, but it will improve as time goes.
! proc libstdc++-load { prog } {
      global lib_env
      set opts $lib_env(testcase_options)
!     set results [remote_load target $prog]
  
      if { [lindex $results 0] == "pass" && [info exists opts(diff)] } {
  	# FIXME: We should first test for any mentioned @output@ file here
*************** proc libstdc++_load { prog } {
*** 102,112 ****
  }
  
  ## Nothing particular to do.
! proc libstdc++_exit { } {
  }
  
  ## Output the version of the libs tested.
! proc libstdc++_version { } {
      global lib_env
      set version "undeterminated" 
  
--- 104,114 ----
  }
  
  ## Nothing particular to do.
! proc libstdc++-exit { } {
  }
  
  ## Output the version of the libs tested.
! proc libstdc++-version { } {
      global lib_env
      set version "undeterminated" 
  
*************** proc libstdc++_version { } {
*** 124,130 ****
  
  ## Main loop.  Loop over TEST-DIRECTORIES and run each testcase
  ## found therein.
! proc libstdc++_runtest { testdirs } {
      global runtests
      global srcdir
      global outdir
--- 126,132 ----
  
  ## Main loop.  Loop over TEST-DIRECTORIES and run each testcase
  ## found therein.
! proc libstdc++-runtest { testdirs } {
      global runtests
      global srcdir
      global outdir
*************** proc libstdc++_runtest { testdirs } {
*** 150,157 ****
  	    }
  	    
  #	    verbose "Testing [dg-trim-dirname $srcdir $testfile]"
! 	    libstdc++_do_test $testfile static
! 	    libstdc++_do_test $testfile shared
  	}
  	cd ${top-tests-dir}
      }
--- 152,159 ----
  	    }
  	    
  #	    verbose "Testing [dg-trim-dirname $srcdir $testfile]"
! 	    libstdc++-do-test $testfile static
! 	    libstdc++-do-test $testfile shared
  	}
  	cd ${top-tests-dir}
      }
*************** proc libstdc++-dg-test { testfile compil
*** 195,209 ****
  	"link" {
  	    # If we're asked to run a testcase, then just do a `link'.
  	    # Later, the framework will load the program image through
! 	    # libstdc++_load callback.
  	    if { $which_library == "static" } {
  		append output_file ".st-exe"
  	    } else {
  		append output_file ".sh-exe"
  	    }
  	    append lt_args " --mode=link $lib_env(FLAGS) \
! 		    $lib_env($which_library) $testfile \
! 		    -o $output_file $lib_env(LDFLAGS)"
  	}
  	default {
  	    perror "$compile_type: option not recognized"
--- 197,211 ----
  	"link" {
  	    # If we're asked to run a testcase, then just do a `link'.
  	    # Later, the framework will load the program image through
! 	    # libstdc++-load callback.
  	    if { $which_library == "static" } {
  		append output_file ".st-exe"
  	    } else {
  		append output_file ".sh-exe"
  	    }
  	    append lt_args " --mode=link $lib_env(FLAGS) \
! 		    $lib_env(LIBGLOSSFLAGS) $lib_env($which_library) \
! 		    $testfile -o $output_file $lib_env(LIBS)"
  	}
  	default {
  	    perror "$compile_type: option not recognized"
*************** proc libstdc++-setup-flags {src-dir buil
*** 235,242 ****
  	set lib_env(CXX) [lindex $flags 3]
  	set lib_env(CXXFLAGS) [lindex $flags 4]
  	set lib_env(INCLUDES) [lindex $flags 5]
! 	set lib_env(LDFLAGS) [lindex $flags 6]
! 	
  	# This is really really fragile.  We should find a better away to
  	# tell the framework which flags to use for static/shared libraries.
  	set lib_env(static) "-static"
--- 237,245 ----
  	set lib_env(CXX) [lindex $flags 3]
  	set lib_env(CXXFLAGS) [lindex $flags 4]
  	set lib_env(INCLUDES) [lindex $flags 5]
! 	set lib_env(LIBS) [lindex $flags 6]
! 	set lib_env(LIBGLOSSFLAGS) [libgloss_link_flags]
! 
  	# This is really really fragile.  We should find a better away to
  	# tell the framework which flags to use for static/shared libraries.
  	set lib_env(static) "-static"
*************** proc maybe-make-directory {dir} {
*** 256,262 ****
      }
  }
  
! proc libstdc++_do_test { testfile lib } {
      global which_library; set which_library $lib
      ## Is it planed to handle -keep-output throught @xxx@-option
      dg-test -keep-output $testfile "" ""
--- 259,265 ----
      }
  }
  
! proc libstdc++-do-test { testfile lib } {
      global which_library; set which_library $lib
      ## Is it planed to handle -keep-output throught @xxx@-option
      dg-test -keep-output $testfile "" ""
*************** proc dg-test { args } {
*** 402,408 ****
  		perror "$name: $errmsg for \"$op\"\n"
  	    }
  	    # ??? The call to unresolved here is necessary to clear `errcnt'.
! 	    # What we really need is a proc like perror that doesn't set errcnt.
  	    # It should also set exit_status to 1.
  	    unresolved "$name: $errmsg for \"$op\""
  	    return
--- 405,411 ----
  		perror "$name: $errmsg for \"$op\"\n"
  	    }
  	    # ??? The call to unresolved here is necessary to clear `errcnt'.
! 	    # What is needed is a proc like perror that doesn't set errcnt.
  	    # It should also set exit_status to 1.
  	    unresolved "$name: $errmsg for \"$op\""
  	    return
*************** proc dg-test { args } {
*** 546,552 ****
  	    warning "$name compilation failed to produce executable"
  	} else {
  	    set status -1
! 	    set result [${tool}_load $output_file]
  	    set status [lindex $result 0];
  	    set output [lindex $result 1];
  	    #send_user "After exec, status: $status\n"
--- 549,555 ----
  	    warning "$name compilation failed to produce executable"
  	} else {
  	    set status -1
! 	    set result [libstdc++-load $output_file]
  	    set status [lindex $result 0];
  	    set output [lindex $result 1];
  	    #send_user "After exec, status: $status\n"
*************** proc dg-test { args } {
*** 589,595 ****
      # Note that if the program has special run-time requirements, running
      # of the program can be delayed until here.  Ditto for other situations.
      # It would be a bit cumbersome though.
- 
      if ![string match ${dg-final-code} ""] {
  	regsub -all "\\\\(\[{}\])" ${dg-final-code} "\\1" dg-final-code
  	# Note that the use of `args' here makes this a varargs proc.
--- 592,597 ----
*************** proc dg-test { args } {
*** 599,605 ****
  	if [catch "dg-final-proc $prog" errmsg] {
  	    perror "$name: error executing dg-final: $errmsg"
  	    # ??? The call to unresolved here is necessary to clear `errcnt'.
! 	    # What we really need is a proc like perror that doesn't set errcnt.
  	    # It should also set exit_status to 1.
  	    unresolved "$name: error executing dg-final: $errmsg"
  	}
--- 601,607 ----
  	if [catch "dg-final-proc $prog" errmsg] {
  	    perror "$name: error executing dg-final: $errmsg"
  	    # ??? The call to unresolved here is necessary to clear `errcnt'.
! 	    # What is needed is a proc like perror that doesn't set errcnt.
  	    # It should also set exit_status to 1.
  	    unresolved "$name: error executing dg-final: $errmsg"
  	}
Index: testsuite/libstdc++.tests/tests.exp
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/libstdc++.tests/tests.exp,v
retrieving revision 1.4
diff -c -p -r1.4 tests.exp
*** tests.exp	2001/05/01 17:28:02	1.4
--- tests.exp	2001/05/10 08:54:36
*************** remote_exec host ${shell-ulimit-command}
*** 34,40 ****
  remote_exec host ${shell-ulimit-command} "-v ${maximum-memory-usage}"
  
  ## Now, do the work directory by directory
! libstdc++_runtest [glob -nocomplain $srcdir/*]
  dg-finish
  
  
--- 34,40 ----
  remote_exec host ${shell-ulimit-command} "-v ${maximum-memory-usage}"
  
  ## Now, do the work directory by directory
! libstdc++-runtest [glob -nocomplain $srcdir/*]
  dg-finish
  
  


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