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] testsuite bits



This is what got checked in, which is mostly the same plus a port of
the old testing harness, mkcheck.in.



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

	Switch over to new harness.
	* testsuite_flags.in: Tweaks via Gaby.
	* testsuite/Makefile.am: Change tool to libstdc++-v3.
	(EXPECT): Quote directly.
	(RUNTEST): Same.
	* configure.in: Output testsuite_flags.
	* acinclude.m4: Substitute src, bld, and prefix dirs.
	Remove glibcpp_expect, glibcpp_runtestflags.
	* Makefile.am (RUNTESTFLAGS): Pass this down to subdirs.
	* mkcheck.in: Port to new interface.
	
	* aclocal.m4: Regerate.
	* configure: Regnerate.
	* Makefile.in: Regnerate.
	* */Makefile.in: Regenerate.
	
	* tests_flags.in: Remove.
	* testsuite/lib/libstdc++.exp: Remove.

Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/Makefile.am,v
retrieving revision 1.21
diff -c -p -r1.21 Makefile.am
*** Makefile.am	2001/04/19 23:07:18	1.21
--- Makefile.am	2001/05/14 01:02:04
*************** SUBDIRS = libio libmath libsupc++ src te
*** 28,50 ****
  
  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); \
  	  cd testsuite; \
! 	  $${builddir}/mkcheck 1 $${builddir} $${srcdir} $(prefix))
  
