scripts: New.
authorBenjamin Kosnik <bkoz@redhat.com>
Wed, 18 Jun 2003 01:52:08 +0000 (01:52 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Wed, 18 Jun 2003 01:52:08 +0000 (01:52 +0000)
2003-06-17  Benjamin Kosnik  <bkoz@redhat.com>

* scripts: New.
* config/abi/extract_symvers: Move to...
* scripts/extract_symvers: ...here.
* mkcheck.in: Move to..
* scripts/check_survey.in: ...here.
* testsuite_flags.in: Move to..
* scripts/testsuite_flags.in: ...here.
* configure.in: Change check and testsuite_flags locations.
* configure: Regenerate.
* testsuite/Makefile.am (current_symbols.txt): Change location.
* testsuite/Makefile.in: Regenerate.
* testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-init): Modify
location of testsuite_flags.
* Makefile.am (check-script): Move..
(check-script-install): Move...
* testsuite/Makefile.am: ... here.
* testsuite/Makefile.in: Regenerate.
* Makefile.in: Regenerate.

From-SVN: r68132

14 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/Makefile.am
libstdc++-v3/Makefile.in
libstdc++-v3/config/abi/extract_symvers [deleted file]
libstdc++-v3/configure
libstdc++-v3/configure.in
libstdc++-v3/mkcheck.in [deleted file]
libstdc++-v3/scripts/check_survey.in [new file with mode: 0755]
libstdc++-v3/scripts/extract_symvers [new file with mode: 0755]
libstdc++-v3/scripts/testsuite_flags.in [new file with mode: 0755]
libstdc++-v3/testsuite/Makefile.am
libstdc++-v3/testsuite/Makefile.in
libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp
libstdc++-v3/testsuite_flags.in [deleted file]

index 4973da0cb390767385dd13dac070f7f91610cab0..0fbe71a711cfe800da420e387e7a91cd1c1208f2 100644 (file)
@@ -1,3 +1,24 @@
+2003-06-17  Benjamin Kosnik  <bkoz@redhat.com>
+
+       * scripts: New.
+       * config/abi/extract_symvers: Move to...
+       * scripts/extract_symvers: ...here.
+       * mkcheck.in: Move to..
+       * scripts/check_survey.in: ...here.
+       * testsuite_flags.in: Move to..
+       * scripts/testsuite_flags.in: ...here.
+       * configure.in: Change check and testsuite_flags locations.
+       * configure: Regenerate.
+       * testsuite/Makefile.am (current_symbols.txt): Change location.
+       * testsuite/Makefile.in: Regenerate.
+       * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-init): Modify
+       location of testsuite_flags.
+       * Makefile.am (check-script): Move..
+       (check-script-install): Move...
+       * testsuite/Makefile.am: ... here.      
+       * testsuite/Makefile.in: Regenerate.
+       * Makefile.in: Regenerate.      
+       
 2003-06-17  Benjamin Kosnik  <bkoz@redhat.com>
 
        * config/abi/i486-linux-gnu/baseline_symbols.txt: Update to 3.3.0.
index 58edd36937ae9e5dbc36df017276cd9c9467d20f..2467ce3d7b88b0238aba8832e1c1b37f085e3a86 100644 (file)
@@ -31,21 +31,6 @@ mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
 
 PWD = $${PWDCMD-pwd}
 
