OSDN Git Service

* testsuite/abi_check.cc: Support older binutils/readelf.
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / mkcheck.in
index 58daf41..c856b05 100755 (executable)
@@ -78,9 +78,6 @@ 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 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
@@ -317,7 +314,8 @@ 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"
+    our_libs="-L$TEST_DIR -lv3test"
+    compiler_invocation="$LTCXX $S_FLAG $SRC_NAME -o $EXENAME $our_libs"
     echo $compiler_invocation >> compile.out 2>&1
     COMP_TIME_START=$($TIMER_COMMAND)
     $compiler_invocation >> compile.out 2>&1
@@ -339,18 +337,12 @@ 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; ulimit -v $MAX_MEM_USAGE; \
-                     time $LTEXE $EXENAME)"
+        E_TIME_TEXT="$(exec 2>&1; time $LTEXE $EXENAME)"
         E_ABNORMAL_TERMINATION=$?
-        E_TIME="$(echo $E_TIME_TEXT | awk '{print $2}')"
-        # joining those two commands does not work due to quoting problems:
-        #E_TIME="$(exec 2>&1; time $EXENAME | awk '{print $2}')"
-        # this will work as a fallback on certain systems...?
-        #E_TIME=$(exec 2>&1; time $EXENAME | cut -d ' ' -f 2)
  
         if [ "$E_ABNORMAL_TERMINATION" -ne 0 ]; then
             RESULT='-r'
+           E_TIME="0"
             rm -f ./*core
             # sometimes you want to save all core files for review:
             #mv ./core $EXENAME.core
@@ -359,17 +351,20 @@ test_file()
             #mv ./core* $EXENAME.core
         else
             test_for_output
+           # XXX This doesn't always result in a number.
+           # E_TIME="$(echo $E_TIME_TEXT | awk '{print $2}')"
+           E_TIME="0"
         fi
 
         # sometimes you want to save all failing exe files for review:
-        if [ "$RESULT" = "+" ]; then
+        if [ "$RESULT" = '+' ]; then
             rm "$EXENAME"
         fi
     else
         # the file did not compile/link.
         printf "\n" >> $LOG_FILE
-#        `cat compile.out >> $LOG_FILE` 
-#        rm compile.out
+        `cat compile.out >> $LOG_FILE` 
+        rm compile.out
         RESULT="-b"
         TEXT="0"
         DATA="0"
@@ -393,8 +388,7 @@ test_file()
 
     printf "%s\t" "$RESULT"
     printf "%-2s %d\t%.3f\t%s\t%s\t%s\t%s %s\n"   \
-        "$RESULT" $C_TIME $E_TIME $TEXT $DATA $SIZE $NAME "$S_FLAG"    \
-        >> $RESULTS_FILE
+        "$RESULT" $C_TIME $E_TIME $TEXT $DATA $SIZE $NAME >> $RESULTS_FILE
 }
 
 setup_size_command
@@ -437,7 +431,7 @@ TEST_TIME_END=$($TIMER_COMMAND)
 # grep can count faster than we can...
 total_failures=`expr ${shared_fail} + ${static_fail}`
 total_successes=`expr ${shared_pass} + ${static_pass}`
-resultstext="pass/fail results:  ${shared_pass}/${shared_fail} shared + ${static_pass}/${static_fail} static = ${total_successes}/${total_failures} total"
+resultstext="pass/fail results:  ${static_pass}/${static_fail} static + ${shared_pass}/${shared_fail} shared = ${total_successes}/${total_failures} total"
 if [ $total_failures -eq 0 ]; then
     resultstext="${resultstext}, WIN WIN"
 fi