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]

Re: PATCH: Run V3 tests on installed compiler


Phil Edwards wrote:
On Wed, Mar 23, 2005 at 08:50:14AM -0800, Mark Mitchell wrote:

Any objections?


Benjamin has already raised the workflow concerns, which I second.
Making changes to this set of files and then rerunning the testsuite on
the reduced set of tests is SOP for maintainers.  If it's still available,
that would be highly desirable.

See follow-up comments; does the:


normal.exp="`cat testsuite_files`"

thing meet your needs?

(This is, of course, not a V3-specific problem; compiler people like to run just tests in particular categories too.)

(Minor note: libstdc++.exp uses "v3-" as a prefix for some functions;
it should really be using "libstdc++_" as that is the convention for
tool configuration files.)

This convention is documented in lib/libstdc++.exp:

# The naming rule is that dg.exp looks for "tool-" and runtest.exp looks
# for "tool_" when finding callbacks.  Utility routines we define for
# our callbacks begin with "v3-".

(And that third line should have "the use of" prepended, really.)  We wanted
a consistent naming scheme which would be guaranteed to never be found
by DejaGNU.

I'm increasing my dosage of humility pills.


Is this patch OK, assuming testing succeeds?

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304
2005-03-23  Mark Mitchell  <mark@codesourcery.com>

	* testsuite/lib/libstdc++.exp (libstdc++_wchar_t): Rename to ...
	(v3-wchar_t): ... this.
	(libstdc++_threads): Rename to ...
	(v3-threads): ... this.
	(libstdc++_test_objs): Rename to ...
	(v3-test_objs): ... this.
	(libstdc++_build_support): Rename to ...
	(v3-build_support): ... this.
	* testsuite/libstdc++-dg/normal.exp: Adjust to use new names.

Index: lib/libstdc++.exp
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/lib/libstdc++.exp,v
retrieving revision 1.33
diff -c -5 -p -r1.33 libstdc++.exp
*** lib/libstdc++.exp	23 Mar 2005 16:45:44 -0000	1.33
--- lib/libstdc++.exp	23 Mar 2005 20:24:28 -0000
*************** proc libstdc++-dg-test { prog do_what ex
*** 246,273 ****
  
      return [list $comp_output $output_file]
  }
  
  # True if the library supports wchar_t.
! set libstdc++_wchar_t 0
  
  # True if the library supports threads.
! set libstdc++_threads 0
  
  # A string naming object files to be linked into all tests.
! set libstdc++_test_objs ""
  
  # Called from libstdc++-dg-test above.  Calls back into system's
  # target_compile to actually do the work.
  proc v3_target_compile { source dest type options } {
      global gluefile 
      global wrap_flags
      global cxx
      global cxxflags
      global includes
      global blddir
!     global libstdc++_test_objs
  
      if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
          lappend options "libs=${gluefile}"
          lappend options "ldflags=${wrap_flags}"
      }
--- 246,273 ----
  
      return [list $comp_output $output_file]
  }
  
  # True if the library supports wchar_t.
! set v3-wchar_t 0
  
  # True if the library supports threads.
! set v3-threads 0
  
  # A string naming object files to be linked into all tests.
! set v3-test_objs ""
  
  # Called from libstdc++-dg-test above.  Calls back into system's
  # target_compile to actually do the work.
  proc v3_target_compile { source dest type options } {
      global gluefile 
      global wrap_flags
      global cxx
      global cxxflags
      global includes
      global blddir
!     global v3-test_objs
  
      if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
          lappend options "libs=${gluefile}"
          lappend options "ldflags=${wrap_flags}"
      }
*************** proc v3_target_compile { source dest typ
*** 277,321 ****
      set cxx_final [concat $cxx_final $cxxlibglossflags]
      set cxx_final [concat $cxx_final $cxxflags]
      set cxx_final [concat $cxx_final $includes]
      # Link the support objects into executables.
      if { $type == "executable" } {
! 	set cxx_final [concat $cxx_final ${libstdc++_test_objs}]
      }
  
      lappend options "compiler=$cxx_final"
  
      return [target_compile $source $dest $type $options]
  }
  
  # Build the support objects linked in with the libstdc++ tests.  In
! # addition, set libstdc++_wchar_t, libstdc++_threads, and libstdc++_test_objs
  # appropriately.
