OSDN Git Service

Remove flag_new_exceptions.
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / mkcheck.in
index ca0b03c..3ad79d8 100755 (executable)
@@ -51,11 +51,25 @@ esac
 
 # Compute the flags necessary to run the testsuite.
 saved_ifs=$IFS
-IFS=':'
-set `./tests_flags ${query} $*` || exit 1
-BUILD_DIR=$1; SRC_DIR=$2; PREFIX_DIR=$3; LTCXX=$4; LIBS=$5; LTEXE=$6; CXX=$7; CXXFLAGS=$8;
+# 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
 
+# 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"
+
 # specific libtool flag(s) to force the use of shared libraries, if any
 SH_FLAG=
 
@@ -65,12 +79,10 @@ ST_FLAG="-static"
 
 # Set up the testing directory, which should be in a directory called
 # "testsuite" in the root level of the build directory.
-TEST_DIR="`pwd`/testsuite"
-if [ ! -d "$TEST_DIR" ]; then
-    echo "making directory $TEST_DIR"
-    mkdir $TEST_DIR
-    mkdir $TEST_DIR/.libs    # help libtool keep quiet
-    chmod u+w $TEST_DIR
+TEST_DIR='.'
+# help libtool keep quiet
+if [ ! -d ${TEST_DIR}/.libs ]; then
+    mkdir $TEST_DIR/.libs    
 fi
 
 # the name of the file that will collect and hold all this useful data:
@@ -82,9 +94,9 @@ LOG_FILE="$TEST_DIR/$(date +%Y%m%d)-mkchecklog.txt"
 # the names of the specific test files to be run
 TESTS_FILE="$TEST_DIR/$(date +%Y%m%d)-mkcheckfiles.txt"
 
-# the heap size limit for testsuite binaries; start with a 2MB limit as per
-# http://sources.redhat.com/ml/libstdc++/2000-10/msg00029.html
-MAX_MEM_USAGE=3072
+# the heap size and virtual mem limit for testsuite binaries
+# See http://gcc.gnu.org/ml/libstdc++/2000-10/msg00029.html
+MAX_MEM_USAGE=16384
 
 #
 # 2: clean, make files, append general test info
@@ -188,7 +200,7 @@ setup_size_command()
     {
       case $1 in
         TEXT)  TEXT=$(size -A $EXENAME | grep ^.text | awk '{print $2}')  ;;
-        DATA)  DATA=$(size -A $EXENAME | grep -w ^.data | awk '{print $2}')  ;;
+        DATA)  DATA=$(size -A $EXENAME | awk '/^\.data[         ]/{print $2}')  ;;
         SIZE)  SIZE=$(size -A $EXENAME | grep otal | awk '{print $2}')  ;;
       esac
     }
@@ -261,9 +273,9 @@ test_for_output()
     # this is the name of the resulting diff file, if any
     DIFF_FILE="`echo $TEST_NAME | sed 's/cc$/diff/'`"
     # construct wildcard names, ie for $NAME=filebuf.cc, makes "filebuf*.tst"
-    DATA_FILES="`echo $NAME | sed 's/\.cc/\*\.tst/g'`"
+    DATA_FILES="`echo $TEST_NAME | sed 's/\.cc/\*\.tst/g'`"
     # make sure there is at least one, then go
-    ST_E="`echo $NAME | sed 's/\.cc/\-1\.tst/g'`"
+    ST_E="`echo $TEST_NAME | sed 's/\.cc/\-1\.tst/g'`"
     if [ -f $ST_E ]; then
         # list of actual files that match the wildcard above, ie
         # "filebuf-1.tst"
@@ -275,7 +287,6 @@ test_for_output()
             diff $ST_OUT_FILE $i > $DIFF_FILE
             if [ -s $DIFF_FILE ]; then
                 RESULT="-r"
-                echo "$ST_OUT_FILE has some problems, dude"
             else
                 RESULT="+"
             fi
@@ -311,7 +322,7 @@ test_file()
     # and harder as we try compiling at, say, top of the hour; we would
     # 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 $LIBS"
+    compiler_invocation="$LTCXX $S_FLAG $SRC_NAME -o $EXENAME"
     COMP_TIME_START=$($TIMER_COMMAND)
     $compiler_invocation >> compile.out 2>&1
     COMP_TIME_END=$($TIMER_COMMAND)
@@ -332,7 +343,8 @@ test_file()
         # printed by the executable will be lost and cannot be redirected,
         # because we need to capture the output of 'time'.  Bummer.
         TIMEFORMAT='timemark %R'
-        E_TIME_TEXT="$(exec 2>&1; ulimit -d $MAX_MEM_USAGE; \
+        E_TIME_TEXT="$(exec 2>&1;                                        \
+                     ulimit -d $MAX_MEM_USAGE; ulimit -v $MAX_MEM_USAGE; \
                      time $LTEXE $EXENAME)"
         E_ABNORMAL_TERMINATION=$?
         E_TIME="$(echo $E_TIME_TEXT | awk '{print $2}')"