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] activate dejagnu



...now use dejagnu for libstdc++-v3's 'make check'

The old, script-based interface rules got changed to

check-script
check-script-install

and still works. 

Still some issues, but I'm thinking it might make more sense to enable
now anyway and plow ahead.

known bugs:

1) running 'make check' from the target subdir can't find runtest
2) not properly diffing expected output
3) need to go through and mark expected fails in testsuite
4) xcompilers, as of yet, aren't tested and may not work.

-benjamin


2001-03-28  Benjamin Kosnik  <bkoz@redhat.com>

	* mkcheck.in (LIBTOOL): Don't construct -B argument here...
	* tests_flags.in (CXX): Construct here.
	(static_fail): Don't remove compile.out. Format with spaces.
	* testsuite/Makefile.am: Snake libjava configury.
	* testsuite/Makefile.in: Regenerate.
	
2001-03-28  Gabriel Dos Reis  <gdr@merlin.codesourcery.com>

	Enable dejagnu testing framework.
	* configure.in: Generate testsuite/Makefile.
	* configure: Regenerate.
	* Makefile.am (check-install): Change rule from this...
	(check-script-install): ...to this.
	(check): Change rule from this...
	(check-script):...to this.
	* Makefile.in: Regenerate.
	
Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/Makefile.am,v
retrieving revision 1.18
diff -c -p -r1.18 Makefile.am
*** Makefile.am	2001/03/25 02:28:06	1.18
--- Makefile.am	2001/03/29 00:38:57
***************
*** 24,43 ****
  AUTOMAKE_OPTIONS = 1.3 cygnus
  MAINT_CHARSET = latin1
  
! SUBDIRS = libio libmath libsupc++ src
  
  mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
  
  # Use $${builddir} instead of $(top_builddir) for arguments to "mkcheck"
  # because then the paths will be full pathnames, not relative
  # pathnames. (-Wl,--rpath seems to like this better.)
! check: $(top_builddir)/mkcheck
  	-(chmod + $(top_builddir)/mkcheck; \
  	  srcdir=`cd $(top_srcdir); pwd`; builddir=`pwd`; \
  	  test -d testsuite || (mkdir testsuite; chmod u+w testsuite); \
  	  cd testsuite; $${builddir}/mkcheck 0 $${builddir} $${srcdir})
  