! proc libstdc++_build_support {} {
      global srcdir
!     global libstdc++_wchar_t
!     global libstdc++_threads
!     global libstdc++_test_objs
  
      # Figure out whether or not the library supports certain features.
!     set libstdc++_wchar_t 0
!     set libstdc++_threads 0
!     set libstdc++_test_objs ""
  
      set config_src "config.cc"
      set f [open $config_src "w"]
      puts $f "#include <bits/c++config.h>"
      close $f
      set preprocessed [v3_target_compile $config_src "" \
  	    	       preprocess "additional_flags=-dN"]
      foreach l $preprocessed {
  	if { [string first "_GLIBCXX_USE_WCHAR_T" $l] != -1 } {
  	    verbose -log "wchar_t support detected"
! 	    set libstdc++_wchar_t 1
  	} elseif { [string first "_GLIBCXX_HAVE_GTHR_DEFAULT" $l] != -1 } {
  	    verbose -log "thread support detected"
! 	    set libstdc++_threads 1
  	}
      }
  
      # Build the support objects.
      set source_files \
--- 277,321 ----
      set cxx_final [concat $cxx_final $cxxlibglossflags]
      set cxx_final [concat $cxx_final $cxxflags]
      set cxx_final [concat $cxx_final $includes]
      # Link the support objects into executables.
      if { $type == "executable" } {
! 	set cxx_final [concat $cxx_final ${v3-test_objs}]
      }
  
      lappend options "compiler=$cxx_final"
  
      return [target_compile $source $dest $type $options]
  }
  
  # Build the support objects linked in with the libstdc++ tests.  In
! # addition, set v3-wchar_t, v3-threads, and v3-test_objs
  # appropriately.
! proc v3-build_support {} {
      global srcdir
!     global v3-wchar_t
!     global v3-threads
!     global v3-test_objs
  
      # Figure out whether or not the library supports certain features.
!     set v3-wchar_t 0
!     set v3-threads 0
!     set v3-test_objs ""
  
      set config_src "config.cc"
      set f [open $config_src "w"]
      puts $f "#include <bits/c++config.h>"
      close $f
      set preprocessed [v3_target_compile $config_src "" \
  	    	       preprocess "additional_flags=-dN"]
      foreach l $preprocessed {
  	if { [string first "_GLIBCXX_USE_WCHAR_T" $l] != -1 } {
  	    verbose -log "wchar_t support detected"
! 	    set v3-wchar_t 1
  	} elseif { [string first "_GLIBCXX_HAVE_GTHR_DEFAULT" $l] != -1 } {
  	    verbose -log "thread support detected"
! 	    set v3-threads 1
  	}
      }
  
      # Build the support objects.
      set source_files \
*************** proc libstdc++_build_support {} {
*** 325,332 ****
  	if { [v3_target_compile $srcdir/$f $object_file "object" \
                 "incdir=$srcdir"] 
  	     != "" } {
  	    error "could not compile $f"
  	}
! 	append libstdc++_test_objs "$object_file "
      }
  }
--- 325,332 ----
  	if { [v3_target_compile $srcdir/$f $object_file "object" \
                 "incdir=$srcdir"] 
  	     != "" } {
  	    error "could not compile $f"
  	}
! 	append v3-test_objs "$object_file "
      }
  }
Index: libstdc++-dg/normal.exp
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/libstdc++-dg/normal.exp,v
retrieving revision 1.5
diff -c -5 -p -r1.5 normal.exp
*** libstdc++-dg/normal.exp	23 Mar 2005 16:45:45 -0000	1.5
--- libstdc++-dg/normal.exp	23 Mar 2005 20:24:28 -0000
***************
*** 20,30 ****
  
  # Initialization.
  dg-init
  
  # Build the support objects.
! libstdc++_build_support
  
  # Find directories that might have tests.
  set subdirs [glob "$srcdir/\[0-9\]\[0-9\]*"]
  foreach d [glob "$srcdir/\[a-z\]*"] {
      if {[file isdirectory $d]} { 
--- 20,30 ----
  
  # Initialization.
  dg-init
  
  # Build the support objects.
! v3-build_support
  
  # Find directories that might have tests.
  set subdirs [glob "$srcdir/\[0-9\]\[0-9\]*"]
  foreach d [glob "$srcdir/\[a-z\]*"] {
      if {[file isdirectory $d]} { 
*************** foreach s $subdirs {
*** 49,60 ****
  	# 2. performance tests.
  	# 3. wchar_t tests, if not supported.
  	# 4. thread tests, if not supported. 
  	if { [string first _xin $t] == -1
  	     && [string first performance $t] == -1
! 	     && (${libstdc++_wchar_t} || [string first wchar_t $t] == -1) 
!              && (${libstdc++_threads} || [string first thread $t] == -1) } {
  	    lappend tests $t
  	}
      }
  }
  set tests [lsort $tests]
--- 49,60 ----
  	# 2. performance tests.
  	# 3. wchar_t tests, if not supported.
  	# 4. thread tests, if not supported. 
  	if { [string first _xin $t] == -1
  	     && [string first performance $t] == -1
! 	     && (${v3-wchar_t} || [string first wchar_t $t] == -1) 
!              && (${v3-threads} || [string first thread $t] == -1) } {
  	    lappend tests $t
  	}
      }
  }
  set tests [lsort $tests]

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