-# 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; \
-         cd testsuite; \
-         @glibcpp_builddir@/mkcheck 0)
-
-check-script-install: $(top_builddir)/mkcheck
-       -(chmod + $(top_builddir)/mkcheck; \
-         cd testsuite; \
-         @glibcpp_builddir@/mkcheck 1)
-
 # These rules are messy, but are hella worth it.
 doxygen:
        -(srcdir=`cd ${top_srcdir}; ${PWD}`; \
index cdd497cac6ddb18345634e680a349729cb7b4289..956585bc26f69bd7575de9de4c26bb6d5fe49937 100644 (file)
@@ -210,10 +210,9 @@ AM_MAKEFLAGS = \
 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES =  mkcheck testsuite_flags
+CONFIG_CLEAN_FILES = 
 DIST_COMMON =  README ./stamp-h.in ChangeLog Makefile.am Makefile.in \
-acconfig.h acinclude.m4 aclocal.m4 config.h.in configure configure.in \
-mkcheck.in testsuite_flags.in
+acconfig.h acinclude.m4 aclocal.m4 config.h.in configure configure.in
 
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
@@ -264,10 +263,6 @@ distclean-hdr:
        -rm -f config.h
 
 maintainer-clean-hdr:
-mkcheck: $(top_builddir)/config.status mkcheck.in
-       cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
-testsuite_flags: $(top_builddir)/config.status testsuite_flags.in
-       cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
 # This directory's subdirectories are mostly independent; you can cd
 # into them and run `make' without going through this Makefile.
@@ -479,21 +474,6 @@ distclean-generic clean-generic maintainer-clean-generic clean \
 mostlyclean distclean maintainer-clean
 
 
-# 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; \
-         cd testsuite; \
-         @glibcpp_builddir@/mkcheck 0)
-
-check-script-install: $(top_builddir)/mkcheck
-       -(chmod + $(top_builddir)/mkcheck; \
-         cd testsuite; \
-         @glibcpp_builddir@/mkcheck 1)
-
 # These rules are messy, but are hella worth it.
 doxygen:
        -(srcdir=`cd ${top_srcdir}; ${PWD}`; \
diff --git a/libstdc++-v3/config/abi/extract_symvers b/libstdc++-v3/config/abi/extract_symvers
deleted file mode 100755 (executable)
index e7b6645..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/sh
-
-# Copyright (C) 2002 Free Software Foundation, Inc.
-#
-# This file is part of the GNU ISO C++ Library.  This library is free
-# software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this library; see the file COPYING.  If not, write to the Free
-# Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-# USA.
-#
-# As a special exception, you may use this file as part of a free software
-# library without restriction.  Specifically, if other files instantiate
-# templates or use macros or inline functions from this file, or you compile
-# this file and link it with other files to produce an executable, this
-# file does not by itself cause the resulting executable to be covered by
-# the GNU General Public License.  This exception does not however
-# invalidate any other reasons why the executable file might be covered by
-# the GNU General Public License.
-
-
-if test ${#} -lt 2 || test $1 = '--help'; then
-  echo "Usage:  extract_symvers  shared_lib output_file" 1>&2
-  exit 1
-fi
-
-lib=$1
-output=$2
-
-# GNU binutils, somewhere after version 2.11.2, requires -W/--wide to avoid
-# default line truncation.  -W is not supported and truncation did not occur
-# by default before that point.
-readelf="readelf --symbols"
-if readelf --help | grep -- --wide > /dev/null; then
-    readelf="$readelf --wide"
-fi
-
-# This avoids weird sorting problems later.
-export LC_ALL=C
-
-tmp=extract.$$
-
-${readelf} ${lib} | sed '/\.dynsym/,/^$/p;d' | egrep -v ' (LOCAL|UND) ' |\
-awk '{ if ($4 == "FUNC" || $4 == "NOTYPE")
-         printf "%s:%s\n", $4, $8;
-       else if ($4 == "OBJECT")
-         printf "%s:%s:%s\n", $4, $3, $8;
-     }' | sort | uniq > $tmp 2>&1
-#       else printf "Huh?  What is %s?\n", $8;
-
-
-# I think we'll be doing some more with this file, but for now, dump.
-mv $tmp $output
-
-exit 0
index a6b7b9102645139230a7132954a94c5f33021040..2323757ce138814d91c1bb3df7ab962a0ecf7eaf 100755 (executable)
@@ -23968,7 +23968,7 @@ ac_given_INSTALL="$INSTALL"
 trap 'rm -fr `echo "Makefile \
 include/Makefile src/Makefile \
 libmath/Makefile libsupc++/Makefile \
-po/Makefile testsuite/Makefile mkcheck testsuite_flags config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+po/Makefile testsuite/Makefile scripts/check scripts/testsuite_flags config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
 
@@ -24162,7 +24162,7 @@ cat >> $CONFIG_STATUS <<EOF
 CONFIG_FILES=\${CONFIG_FILES-"Makefile \
 include/Makefile src/Makefile \
 libmath/Makefile libsupc++/Makefile \
-po/Makefile testsuite/Makefile mkcheck testsuite_flags"}
+po/Makefile testsuite/Makefile scripts/check scripts/testsuite_flags"}
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
@@ -24369,8 +24369,8 @@ test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
      esac
    fi
  fi
- chmod +x mkcheck
- chmod +x testsuite_flags
+ chmod +x scripts/check
+ chmod +x scripts/testsuite_flags
 exit 0
 EOF
 chmod +x $CONFIG_STATUS
index f7ff247602b828b8b3e3ea2545556917f1afe702..62a972f999d585ba95d4e94b6b7e619578775e1c 100644 (file)
@@ -485,7 +485,7 @@ AC_SUBST(LIBSUPCXX_PICFLAGS)
 AC_OUTPUT(Makefile \
 include/Makefile src/Makefile \
 libmath/Makefile libsupc++/Makefile \
-po/Makefile testsuite/Makefile mkcheck testsuite_flags,
+po/Makefile testsuite/Makefile scripts/check scripts/testsuite_flags,
 [test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
  if test -n "$CONFIG_FILES"; then
    if test -n "${with_build_subdir}" || test -n "${with_target_subdir}"; then
@@ -508,8 +508,8 @@ po/Makefile testsuite/Makefile mkcheck testsuite_flags,
      esac
    fi
  fi
- chmod +x mkcheck
- chmod +x testsuite_flags],
+ chmod +x scripts/check
+ chmod +x scripts/testsuite_flags],
 srcdir=${srcdir}
 host=${host}
 target=${target}
@@ -527,7 +527,7 @@ dnl  In autoconf 2.5x, AC_OUTPUT is replaced by three AC_ macros:
 dnl  AC_CONFIG_FILES(Makefile \
 dnl      include/Makefile src/Makefile \
 dnl      libmath/Makefile libsupc++/Makefile \
-dnl      po/Makefile testsuite/Makefile mkcheck testsuite_flags)
+dnl     po/Makefile testsuite/Makefile scripts/mkcheck scripts/testsuite_flags)
 dnl  AC_CONFIG_COMMANDS([default],
 dnl  [if test -n "$CONFIG_FILES"; then
 dnl    # Ony modify Makefiles that are just being created.
@@ -547,8 +547,8 @@ dnl        grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
 dnl        ;;
 dnl    esac
 dnl  fi
-dnl  chmod +x mkcheck
-dnl  chmod +x testsuite_flags
+dnl  chmod +x scripts/mkcheck
+dnl  chmod +x scripts/testsuite_flags
 dnl  ],
 dnl  srcdir=${srcdir}
 dnl  host=${host}
diff --git a/libstdc++-v3/mkcheck.in b/libstdc++-v3/mkcheck.in
deleted file mode 100755 (executable)
index 377321c..0000000
+++ /dev/null
@@ -1,452 +0,0 @@
-#!/usr/bin/env bash
-
-# Script to do automated testing and data collection for various test
-# files, so that we don't have to do this by hand on every test file.
-# It attempts to collect some diagnostic info about size and speed that
-# should be useful in the future as the library gets tuned for size
-# and speed.  In addition, it tests static and shared linkage, iff each
-# 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    /* test the build directory    */'
-  echo '       mkcheck 1    /* test the install directory  */'
-  exit 1;
-fi
-
-# Now that we've successfully translated the numerical option into
-# a symbolic one, we can safely ignore it.
-shift
-
-# This has been true all along.  Found out about it the hard way...
-case $BASH_VERSION in
-    1*)  echo 'You need bash 2.x to run mkcheck.  Exiting.'; exit 1 ;;
-    *)   ;;   # ??
-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    
-fi
-
-# the name of the file that will collect and hold all this useful data:
-RESULTS_FILE="$TEST_DIR/$(date +%Y%m%d)-mkcheck.txt"
-
-# the name of the log file that will append compiler diagnostics:
-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"
-
-
-#
-# 2: clean, make files, append general test info
-#
-
-# 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*
-
-if [ -f $RESULTS_FILE ]; then
-    rm $RESULTS_FILE
-fi
-if [ -f $LOG_FILE ]; then
-    rm $LOG_FILE
-fi
-
-# Make a list of the files we're going to run, or use an old one if it exists.
-if [ ! -f "$TESTS_FILE" ]; then
-  if [ -f "$TEST_DIR/testsuite_files" ]; then
-      cp $TEST_DIR/testsuite_files $TESTS_FILE
-  else
-    echo "making file $TESTS_FILE"
-    for LONG_NAME in $SRC_DIR/testsuite/*/*.cc
-    do
-        DIR_NAME=$(dirname $LONG_NAME)
-        SHORT_NAME="`basename $DIR_NAME`/`basename $LONG_NAME`"
-        echo "$SHORT_NAME" >> $TESTS_FILE
-    done
-  fi
-fi
-
-# Nasty solution to replace GNU date(1)'s %s time_t output function.
-TIMER_COMMAND=$TEST_DIR/printnow.exe
-if [ ! -x "$TIMER_COMMAND" ]; then
-    echo "making utility $TIMER_COMMAND"
-    gcc -o "$TIMER_COMMAND" "$SRC_DIR/testsuite/printnow.c"
-    strip "$TIMER_COMMAND"
-fi
-
-# Copy over the data files for filebufs
-cp $SRC_DIR/testsuite/27_io/*.txt $TEST_DIR
-cp $SRC_DIR/testsuite/27_io/*.tst $TEST_DIR
-chmod u+w $TEST_DIR/*.txt
-chmod u+w $TEST_DIR/*.tst
-
-# Emit useful info about compiler and platform
-echo "host: $(uname -mrsv)" >> $RESULTS_FILE
-echo "compiler: $($CXX -v 2>&1)" >> $RESULTS_FILE
-echo "compiler flags: $CXXFLAGS" >> $RESULTS_FILE
-echo "date: $(date +%Y%m%d)" >> $RESULTS_FILE
-echo "" >> $RESULTS_FILE
-
-explanation='+: pass, -b: build failure, -r: run failure, x: disabled'
-printf "%s\n     %s\n"  'p == pass/fail execution test'  "$explanation"  \
-       >> $RESULTS_FILE
-echo "ctime == time to compile and link" >> $RESULTS_FILE
-echo "etime == time for executable to run" >> $RESULTS_FILE
-echo "text == size of the executable text section" >> $RESULTS_FILE
-echo "data == size of the executable data section" >> $RESULTS_FILE
-echo "total == size of the executable" >> $RESULTS_FILE
-echo "" >> $RESULTS_FILE
-
-echo "p" | awk '{printf("%s ", $1)}' >> $RESULTS_FILE
-echo "ctime" "etime" | awk '{printf("%s\t%s\t", $1, $2)}' >> $RESULTS_FILE
-echo "text" "data" | awk '{printf("%s\t%s\t", $1, $2)}' >> $RESULTS_FILE
-echo "total" "name" | awk '{printf("%s\t%s\t", $1, $2)}' >> $RESULTS_FILE
-echo "" >> $RESULTS_FILE
-
-# Counters.  These could be members of an array, but they'd all have to
-# become individuals anyhow if we ever change this script to super-portable sh.
-shared_pass=0
-shared_fail=0
-static_pass=0
-static_fail=0
-
-
-#
-# 2.5:  support functions
-#
-
-# Figure out how to extract size information from binaries.  We take
-# the text of the value we want as an argument, and leave the size in
-# the appropriate variable.
-#
-# We discover what kind of size(1) we are using *once* and build a shell
-# function named 'size_command' to wrap it.  (The "function" keyword is
-# redundant here, but helps me read it, so there.)  Previously we were
-# re-discovering the size(1) arguments three times for each test; sloooow.
-#
-# It is VERY IMPORTANT not to compare these numbers across platforms.
-# Different size(1)'s extract section information differently.  For
-# example, using the native Sun size(1) and GNU size(1) built for Suns
-# on the exact same binary will give very different numbers, due to all
-# the variance in command-line options and arbitrary names of ELF sections.
-#
-# and suddenly we go to 2-space indentations...
-setup_size_command()
-{
-  if size --version 2> /dev/null | grep -c GNU > /dev/null;
-  then    # Then we're using a GNU size(1) built for this platform.
-    # We lose .rodata and .data1 and who knows what else... kludge.
-    function size_command()
-    {
-      case $1 in
-        TEXT)  TEXT=$(size -B $EXENAME | tail -1 | awk '{print $1}')  ;;
-        DATA)  DATA=$(size -B $EXENAME | tail -1 | awk '{print $2}')  ;;
-        SIZE)  SIZE=$(size -B $EXENAME | tail -1 | awk '{print $4}')  ;;
-      esac
-    }
-  else
-    # Not using GNU size; check for platform.  These numbers seem to match
-    # up to text/data/total, although their meanings seem to be different.
-    # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
-    case @host_os@ in
-      *aix*)
-        function size_command()
-        {
-          case $1 in
-            TEXT)  TEXT=$(size -X32_64 $EXENAME | awk '{print $2}')  ;;
-            DATA)  DATA=$(size -X32_64 $EXENAME | awk '{print $4}')  ;;
-            SIZE)  SIZE=$(size -X32_64 $EXENAME | awk '{print $12}')  ;;
-          esac
-        }
-        ;;
-      *hpux*)
-        function size_command()
-        {
-          case $1 in
-            TEXT)  TEXT=$(size  $EXENAME | awk '{print $1}')  ;;
-            DATA)  DATA=$(size  $EXENAME | awk '{print $3}')  ;;
-            SIZE)  SIZE=$(size  $EXENAME | awk '{print $7}')  ;;
-          esac
-        }
-        ;;
-      *irix*)
-        function size_command()
-        {
-          case $1 in
-            TEXT)  TEXT=$(size -4 $EXENAME | awk '{print $1}')  ;;
-            DATA)  DATA=$(size -4 $EXENAME | awk '{print $3}')  ;;
-            SIZE)  SIZE=$(size -4 $EXENAME | awk '{print $7}')  ;;
-          esac
-        }
-        ;;
-      *solaris*)
-        function size_command()
-        {
-          case $1 in
-            TEXT)  TEXT=$(size $EXENAME | awk '{print $1}')  ;;
-            DATA)  DATA=$(size $EXENAME | awk '{print $3}')  ;;
-            SIZE)  SIZE=$(size $EXENAME | awk '{print $7}')  ;;
-          esac
-        }
-        ;;
-      *)
-        echo ' * Warning!  Skipping section sizes!' 1>&2
-        function size_command()
-        {
-        case $1 in
-          TEXT)  TEXT=0 ;;
-          DATA)  DATA=0 ;;
-          SIZE)  SIZE=0 ;;
-        esac
-        }
-        ;;
-    esac
-  fi
-}
-
-# Test for file output
-test_for_output()
-{
-    # This checks for emitted output files, which is useful when
-    # testing file-related output.  The rules for this working are as
-    # follows: the emitted file must have the ".txt" extension, and be
-    # based on the actual *.cc file's name.  For example, 27/filbuf.cc
-    # currently outputs files named 27/filebuf-2.txt and 27/filebuf-3.txt.
-    # Also, the first emitted file must be in the form $NAME-1.txt.
-    # The control file must follow the same constraints, but have a
-    # ".tst" extension.  Thus, you have 27/filebuf-2.tst, etc.
-
-    # NAME contains the source name, like 27/filebuf.cc
-    # From that NAME, we want to generate some possible names, using
-    # ls on MATCH, a pattern description generated with sed.
-
-    # 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 $TEST_NAME | sed 's/\.cc/\*\.tst/g'`"
-    # make sure there is at least one, then go
-    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"
-        ST_MATCH_LIST="`ls $DATA_FILES`"
-        for i in $ST_MATCH_LIST; do
-            # ST_OUT_FILE is generated in the build directory.
-            PRE_NAME2="$TEST_DIR/`basename $i`"
-            ST_OUT_FILE="`echo $PRE_NAME2 | sed 's/tst$/txt/'`"
-            diff $ST_OUT_FILE $i > $DIFF_FILE
-            if [ -s $DIFF_FILE ]; then
-                RESULT="-r"
-            else
-                RESULT="+"
-            fi
-            rm $DIFF_FILE
-        done
-    else
-        # the file does no output, and didn't abnormally
-        # terminate, so assume passed.
-        RESULT="+"
-    fi
-}
-    
-
-#
-# 3: compile, link, execute, time
-#
-# Abstract out the common code for compiling, linking, executing and printing.
-test_file()
-{
-    # NB: S_FLAG has to be last argument because it may be null, and
-    # error checking hasn't been invented yet.
-    NAME=$1
-    EXENAME=$2
-    S_FLAG=$3
-
-    SRC_NAME="$SRC_DIR/testsuite/$1"
-    TEST_NAME="$TEST_DIR/`basename $NAME`"
-
-    # This would be deliciously easy if GNU date's %s were always around.
-    # There are three ways to do this:  1) use the builtin 'time' like we
-    # do later; then getting compiler errors into LOG_FILE is a nightmare.
-    # 2) Grab the output of a formatted date(1) and do the math; harder
-    # 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).
-    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
-    COMP_TIME_END=$($TIMER_COMMAND)
-
-    if [ $COMP_TIME_START -lt $COMP_TIME_END ]; then
-        C_TIME=$[ $COMP_TIME_END - $COMP_TIME_START ]
-    else
-        C_TIME="0"
-    fi
-
-    if [ -f $EXENAME ]; then
-#        rm compile.out
-        size_command TEXT
-        size_command DATA
-        size_command SIZE
-
-        # Actually run the executable and time it.  Note that output
-        # 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; time $LTEXE $EXENAME)"
-        E_ABNORMAL_TERMINATION=$?
-        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
-            # sometimes the OS allows you to name core files yourself:
-            #mv ./*core $EXENAME.core
-            #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
-            rm "$EXENAME"
-        fi
-    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"
-        SIZE="0"
-    fi
-
-    # update the counters
-    if test "$RESULT" = "+" ; then
-        if test x"$S_FLAG" = x"$ST_FLAG"; then
-            static_pass=`expr $static_pass + 1`
-        else
-            shared_pass=`expr $shared_pass + 1`
-        fi
-    else
-        if test x"$S_FLAG" = x"$ST_FLAG"; then
-            static_fail=`expr $static_fail + 1`
-        else
-            shared_fail=`expr $shared_fail + 1`
-        fi
-    fi
-
-    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 >> $RESULTS_FILE
-}
-
-setup_size_command
-echo ""
-echo "Detailed test results in .${RESULTS_FILE/$BUILD_DIR}"
-echo $explanation
-echo "------------------------------------------------------------------------"
-printf "static\tshared\ttest\n"
-echo "------------------------------------------------------------------------"
-
-TEST_TIME_START=$($TIMER_COMMAND)
-for NAME in `cat $TESTS_FILE`
-do
-    PRE_NAME="$TEST_DIR/`basename $NAME`"
-    ST_NAME="`echo $PRE_NAME | sed 's/cc$/st-exe/'`"
-    SH_NAME="`echo $PRE_NAME | sed 's/cc$/sh-exe/'`"
-
-    if test @enable_static@ = yes; then
-        test_file $NAME $ST_NAME "$ST_FLAG"
-    else
-        printf "x\t"
-        printf "static skipped\n" >> $RESULTS_FILE
-    fi
-    if test @enable_shared@ = yes; then
-        test_file $NAME $SH_NAME "$SH_FLAG"
-    else
-        printf "x\t"
-        printf "shared skipped\n" >> $RESULTS_FILE
-    fi
-    printf "%s\n" "$NAME"
-
-    echo "" >> $RESULTS_FILE
-done
-TEST_TIME_END=$($TIMER_COMMAND)
-
-
-#
-# 4: summary
-#
-# 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:  ${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
-sed -e "/^date:/a\\
-$resultstext" $RESULTS_FILE > ${RESULTS_FILE}.tmp
-mv ${RESULTS_FILE}.tmp $RESULTS_FILE
-
-if [ $TEST_TIME_START -lt $TEST_TIME_END ]; then
-    TEST_TIME=$[ $TEST_TIME_END - $TEST_TIME_START ]
-    echo "testrun == $TEST_TIME seconds"
-    echo "testrun == $TEST_TIME seconds" >> $RESULTS_FILE
-fi
-
-exit 0
diff --git a/libstdc++-v3/scripts/check_survey.in b/libstdc++-v3/scripts/check_survey.in
new file mode 100755 (executable)
index 0000000..3baad37
--- /dev/null
@@ -0,0 +1,449 @@
+#!/usr/bin/env bash
+
+# Script to do automated testing and data collection for various test
+# files, so that we don't have to do this by hand on every test file.
+# It attempts to collect some diagnostic info about size and speed that
+# should be useful in the future as the library gets tuned for size
+# and speed.  In addition, it tests static and shared linkage, iff each
+# has been enabled.
+
+# Invocation 
+# check_survey [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 check_survey"
+  echo "$0: testing the build directory"
+elif [ "$WHICH"x = 1x ]; then
+  echo "running check_survey"
+  echo "$0: testing the install directory"
+else
+  echo 'Usage: check_survey 0    /* test the build directory    */'
+  echo '       check_survey 1    /* test the install directory  */'
+  exit 1;
+fi
+
+# Now that we've successfully translated the numerical option into
+# a symbolic one, we can safely ignore it.
+shift
+
+# This has been true all along.  Found out about it the hard way...
+case $BASH_VERSION in
+    1*)  echo 'You need bash 2.x to run check_survey.  Exiting.'; exit 1 ;;
+    *)   ;;   # ??
+esac
+
+BUILD_DIR=@glibcpp_builddir@
+SRC_DIR=@glibcpp_srcdir@
+PREFIX_DIR=@glibcpp_prefixdir@
+if [ "$WHICH"x = 0x ]; then
+  CXX=`$BUILD_DIR/scripts/testsuite_flags --build-cxx`
+  INCLUDES=`$BUILD_DIR/scripts/testsuite_flags --build-includes`
+else
+  CXX=`$BUILD_DIR/scripts/testsuite_flags --install-cxx`
+  INCLUDES=`$BUILD_DIR/scripts/testsuite_flags --install-includes`
+fi
+CXXFLAGS=`$BUILD_DIR/scripts/testsuite_flags --cxxflags`
+LIBTOOL="$BUILD_DIR/libtool"
+LTEXE="$LIBTOOL --mode=execute"
+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"
+
+# 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    
+fi
+
+# the name of the file that will collect and hold all this useful data:
+RESULTS_FILE="$TEST_DIR/$(date +%Y%m%d)-check_survey.txt"
+
+# the name of the log file that will append compiler diagnostics:
+LOG_FILE="$TEST_DIR/$(date +%Y%m%d)-check_survey_log.txt"
+
+#
+# 2: clean, make files, append general test info
+#
+
+# 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*
+
+if [ -f $RESULTS_FILE ]; then
+    rm $RESULTS_FILE
+fi
+if [ -f $LOG_FILE ]; then
+    rm $LOG_FILE
+fi
+
+# the names of the specific test files to be run
+TESTS_FILE="$TEST_DIR/$(date +%Y%m%d)-check_survey_files.txt"
+
+# Make a list of the files we're going to run, or use an old one if it exists.
+if [ ! -f "$TESTS_FILE" ]; then
+  if [ -f "$TEST_DIR/testsuite_files" ]; then
+      cp $TEST_DIR/testsuite_files $TESTS_FILE
+  else
+    echo "making file $TESTS_FILE"
+    for LONG_NAME in $SRC_DIR/testsuite/*/*.cc
+    do
+        DIR_NAME=$(dirname $LONG_NAME)
+        SHORT_NAME="`basename $DIR_NAME`/`basename $LONG_NAME`"
+        echo "$SHORT_NAME" >> $TESTS_FILE
+    done
+  fi
+fi
+
+# Nasty solution to replace GNU date(1)'s %s time_t output function.
+TIMER_COMMAND=$TEST_DIR/printnow.exe
+if [ ! -x "$TIMER_COMMAND" ]; then
+    echo "making utility $TIMER_COMMAND"
+    gcc -o "$TIMER_COMMAND" "$SRC_DIR/testsuite/printnow.c"
+    strip "$TIMER_COMMAND"
+fi
+
+# Copy over the data files for filebufs
+cp $SRC_DIR/testsuite/27_io/*.txt $TEST_DIR
+cp $SRC_DIR/testsuite/27_io/*.tst $TEST_DIR
+chmod u+w $TEST_DIR/*.txt
+chmod u+w $TEST_DIR/*.tst
+
+# Emit useful info about compiler and platform
+echo "host: $(uname -mrsv)" >> $RESULTS_FILE
+echo "compiler: $($CXX -v 2>&1)" >> $RESULTS_FILE
+echo "compiler flags: $CXXFLAGS" >> $RESULTS_FILE
+echo "date: $(date +%Y%m%d)" >> $RESULTS_FILE
+echo "" >> $RESULTS_FILE
+
+explanation='+: pass, -b: build failure, -r: run failure, x: disabled'
+printf "%s\n     %s\n"  'p == pass/fail execution test'  "$explanation"  \
+       >> $RESULTS_FILE
+echo "ctime == time to compile and link" >> $RESULTS_FILE
+echo "etime == time for executable to run" >> $RESULTS_FILE
+echo "text == size of the executable text section" >> $RESULTS_FILE
+echo "data == size of the executable data section" >> $RESULTS_FILE
+echo "total == size of the executable" >> $RESULTS_FILE
+echo "" >> $RESULTS_FILE
+
+echo "p" | awk '{printf("%s ", $1)}' >> $RESULTS_FILE
+echo "ctime" "etime" | awk '{printf("%s\t%s\t", $1, $2)}' >> $RESULTS_FILE
+echo "text" "data" | awk '{printf("%s\t%s\t", $1, $2)}' >> $RESULTS_FILE
+echo "total" "name" | awk '{printf("%s\t%s\t", $1, $2)}' >> $RESULTS_FILE
+echo "" >> $RESULTS_FILE
+
+# Counters.  These could be members of an array, but they'd all have to
+# become individuals anyhow if we ever change this script to super-portable sh.
+shared_pass=0
+shared_fail=0
+static_pass=0
+static_fail=0
+
+
+#
+# 2.5:  support functions
+#
+
+# Figure out how to extract size information from binaries.  We take
+# the text of the value we want as an argument, and leave the size in
+# the appropriate variable.
+#
+# We discover what kind of size(1) we are using *once* and build a shell
+# function named 'size_command' to wrap it.  (The "function" keyword is
+# redundant here, but helps me read it, so there.)  Previously we were
+# re-discovering the size(1) arguments three times for each test; sloooow.
+#
+# It is VERY IMPORTANT not to compare these numbers across platforms.
+# Different size(1)'s extract section information differently.  For
+# example, using the native Sun size(1) and GNU size(1) built for Suns
+# on the exact same binary will give very different numbers, due to all
+# the variance in command-line options and arbitrary names of ELF sections.
+#
+# and suddenly we go to 2-space indentations...
+setup_size_command()
+{
+  if size --version 2> /dev/null | grep -c GNU > /dev/null;
+  then    # Then we're using a GNU size(1) built for this platform.
+    # We lose .rodata and .data1 and who knows what else... kludge.
+    function size_command()
+    {
+      case $1 in
+        TEXT)  TEXT=$(size -B $EXENAME | tail -1 | awk '{print $1}')  ;;
+        DATA)  DATA=$(size -B $EXENAME | tail -1 | awk '{print $2}')  ;;
+        SIZE)  SIZE=$(size -B $EXENAME | tail -1 | awk '{print $4}')  ;;
+      esac
+    }
+  else
+    # Not using GNU size; check for platform.  These numbers seem to match
+    # up to text/data/total, although their meanings seem to be different.
+    # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
+    case @host_os@ in
+      *aix*)
+        function size_command()
+        {
+          case $1 in
+            TEXT)  TEXT=$(size -X32_64 $EXENAME | awk '{print $2}')  ;;
+            DATA)  DATA=$(size -X32_64 $EXENAME | awk '{print $4}')  ;;
+            SIZE)  SIZE=$(size -X32_64 $EXENAME | awk '{print $12}')  ;;
+          esac
+        }
+        ;;
+      *hpux*)
+        function size_command()
+        {
+          case $1 in
+            TEXT)  TEXT=$(size  $EXENAME | awk '{print $1}')  ;;
+            DATA)  DATA=$(size  $EXENAME | awk '{print $3}')  ;;
+            SIZE)  SIZE=$(size  $EXENAME | awk '{print $7}')  ;;
+          esac
+        }
+        ;;
+      *irix*)
+        function size_command()
+        {
+          case $1 in
+            TEXT)  TEXT=$(size -4 $EXENAME | awk '{print $1}')  ;;
+            DATA)  DATA=$(size -4 $EXENAME | awk '{print $3}')  ;;
+            SIZE)  SIZE=$(size -4 $EXENAME | awk '{print $7}')  ;;
+          esac
+        }
+        ;;
+      *solaris*)
+        function size_command()
+        {
+          case $1 in
+            TEXT)  TEXT=$(size $EXENAME | awk '{print $1}')  ;;
+            DATA)  DATA=$(size $EXENAME | awk '{print $3}')  ;;
+            SIZE)  SIZE=$(size $EXENAME | awk '{print $7}')  ;;
+          esac
+        }
+        ;;
+      *)
+        echo ' * Warning!  Skipping section sizes!' 1>&2
+        function size_command()
+        {
+        case $1 in
+          TEXT)  TEXT=0 ;;
+          DATA)  DATA=0 ;;
+          SIZE)  SIZE=0 ;;
+        esac
+        }
+        ;;
+    esac
+  fi
+}
+
+# Test for file output
+test_for_output()
+{
+    # This checks for emitted output files, which is useful when
+    # testing file-related output.  The rules for this working are as
+    # follows: the emitted file must have the ".txt" extension, and be
+    # based on the actual *.cc file's name.  For example, 27/filbuf.cc
+    # currently outputs files named 27/filebuf-2.txt and 27/filebuf-3.txt.
+    # Also, the first emitted file must be in the form $NAME-1.txt.
+    # The control file must follow the same constraints, but have a
+    # ".tst" extension.  Thus, you have 27/filebuf-2.tst, etc.
+
+    # NAME contains the source name, like 27/filebuf.cc
+    # From that NAME, we want to generate some possible names, using
+    # ls on MATCH, a pattern description generated with sed.
+
+    # 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 $TEST_NAME | sed 's/\.cc/\*\.tst/g'`"
+    # make sure there is at least one, then go
+    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"
+        ST_MATCH_LIST="`ls $DATA_FILES`"
+        for i in $ST_MATCH_LIST; do
+            # ST_OUT_FILE is generated in the build directory.
+            PRE_NAME2="$TEST_DIR/`basename $i`"
+            ST_OUT_FILE="`echo $PRE_NAME2 | sed 's/tst$/txt/'`"
+            diff $ST_OUT_FILE $i > $DIFF_FILE
+            if [ -s $DIFF_FILE ]; then
+                RESULT="-r"
+            else
+                RESULT="+"
+            fi
+            rm $DIFF_FILE
+        done
+    else
+        # the file does no output, and didn't abnormally
+        # terminate, so assume passed.
+        RESULT="+"
+    fi
+}
+    
+
+#
+# 3: compile, link, execute, time
+#
+# Abstract out the common code for compiling, linking, executing and printing.
+test_file()
+{
+    # NB: S_FLAG has to be last argument because it may be null, and
+    # error checking hasn't been invented yet.
+    NAME=$1
+    EXENAME=$2
+    S_FLAG=$3
+
+    SRC_NAME="$SRC_DIR/testsuite/$1"
+    TEST_NAME="$TEST_DIR/`basename $NAME`"
+
+    # This would be deliciously easy if GNU date's %s were always around.
+    # There are three ways to do this:  1) use the builtin 'time' like we
+    # do later; then getting compiler errors into LOG_FILE is a nightmare.
+    # 2) Grab the output of a formatted date(1) and do the math; harder
+    # 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).
+    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
+    COMP_TIME_END=$($TIMER_COMMAND)
+
+    if [ $COMP_TIME_START -lt $COMP_TIME_END ]; then
+        C_TIME=$[ $COMP_TIME_END - $COMP_TIME_START ]
+    else
+        C_TIME="0"
+    fi
+
+    if [ -f $EXENAME ]; then
+#        rm compile.out
+        size_command TEXT
+        size_command DATA
+        size_command SIZE
+
+        # Actually run the executable and time it.  Note that output
+        # 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; time $LTEXE $EXENAME)"
+        E_ABNORMAL_TERMINATION=$?
+        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
+            # sometimes the OS allows you to name core files yourself:
+            #mv ./*core $EXENAME.core
+            #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
+            rm "$EXENAME"
+        fi
+    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"
+        SIZE="0"
+    fi
+
+    # update the counters
+    if test "$RESULT" = "+" ; then
+        if test x"$S_FLAG" = x"$ST_FLAG"; then
+            static_pass=`expr $static_pass + 1`
+        else
+            shared_pass=`expr $shared_pass + 1`
+        fi
+    else
+        if test x"$S_FLAG" = x"$ST_FLAG"; then
+            static_fail=`expr $static_fail + 1`
+        else
+            shared_fail=`expr $shared_fail + 1`
+        fi
+    fi
+
+    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 >> $RESULTS_FILE
+}
+
+setup_size_command
+echo ""
+echo "Detailed test results in .${RESULTS_FILE/$BUILD_DIR}"
+echo $explanation
+echo "------------------------------------------------------------------------"
+printf "static\tshared\ttest\n"
+echo "------------------------------------------------------------------------"
+
+TEST_TIME_START=$($TIMER_COMMAND)
+for NAME in `cat $TESTS_FILE`
+do
+    PRE_NAME="$TEST_DIR/`basename $NAME`"
+    ST_NAME="`echo $PRE_NAME | sed 's/cc$/st-exe/'`"
+    SH_NAME="`echo $PRE_NAME | sed 's/cc$/sh-exe/'`"
+
+    if test @enable_static@ = yes; then
+        test_file $NAME $ST_NAME "$ST_FLAG"
+    else
+        printf "x\t"
+        printf "static skipped\n" >> $RESULTS_FILE
+    fi
+    if test @enable_shared@ = yes; then
+        test_file $NAME $SH_NAME "$SH_FLAG"
+    else
+        printf "x\t"
+        printf "shared skipped\n" >> $RESULTS_FILE
+    fi
+    printf "%s\n" "$NAME"
+
+    echo "" >> $RESULTS_FILE
+done
+TEST_TIME_END=$($TIMER_COMMAND)
+
+
+#
+# 4: summary
+#
+# 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:  ${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
+sed -e "/^date:/a\\
+$resultstext" $RESULTS_FILE > ${RESULTS_FILE}.tmp
+mv ${RESULTS_FILE}.tmp $RESULTS_FILE
+
+if [ $TEST_TIME_START -lt $TEST_TIME_END ]; then
+    TEST_TIME=$[ $TEST_TIME_END - $TEST_TIME_START ]
+    echo "testrun == $TEST_TIME seconds"
+    echo "testrun == $TEST_TIME seconds" >> $RESULTS_FILE
+fi
+
+exit 0
diff --git a/libstdc++-v3/scripts/extract_symvers b/libstdc++-v3/scripts/extract_symvers
new file mode 100755 (executable)
index 0000000..e7b6645
--- /dev/null
@@ -0,0 +1,64 @@
+#!/bin/sh
+
+# Copyright (C) 2002 Free Software Foundation, Inc.
+#
+# This file is part of the GNU ISO C++ Library.  This library is free
+# software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this library; see the file COPYING.  If not, write to the Free
+# Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+# USA.
+#
+# As a special exception, you may use this file as part of a free software
+# library without restriction.  Specifically, if other files instantiate
+# templates or use macros or inline functions from this file, or you compile
+# this file and link it with other files to produce an executable, this
+# file does not by itself cause the resulting executable to be covered by
+# the GNU General Public License.  This exception does not however
+# invalidate any other reasons why the executable file might be covered by
+# the GNU General Public License.
+
+
+if test ${#} -lt 2 || test $1 = '--help'; then
+  echo "Usage:  extract_symvers  shared_lib output_file" 1>&2
+  exit 1
+fi
+
+lib=$1
+output=$2
+
+# GNU binutils, somewhere after version 2.11.2, requires -W/--wide to avoid
+# default line truncation.  -W is not supported and truncation did not occur
+# by default before that point.
+readelf="readelf --symbols"
+if readelf --help | grep -- --wide > /dev/null; then
+    readelf="$readelf --wide"
+fi
+
+# This avoids weird sorting problems later.
+export LC_ALL=C
+
+tmp=extract.$$
+
+${readelf} ${lib} | sed '/\.dynsym/,/^$/p;d' | egrep -v ' (LOCAL|UND) ' |\
+awk '{ if ($4 == "FUNC" || $4 == "NOTYPE")
+         printf "%s:%s\n", $4, $8;
+       else if ($4 == "OBJECT")
+         printf "%s:%s:%s\n", $4, $3, $8;
+     }' | sort | uniq > $tmp 2>&1
+#       else printf "Huh?  What is %s?\n", $8;
+
+
+# I think we'll be doing some more with this file, but for now, dump.
+mv $tmp $output
+
+exit 0
diff --git a/libstdc++-v3/scripts/testsuite_flags.in b/libstdc++-v3/scripts/testsuite_flags.in
new file mode 100755 (executable)
index 0000000..4858c2e
--- /dev/null
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+#
+# This script computes the various flags needed to run GNU C++ testsuites
+# (compiler specific as well as library specific). 
+#
+# Written by Benjamin Kosnik <bkoz@redhat.com>
+#            Gabriel Dos Reis <gdr@codesourcery.com>
+#
+
+# Print a message saying how this script is intended to be invoked
+print_usage() {
+    cat <<EOF
+Usage: 
+    testsuite_flags --install-includes
+                   --build-includes
+                   --build-cxx
+                   --install-cxx
+                   --cxxflags
+EOF
+}
+
+# Establish configure-generated directory structure.
+BUILD_DIR=@glibcpp_builddir@
+SRC_DIR=@glibcpp_srcdir@
+PREFIX_DIR=@glibcpp_prefixdir@
+query=$1
+
+case ${query} in
+    --install-includes)
+      INCLUDES="-I${SRC_DIR}/testsuite"
+      echo ${INCLUDES}
+      ;;
+    --build-includes)
+      INCLUDES="-nostdinc++ @GLIBCPP_INCLUDES@
+               -I${SRC_DIR}/libsupc++ -I${SRC_DIR}/libio 
+               -I${SRC_DIR}/include/backward 
+               -I${SRC_DIR}/testsuite"
+      echo ${INCLUDES}
+      ;;
+    --install-cxx)
+      CXX=${PREFIX_DIR}/bin/g++
+      echo ${CXX}
+      ;;
+    --build-cxx)
+      PCHFLAGS="@glibcpp_PCHFLAGS@"
+      CXX_build="@glibcpp_CXX@ ${PCHFLAGS}"
+      CXX=`echo "$CXX_build" | sed 's,gcc/xgcc ,gcc/g++ ,'`
+      echo ${CXX}
+      ;;
+    --cxxflags)
+      CXXFLAGS_save="-g -O2"
+      CXXFLAGS_config='@SECTION_FLAGS@ @SECTION_LDFLAGS@ -fmessage-length=0 
+                     @EXTRA_CXX_FLAGS@ -DLOCALEDIR="@glibcpp_localedir@" '
+      echo ${CXXFLAGS_save} ${CXXFLAGS_config}
+      ;;
+    *)
+      print_usage
+      ;;
+esac
+
+exit 0
index 7e5af5e37c9fbc535cb578c1fd7a9f62228978db..fe23b81ee4d18ff618a77df80ee99d74b3094d44 100644 (file)
@@ -37,14 +37,19 @@ AM_RUNTESTFLAGS =
 RUNTESTFLAGS =
 
 ## CXX is actually a "C" compiler. These are real C++ programs.
-## Do the same thing as `testsuite_flags --build-cxx`
-CXX_build = @glibcpp_CXX@ 
-CXX=`echo "$(CXX_build)" | sed 's,gcc/xgcc ,gcc/g++ ,'`
+glibcpp_srcdir=@glibcpp_srcdir@
+glibcpp_builddir=@glibcpp_builddir@
+testsuite_flags_script=${glibcpp_builddir}/scripts/testsuite_flags
+CXX=`${testsuite_flags_script} --build-cxx`
+
 CXXLINK = \
        LD_RUN_PATH=$${LD_RUN_PATH:+$$LD_RUN_PATH:}${glibcpp_builddir}/src/.libs\
        $(LIBTOOL) --tag=CXX --mode=link $(CXX) \
        $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
 
+GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
+LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
+TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
 INCLUDES = \
        -nostdinc++ \
        @GLIBCPP_INCLUDES@ @LIBSUPCXX_INCLUDES@ @TOPLEVEL_INCLUDES@ 
@@ -79,7 +84,7 @@ check-am:
 check-local: check-abi
 
 baseline_file = @baseline_file@
-extract_symvers = @glibcpp_srcdir@/config/abi/extract_symvers
+extract_symvers = @glibcpp_srcdir@/scripts/extract_symvers
 
 current_symbols.txt: ${extract_symvers} ../src/.libs/libstdc++.so
          -@(${extract_symvers} ../src/.libs/libstdc++.so current_symbols.txt)
@@ -116,6 +121,31 @@ check-abi-verbose:
 endif
 
 
+# These two special 'check-script' rules use the bash script 'check'
+# 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_survey = ${glibcpp_builddir}/scripts/check_survey
+check-script: ${check_survey}
+       -@(chmod + ${check_survey}; \
+         ${check_survey} 0)
+
+check-script-install: ${check_survey}
+       -@(chmod + ${check_survey}; \
+         ${check_survey} 0)
+
+
+# Runs the testsuite/performance tests.  
+# Some of these tests create large (~75MB) files, allocate huge
+# ammounts of memory, or otherwise tie up machine resources. Thus,
+# running this is off by default.
+check_performance=${glibcpp_srcdir}/scripts/check_performance
+check-performance: ${check_performance}
+       -@(chmod + ${check_performance}; \
+         ${check_performance} ${glibcpp_srcdir} ${glibcpp_builddir})
+
+
 # By adding these files here, automake will remove them for 'make clean'
 CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \
-            testsuite_* site.exp abi_check 
+            testsuite_* site.exp abi_check baseline_symbols
index bd1e20b541cf6c78588e3f88caee701ec17f57af..3df92864cadfd394bc3079e43e45a65d21123897 100644 (file)
@@ -93,11 +93,9 @@ EXEEXT = @EXEEXT@
 EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
 GCJ = @GCJ@
 GCJFLAGS = @GCJFLAGS@
-GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
 GLIBCPP_IS_CROSS_COMPILING = @GLIBCPP_IS_CROSS_COMPILING@
 LIBMATHOBJS = @LIBMATHOBJS@
 LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
-LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
 LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
 LIBTOOL = @LIBTOOL@
 LIBUNWIND_FLAG = @LIBUNWIND_FLAG@
@@ -115,7 +113,6 @@ SECTION_FLAGS = @SECTION_FLAGS@
 SECTION_LDFLAGS = @SECTION_LDFLAGS@
 STRIP = @STRIP@
 SYMVER_MAP = @SYMVER_MAP@
-TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
 WARN_FLAGS = @WARN_FLAGS@
@@ -128,10 +125,8 @@ glibcpp_MOFILES = @glibcpp_MOFILES@
 glibcpp_PCHFLAGS = @glibcpp_PCHFLAGS@
 glibcpp_POFILES = @glibcpp_POFILES@
 glibcpp_basedir = @glibcpp_basedir@
-glibcpp_builddir = @glibcpp_builddir@
 glibcpp_localedir = @glibcpp_localedir@
 glibcpp_prefixdir = @glibcpp_prefixdir@
-glibcpp_srcdir = @glibcpp_srcdir@
 glibcpp_thread_h = @glibcpp_thread_h@
 glibcpp_toolexecdir = @glibcpp_toolexecdir@
 glibcpp_toolexeclibdir = @glibcpp_toolexeclibdir@
@@ -157,14 +152,20 @@ RUNTEST = `if [ -f @glibcpp_srcdir@/../dejagnu/runtest ] ; then \
 AM_RUNTESTFLAGS = 
 RUNTESTFLAGS = 
 
-CXX_build = @glibcpp_CXX@ 
-CXX = `echo "$(CXX_build)" | sed 's,gcc/xgcc ,gcc/g++ ,'`
+glibcpp_srcdir = @glibcpp_srcdir@
+glibcpp_builddir = @glibcpp_builddir@
+testsuite_flags_script = ${glibcpp_builddir}/scripts/testsuite_flags
+CXX = `${testsuite_flags_script} --build-cxx`
+
 CXXLINK = \
        LD_RUN_PATH=$${LD_RUN_PATH:+$$LD_RUN_PATH:}${glibcpp_builddir}/src/.libs\
        $(LIBTOOL) --tag=CXX --mode=link $(CXX) \
        $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
 
 
+GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
+LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
+TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
 INCLUDES = \
        -nostdinc++ \
        @GLIBCPP_INCLUDES@ @LIBSUPCXX_INCLUDES@ @TOPLEVEL_INCLUDES@ 
@@ -177,11 +178,24 @@ libv3test_a_SOURCES = testsuite_hooks.cc testsuite_allocator.cc
 abi_check_SOURCES = abi_check.cc
 
 baseline_file = @baseline_file@
-extract_symvers = @glibcpp_srcdir@/config/abi/extract_symvers
+extract_symvers = @glibcpp_srcdir@/scripts/extract_symvers
+
+# These two special 'check-script' rules use the bash script 'check'
+# 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_survey = ${glibcpp_builddir}/scripts/check_survey
+
+# Runs the testsuite/performance tests.  
+# Some of these tests create large (~75MB) files, allocate huge
+# ammounts of memory, or otherwise tie up machine resources. Thus,
+# running this is off by default.
+check_performance = ${glibcpp_srcdir}/scripts/check_performance
 
 # By adding these files here, automake will remove them for 'make clean'
 CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \
-            testsuite_* site.exp abi_check 
+            testsuite_* site.exp abi_check baseline_symbols
 
 mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
 CONFIG_HEADER = ../config.h
@@ -510,6 +524,16 @@ new-abi-baseline:
 @GLIBCPP_TEST_ABI_TRUE@        -@(./abi_check --check-verbose ./current_symbols.txt ${baseline_file})
 @GLIBCPP_TEST_ABI_FALSE@check-abi:
 @GLIBCPP_TEST_ABI_FALSE@check-abi-verbose:
+check-script: ${check_survey}
+       -@(chmod + ${check_survey}; \
+         ${check_survey} 0)
+
+check-script-install: ${check_survey}
+       -@(chmod + ${check_survey}; \
+         ${check_survey} 0)
+check-performance: ${check_performance}
+       -@(chmod + ${check_performance}; \
+         ${check_performance} ${glibcpp_srcdir} ${glibcpp_builddir})
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
index 6a4351c21e5f6bb6e945774f42d91b08b68f79a9..e9722ac660eb618b4aa2ffd7beec51e47633354a 100644 (file)
@@ -110,7 +110,7 @@ proc libstdc++-v3-init { args } {
       set includes "-I./"
     } else {
         # If we find a testsuite_flags file, we're testing in the build dir.
-        set flags_file "${blddir}/testsuite_flags"
+        set flags_file "${blddir}/scripts/testsuite_flags"
         if { [file exists $flags_file] } {
             set cxx [exec sh $flags_file --build-cxx]
             set cxxflags [exec sh $flags_file --cxxflags]
diff --git a/libstdc++-v3/testsuite_flags.in b/libstdc++-v3/testsuite_flags.in
deleted file mode 100755 (executable)
index 4858c2e..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/sh
-
-#
-# This script computes the various flags needed to run GNU C++ testsuites
-# (compiler specific as well as library specific). 
-#
-# Written by Benjamin Kosnik <bkoz@redhat.com>
-#            Gabriel Dos Reis <gdr@codesourcery.com>
-#
-
-# Print a message saying how this script is intended to be invoked
-print_usage() {
-    cat <<EOF
-Usage: 
-    testsuite_flags --install-includes
-                   --build-includes
-                   --build-cxx
-                   --install-cxx
-                   --cxxflags
-EOF
-}
-
-# Establish configure-generated directory structure.
-BUILD_DIR=@glibcpp_builddir@
-SRC_DIR=@glibcpp_srcdir@
-PREFIX_DIR=@glibcpp_prefixdir@
-query=$1
-
-case ${query} in
-    --install-includes)
-      INCLUDES="-I${SRC_DIR}/testsuite"
-      echo ${INCLUDES}
-      ;;
-    --build-includes)
-      INCLUDES="-nostdinc++ @GLIBCPP_INCLUDES@
-               -I${SRC_DIR}/libsupc++ -I${SRC_DIR}/libio 
-               -I${SRC_DIR}/include/backward 
-               -I${SRC_DIR}/testsuite"
-      echo ${INCLUDES}
-      ;;
-    --install-cxx)
-      CXX=${PREFIX_DIR}/bin/g++
-      echo ${CXX}
-      ;;
-    --build-cxx)
-      PCHFLAGS="@glibcpp_PCHFLAGS@"
-      CXX_build="@glibcpp_CXX@ ${PCHFLAGS}"
-      CXX=`echo "$CXX_build" | sed 's,gcc/xgcc ,gcc/g++ ,'`
-      echo ${CXX}
-      ;;
-    --cxxflags)
-      CXXFLAGS_save="-g -O2"
-      CXXFLAGS_config='@SECTION_FLAGS@ @SECTION_LDFLAGS@ -fmessage-length=0 
-                     @EXTRA_CXX_FLAGS@ -DLOCALEDIR="@glibcpp_localedir@" '
-      echo ${CXXFLAGS_save} ${CXXFLAGS_config}
-      ;;
-    *)
-      print_usage
-      ;;
-esac
-
-exit 0