OSDN Git Service

2001-05-01 Benjamin Kosnik <bkoz@redhat.com>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / mkcheck.in
index 7eb30e0..0d59d8b 100755 (executable)
@@ -51,16 +51,16 @@ esac
 
 # Compute the flags necessary to run the testsuite.
 saved_ifs=$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
 
-# 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"
@@ -89,9 +89,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://gcc.gnu.org/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
@@ -99,6 +99,7 @@ MAX_MEM_USAGE=3072
 
 # Remove old executables.
 rm -rf "$TEST_DIR"/*exe
+rm -rf "$TEST_DIR"/compile.out
 
 # Remove old core files (which now get left in cwd, not $TEST_DIR).
 rm -rf ./*core*
@@ -195,7 +196,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
     }
@@ -338,7 +339,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}')"