! check-install: $(top_builddir)/mkcheck
  	-(chmod + $(top_builddir)/mkcheck; \
  	  srcdir=`cd $(top_srcdir); pwd`; builddir=`pwd`; \
  	  test -d testsuite || (mkdir testsuite; chmod u+w testsuite); \
--- 24,43 ----
  AUTOMAKE_OPTIONS = 1.3 cygnus
  MAINT_CHARSET = latin1
  
! SUBDIRS = libio libmath libsupc++ src testsuite
  
  mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
  
  # Use $${builddir} instead of $(top_builddir) for arguments to "mkcheck"
  # because then the paths will be full pathnames, not relative
  # pathnames. (-Wl,--rpath seems to like this better.)
! check-script: $(top_builddir)/mkcheck
  	-(chmod + $(top_builddir)/mkcheck; \
  	  srcdir=`cd $(top_srcdir); pwd`; builddir=`pwd`; \
  	  test -d testsuite || (mkdir testsuite; chmod u+w testsuite); \
  	  cd testsuite; $${builddir}/mkcheck 0 $${builddir} $${srcdir})
  
! check-script-install: $(top_builddir)/mkcheck
  	-(chmod + $(top_builddir)/mkcheck; \
  	  srcdir=`cd $(top_srcdir); pwd`; builddir=`pwd`; \
  	  test -d testsuite || (mkdir testsuite; chmod u+w testsuite); \
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.in,v
retrieving revision 1.56
diff -c -p -r1.56 configure.in
*** configure.in	2001/03/28 11:04:48	1.56
--- configure.in	2001/03/29 00:38:58
*************** fi
*** 272,278 ****
  # installed in the correct place. To work around this not being passed
  # down from config-ml.in -> top_srcdir/Makefile.am ->
  # top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
! AC_OUTPUT(tests_flags mkcheck Makefile src/Makefile libmath/Makefile libio/Makefile libsupc++/Makefile,
  [if test -n "$CONFIG_FILES"; then
    ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
    grep '^MULTISUBDIR =' Makefile >> src/Makefile
--- 272,278 ----
  # installed in the correct place. To work around this not being passed
  # down from config-ml.in -> top_srcdir/Makefile.am ->
  # top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
! AC_OUTPUT(tests_flags mkcheck Makefile src/Makefile libmath/Makefile libio/Makefile libsupc++/Makefile testsuite/Makefile,
  [if test -n "$CONFIG_FILES"; then
    ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
    grep '^MULTISUBDIR =' Makefile >> src/Makefile
Index: mkcheck.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/mkcheck.in,v
retrieving revision 1.52
diff -c -p -r1.52 mkcheck.in
*** mkcheck.in	2001/03/13 17:56:30	1.52
--- mkcheck.in	2001/03/29 00:38:59
*************** set `../tests_flags ${query} $*` || exit
*** 61,71 ****
  BUILD_DIR=$1; SRC_DIR=$2; PREFIX_DIR=$3; CXX=$4; CXXFLAGS=$5; INCLUDES=$6; LIBS=$7;
  IFS=$saved_ifs
  
- # Build libtoolized surrogates to compile and run testcases.  Also,
- # adjust CXX so that the newly built compiler can find headers.
- if [ x$WHICH = x0 ] ; then
-     CXX="$CXX -B`dirname $CXX`/"
- fi
  LIBTOOL="$BUILD_DIR/libtool"
  LTEXE="$LIBTOOL --mode=execute"
  LTCXX="$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $INCLUDES $LIBS"
--- 61,66 ----
*************** test_file()
*** 325,330 ****
--- 320,326 ----
      compiler_invocation="$LTCXX $S_FLAG $SRC_NAME -o $EXENAME"
      COMP_TIME_START=$($TIMER_COMMAND)
      $compiler_invocation >> compile.out 2>&1
+     echo "" >> compile.out
      COMP_TIME_END=$($TIMER_COMMAND)
  
      if [ $COMP_TIME_START -lt $COMP_TIME_END ]; then
*************** test_file()
*** 334,340 ****
      fi
  
      if [ -f $EXENAME ]; then
!         rm compile.out
          size_command TEXT
          size_command DATA
          size_command SIZE
--- 330,336 ----
      fi
  
      if [ -f $EXENAME ]; then
! #        rm compile.out
          size_command TEXT
          size_command DATA
          size_command SIZE
Index: tests_flags.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/tests_flags.in,v
retrieving revision 1.14
diff -c -p -r1.14 tests_flags.in
*** tests_flags.in	2001/03/27 19:17:16	1.14
--- tests_flags.in	2001/03/29 00:38:59
*************** esac
*** 124,135 ****
  
  # LIB_PATH == where to find the C++ build libraries for libtool's use
  # GCC_LIB_PATH == where to find the gcc build libraries for libtool's use
! # CXX == the full pathname of the compiler
  case ${query} in
      --built-library)
        LIB_PATH=${BUILD_DIR}/src
        GCC_LIB_PATH=${BUILD_DIR}/../../gcc
!       CXX="${BUILD_DIR}/../../gcc/g++"
        ;;
      --installed-library)
        LIB_PATH=${PREFIX_DIR}/lib
--- 124,135 ----
  
  # LIB_PATH == where to find the C++ build libraries for libtool's use
  # GCC_LIB_PATH == where to find the gcc build libraries for libtool's use
! # CXX == how to invoke the compiler
  case ${query} in
      --built-library)
        LIB_PATH=${BUILD_DIR}/src
        GCC_LIB_PATH=${BUILD_DIR}/../../gcc
!       CXX="${BUILD_DIR}/../../gcc/g++ -B${BUILD_DIR}/../../gcc/"
        ;;
      --installed-library)
        LIB_PATH=${PREFIX_DIR}/lib
*************** case ${query} in
*** 138,148 ****
        ;;
  esac
  
! # gcc compiler flags (maybe use glibcpp_cxxflags from configure.target,
! # but that's really meant for building the library itself, not using it)
  CXXFLAGS="-ggdb3 -DDEBUG_ASSERT @SECTION_FLAGS@ @SECTION_LDFLAGS@"
  
! # LIBS == any extra needed -l switches, etc (may need more libs, lose lose)
  case ${query} in
      --built-library)
        LIBS="${LIB_PATH}/libstdc++.la -no-install -rpath ${GCC_LIB_PATH}"
--- 138,148 ----
        ;;
  esac
  
! # CXXFLAGS == run the testsuite with any special configuration
! # flags from the library build.
  CXXFLAGS="-ggdb3 -DDEBUG_ASSERT @SECTION_FLAGS@ @SECTION_LDFLAGS@"
  
! # LIBS == any extra may needed -L switches
  case ${query} in
      --built-library)
        LIBS="${LIB_PATH}/libstdc++.la -no-install -rpath ${GCC_LIB_PATH}"
Index: testsuite/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/Makefile.am,v
retrieving revision 1.1
diff -c -p -r1.1 Makefile.am
*** Makefile.am	2001/02/10 00:58:16	1.1
--- Makefile.am	2001/03/29 00:38:59
***************
*** 21,28 ****
  ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  ## USA.
  
! AUTOMAKE_OPTIONS = 1.3 cygnus dejagnu
  
  DEJATOOL = libstdc++
  
! RUNTEST	= runtest
--- 21,34 ----
  ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  ## USA.
  