! # These two rules seem messy.
  doxygen:
  	-(srcdir=`cd ${top_srcdir}; pwd`; \
  	  outdir=`pwd`; \
--- 28,51 ----
  
  mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
  
! # These two special 'check-script' rules use the bash script 'mkcheck'
! # to do testing. This script is not as portable as the dejagnu test
! # harness, and is thus off by default. It does produce interesting
! # output however, including various performance analysis items like
! # compile time, execution time, and binary size.
  check-script: $(top_builddir)/mkcheck
  	-(chmod + $(top_builddir)/mkcheck; \
  	  test -d testsuite || (mkdir testsuite; chmod u+w testsuite); \
! 	  cd testsuite; \
! 	  @glibcpp_builddir@/mkcheck 0)
  
  check-script-install: $(top_builddir)/mkcheck
  	-(chmod + $(top_builddir)/mkcheck; \
  	  test -d testsuite || (mkdir testsuite; chmod u+w testsuite); \
  	  cd testsuite; \
! 	  @glibcpp_builddir@/mkcheck 1)
  
! # These two rules might seem messy, but are hella worth it.
  doxygen:
  	-(srcdir=`cd ${top_srcdir}; pwd`; \
  	  outdir=`pwd`; \
*************** AM_MAKEFLAGS = \
*** 121,126 ****
--- 122,128 ----
  	"PICFLAG=$(PICFLAG)" \
  	"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
  	"SHELL=$(SHELL)" \
+ 	"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
  	"exec_prefix=$(exec_prefix)" \
  	"infodir=$(infodir)" \
  	"libdir=$(libdir)" \
Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acinclude.m4,v
retrieving revision 1.144
diff -c -p -r1.144 acinclude.m4
*** acinclude.m4	2001/04/26 04:29:15	1.144
--- acinclude.m4	2001/05/14 01:02:10
*************** LIB_AC_PROG_CXX
*** 117,126 ****
    AC_CHECK_TOOL(AS, as)
    AC_CHECK_TOOL(AR, ar)
    AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
-   AC_CHECK_TOOL(glibcpp_expect, expect, expect-not-found-in-path-error)
-   AC_CHECK_TOOL(glibcpp_runtest, runtest, runtest-not-found-in-path-error)
-   AC_SUBST(glibcpp_expect)
-   AC_SUBST(glibcpp_runtest)
    AC_PROG_INSTALL
  
    AM_MAINTAINER_MODE
--- 117,122 ----
*************** AC_DEFUN(GLIBCPP_EXPORT_INSTALL_INFO, [
*** 1581,1586 ****
--- 1577,1588 ----
  glibcpp_toolexecdir=no
  glibcpp_toolexeclibdir=no
  
+ # Export build and source directories.
+ tmp_builddir=`pwd`
+ glibcpp_builddir=$tmp_builddir
+ glibcpp_srcdir=${srcdir}
+ glibcpp_prefixdir=${prefix}
+ 
  AC_MSG_CHECKING([for interface version number])
  libstdcxx_interface=$INTERFACE
  AC_MSG_RESULT($libstdcxx_interface)
*************** fi
*** 1643,1648 ****
--- 1645,1653 ----
  AC_MSG_CHECKING([for install location])
  AC_MSG_RESULT($gxx_include_dir)
  
+ AC_SUBST(glibcpp_builddir)
+ AC_SUBST(glibcpp_srcdir)
+ AC_SUBST(glibcpp_prefixdir)
  AC_SUBST(gxx_include_dir)
  AC_SUBST(glibcpp_toolexecdir)
  AC_SUBST(glibcpp_toolexeclibdir)
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.in,v
retrieving revision 1.60
diff -c -p -r1.60 configure.in
*** configure.in	2001/05/03 20:35:13	1.60
--- configure.in	2001/05/14 01:02:53
*************** fi
*** 281,294 ****
  # 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
    grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
  fi
- chmod +x tests_flags
  chmod +x mkcheck
  ],
  srcdir=${srcdir}
  host=${host}
--- 281,294 ----
  # 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(Makefile src/Makefile libmath/Makefile libio/Makefile libsupc++/Makefile testsuite/Makefile mkcheck testsuite_flags,
  [if test -n "$CONFIG_FILES"; then
    ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
    grep '^MULTISUBDIR =' Makefile >> src/Makefile
    grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
  fi
  chmod +x mkcheck
+ chmod +x testsuite_flags
  ],
  srcdir=${srcdir}
  host=${host}
Index: mkcheck.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/mkcheck.in,v
retrieving revision 1.55
diff -c -p -r1.55 mkcheck.in
*** mkcheck.in	2001/05/13 11:08:57	1.55
--- mkcheck.in	2001/05/14 01:02:54
***************
*** 1,4 ****
! #!/usr/bin/env bash
  
  
  # Script to do automated testing and data collection for various test
--- 1,4 ----
! !/usr/bin/env bash
  
  
  # Script to do automated testing and data collection for various test
***************
*** 9,42 ****
  # has been enabled.
  
  # Invocation 
! # mkcheck [01] (path to build) (path to src) (path to install)
  
- ### XXX There are a lot of tests in here for OS-specific stuff.  If we
- ###     move to a 'configure.target' method of determining those extra
- ###     flags and whatnot, we can take out all those things and source
- ###     that file from here.  (Write that file with this in mind...)
- 
- ### XXX Note that breaking out of this with ^C will not work under
- ###     Solaris (at least).  Dunno why.
- 
- 
  # 1: variables
  #
  # WHICH determines if you are
  # (0) testing the build binary and headers, or
  # (1) testing the installed binary and headers, or
  WHICH=$1
! if [ "$WHICH"x = 0x ] && [ $# -eq 3 ]; then
    echo "running mkcheck"
    echo "$0: testing the build directory"
!   query="--built-library"
! elif [ "$WHICH"x = 1x ] && [ $# -eq 4 ]; then
    echo "running mkcheck"
!   echo "$0: testing the install directory $4"
!   query="--installed-library"
  else
!   echo 'Usage: mkcheck 0 (path to build) (path to src)'
!   echo '       mkcheck 1 (path to build) (path to src) (path to install)'
    exit 1;
  fi
  
--- 9,31 ----
  # has been enabled.
  
  # Invocation 
! # mkcheck [01] 
  
  # 1: variables
  #
  # WHICH determines if you are
  # (0) testing the build binary and headers, or
  # (1) testing the installed binary and headers, or
  WHICH=$1
! if [ "$WHICH"x = 0x ]; then
    echo "running mkcheck"
    echo "$0: testing the build directory"
! elif [ "$WHICH"x = 1x ]; then
    echo "running mkcheck"
!   echo "$0: testing the install directory"
  else
!   echo 'Usage: mkcheck 0'
!   echo '       mkcheck 1'
    exit 1;
  fi
  
*************** case $BASH_VERSION in
*** 50,81 ****
      *)   ;;   # ??
  esac
  
! # Compute the flags necessary to run the testsuite.
! saved_ifs=$IFS
! # bash 2.01 does the wrong thing with $* if IFS doesn't include space
! if test ${BASH_VERSINFO[1]} = 01 ; then
!     IFS=': '
  else
!     IFS=':'
  fi
! set `../tests_flags ${query} $*` || exit 1
! BUILD_DIR=$1; SRC_DIR=$2; PREFIX_DIR=$3; CXX=$4; CXXFLAGS=$5; INCLUDES=$6; LIBS=$7;
! IFS=$saved_ifs
! 
  LIBTOOL="$BUILD_DIR/libtool"
  LTEXE="$LIBTOOL --mode=execute"
! LTCXX="$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $INCLUDES $LIBS"
  
! # specific libtool flag(s) to force the use of shared libraries, if any
! SH_FLAG=
  
! # specific libtool flag(s) to force the use of static libraries, if any
  ST_FLAG="-static"
  #ST_FLAG="-all-static"
  
  # Set up the testing directory, which should be in a directory called
  # "testsuite" in the root level of the build directory.
! TEST_DIR='.'
  # help libtool keep quiet
  if [ ! -d ${TEST_DIR}/.libs ]; then
      mkdir $TEST_DIR/.libs    
--- 39,70 ----
      *)   ;;   # ??
  esac
  
! BUILD_DIR=@glibcpp_builddir@
! SRC_DIR=@glibcpp_srcdir@
! PREFIX_DIR=@glibcpp_prefixdir@
! if [ "$WHICH"x = 0x ]; then
!   CXX=`$BUILD_DIR/testsuite_flags --build-cxx`
!   INCLUDES=`$BUILD_DIR/testsuite_flags --build-includes`
  else
!   CXX=`$BUILD_DIR/testsuite_flags --install-cxx`
!   INCLUDES=`$BUILD_DIR/testsuite_flags --install-includes`
  fi
! CXXFLAGS=`$BUILD_DIR/testsuite_flags --cxxflags`
  LIBTOOL="$BUILD_DIR/libtool"
  LTEXE="$LIBTOOL --mode=execute"
! #LTCXX="$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $INCLUDES"
! LTCXX="$CXX $CXXFLAGS $INCLUDES"
  
! # specific libtool flag(s) to use shared libraries, if any
! SH_FLAG="-Wl,--rpath -Wl,$BUILD_DIR/../../gcc -Wl,--rpath -Wl,$BUILD_DIR/src/.libs"
  
! # specific libtool flag(s) to use static libraries, if any
  ST_FLAG="-static"
  #ST_FLAG="-all-static"
  
  # Set up the testing directory, which should be in a directory called
  # "testsuite" in the root level of the build directory.
! TEST_DIR="$BUILD_DIR/testsuite"
  # help libtool keep quiet
  if [ ! -d ${TEST_DIR}/.libs ]; then
      mkdir $TEST_DIR/.libs    
*************** test_file()
*** 330,335 ****
--- 319,325 ----
      # eventually have to calculate time_t anyhow.  Or 3) just grab two
      # time_t's (no more overhead than grabbing two date(1)'s).
      compiler_invocation="$LTCXX $S_FLAG $SRC_NAME -o $EXENAME"
+     echo $compiler_invocation >> compile.out 2>&1
      COMP_TIME_START=$($TIMER_COMMAND)
      $compiler_invocation >> compile.out 2>&1
      COMP_TIME_END=$($TIMER_COMMAND)
*************** test_file()
*** 341,347 ****
      fi
  
      if [ -f $EXENAME ]; then
!         rm compile.out
          size_command TEXT
          size_command DATA
          size_command SIZE
--- 331,337 ----
      fi
  
      if [ -f $EXENAME ]; then
! #        rm compile.out
          size_command TEXT
          size_command DATA
          size_command SIZE
*************** test_file()
*** 379,386 ****
      else
          # the file did not compile/link.
          printf "\n" >> $LOG_FILE
!         `cat compile.out >> $LOG_FILE` 
!         rm compile.out
          RESULT="-b"
          TEXT="0"
          DATA="0"
--- 369,376 ----
      else
          # the file did not compile/link.
          printf "\n" >> $LOG_FILE
! #        `cat compile.out >> $LOG_FILE` 
! #        rm compile.out
          RESULT="-b"
          TEXT="0"
          DATA="0"
*************** if [ $TEST_TIME_START -lt $TEST_TIME_END
*** 463,467 ****
  fi
  
  exit 0
- 
- 
--- 453,455 ----
Index: testsuite_flags.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite_flags.in,v
retrieving revision 1.1
diff -c -p -r1.1 testsuite_flags.in
*** testsuite_flags.in	2001/05/12 17:45:46	1.1
--- testsuite_flags.in	2001/05/14 01:02:54
***************
*** 12,22 ****
  print_usage() {
      cat <<EOF
  Usage: 
!     tests_flags --install-includes
! 		--build-includes
! 		--build-cxx
! 		--install-cxx
! 		--cxxflags
  EOF
  }
  
--- 12,22 ----
  print_usage() {
      cat <<EOF
  Usage: 
!     testsuite_flags --install-includes
! 		    --build-includes
! 		    --build-cxx
! 		    --install-cxx
! 		    --cxxflags
  EOF
  }
  
*************** case ${query} in
*** 44,50 ****
        echo ${CXX}
        ;;
      --build-cxx)
!       CC_build="@glibcpp_CXX@ -static "
        CXX=`echo $CC_build | sed 's/xgcc/g++/g'`
        echo ${CXX}
        ;;
--- 44,50 ----
        echo ${CXX}
        ;;
      --build-cxx)
!       CC_build="@glibcpp_CXX@"
        CXX=`echo $CC_build | sed 's/xgcc/g++/g'`
        echo ${CXX}
        ;;
Index: testsuite/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/Makefile.am,v
retrieving revision 1.3
diff -c -p -r1.3 Makefile.am
*** Makefile.am	2001/04/11 18:52:31	1.3
--- Makefile.am	2001/05/14 01:03:01
***************
*** 23,34 ****
  
  AUTOMAKE_OPTIONS =  foreign dejagnu
  
! DEJATOOL = libstdc++
  
! EXPECT = @glibcpp_expect@
  
! RUNTEST = @glibcpp_runtest@
  
! 
! 
  
--- 23,37 ----
  
  AUTOMAKE_OPTIONS =  foreign dejagnu
  
! DEJATOOL = libstdc++-v3
  
! EXPECT = `if [ -f @glibcpp_builddir@/../../expect/expect ] ; then \
!             echo @glibcpp_builddir@/../../expect/expect ; \
!           else echo expect ; fi`
  
! RUNTEST = `if [ -f @glibcpp_srcdir@/../dejagnu/runtest ] ; then \
! 	       echo @glibcpp_srcdir@/../dejagnu/runtest ; \
! 	    else echo runtest; fi`
  
! RUNTESTFLAGS =
  
Index: testsuite/lib/libstdc++-v3-dg.exp
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp,v
retrieving revision 1.1
diff -c -p -r1.1 libstdc++-v3-dg.exp
*** libstdc++-v3-dg.exp	2001/05/12 17:49:16	1.1
--- libstdc++-v3-dg.exp	2001/05/14 01:03:02
*************** proc libstdc++-v3_target_compile { sourc
*** 108,113 ****
--- 108,117 ----
      set cxx_final [concat $cxx_final $cxxlibglossflags]
      set cxx_final [concat $cxx_final $cxxflags]
      set cxx_final [concat $cxx_final $includes]
+ 
+     # XXX 
+     set cxx_final [concat $cxx_final -static]
+ 
      lappend options "compiler=$cxx_final";
  
      return [target_compile $source $dest $type $options]


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