! AUTOMAKE_OPTIONS =  foreign dejagnu no-installinfo
  
  DEJATOOL = libstdc++
  
! EXPECT = `if [ -f $(top_builddir)/../expect/expect ] ; then \
!             echo $(top_builddir)/../expect/expect ; \
!           else echo expect ; fi`
! 
! RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \
! 	       echo $(top_srcdir)/../dejagnu/runtest ; \
! 	    else echo runtest; fi`
Index: testsuite/lib/libstdc++.exp
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/lib/libstdc++.exp,v
retrieving revision 1.4
diff -c -p -r1.4 libstdc++.exp
*** libstdc++.exp	2001/02/15 03:57:39	1.4
--- libstdc++.exp	2001/03/29 00:39:01
***************
*** 25,43 ****
  ## The global associative array lib_env contains the totality
  ## of options necessary to run testcases; the meanings of which are
  ## 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.
! ##    lib_env(static)    Flags to pass to the linker to build a 
! ##                       statically linked executable.
! ##    lib_env(shared)    Flags to pass to the linker to build a 
! ##                       dynamically linked executable.
  ##    lib_env(testcase_options) Options specified by current testcase.
! ##                       These are specified through the @xxx@-keywords.
  
  
  load_lib dg.exp
--- 25,43 ----
  ## The global associative array lib_env contains the totality
  ## of options necessary to run testcases; the meanings of which are
  ## 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.
! ##    lib_env(static)    	Flags to pass to the linker to build a 
! ##                       	statically linked executable.
! ##    lib_env(shared)    	Flags to pass to the linker to build a 
! ##                       	dynamically linked executable.
  ##    lib_env(testcase_options) Options specified by current testcase.
! ##                       	These are specified through the @xxx@-keywords.
  
  
  load_lib dg.exp
*************** proc libstdc++-dg-init { args } {
*** 52,58 ****
      # By default, we assume we want to run program images.
      set dg-do-what-default run
  
!     # Get out the source and the build directories.
      set src-dir [lookfor_file $srcdir libstdc++-v3]
      set build-dir [lookfor_file $outdir libstdc++-v3]
  
--- 52,58 ----
      # By default, we assume we want to run program images.
      set dg-do-what-default run
  
!     # Get the source and the build directories.
      set src-dir [lookfor_file $srcdir libstdc++-v3]
      set build-dir [lookfor_file $outdir libstdc++-v3]
  
*************** proc libstdc++-dg-init { args } {
*** 61,75 ****
      
      # mkcheck.in used to output these information.
      set output [remote_exec host $lib_env(CXX) -v]
!     if { [lindex $output 0] == 0 } {
! 	set output [lindex $output 1]
! 	regexp "gcc version.*$" $output version
! 	regsub "\n+" $version "" version
! 	clone_output "Compiler: $version"
! 	clone_output "Compiler flags: $lib_env(CXXFLAGS)"
!     } else {
! 	perror "Cannot determine compiler version: [lindex $output 1]"
!     }
  }
  
  ## dg.exp callback.  Called from dg-test to run PROGRAM.
--- 61,76 ----
      
      # 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 } {
! #	set output [lindex $output 1]
! #	regexp "gcc version.*$" $output version
! #	regsub "\n+" $version "" version
! #	clone_output "Compiler: $version"
! #	clone_output "Compiler flags: $lib_env(CXXFLAGS)"
! #    } else {
! #	perror "Cannot determine compiler version: [lindex $output 1]"
! #    }
  }
  
  ## dg.exp callback.  Called from dg-test to run PROGRAM.
*************** proc libstdc++-setup-flags {src-dir buil
*** 241,247 ****
  	set lib_env(shared) ""
  
  	set lib_env(LIBTOOL) "$lib_env(BUILD_DIR)/libtool"
! 	set lib_env(FLAGS) "$lib_env(CXX) -B$lib_env(BUILD_DIR)/ \
  		$lib_env(INCLUDES) $lib_env(CXXFLAGS)"
      } else {
  	perror "$output"
--- 242,248 ----
  	set lib_env(shared) ""
  
  	set lib_env(LIBTOOL) "$lib_env(BUILD_DIR)/libtool"
! 	set lib_env(FLAGS) "$lib_env(CXX) \
  		$lib_env(INCLUDES) $lib_env(CXXFLAGS)"
      } else {
  	perror "$output"
*************** proc libstdc++-process-options { testfil
*** 304,310 ****
  }
  
  ###
! ### The following is an abominal hack, non-recomandable software practice.
  ### This is supposed to be a very-very short term solution.
  ### Please, do not add any piece of code without my approval.
  ### -- Gaby
--- 305,311 ----
  }
  
  ###
! ### The following is an abominable hack, non-commendable software practice.
  ### This is supposed to be a very-very short term solution.
  ### Please, do not add any piece of code without my approval.
  ### -- Gaby


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