head	1.2;
access;
symbols;
locks; strict;
comment	@# @;


1.2
date	99.05.12.00.14.57;	author bkoz;	state dead;
branches;
next	1.1;

1.1
date	99.05.11.23.55.49;	author bkoz;	state Exp;
branches;
next	;


desc
@@


1.2
log
@#
1999-05-11  Benjamin Kosnik  <bkoz@@loony.cygnus.com>
	* stl/bits/stl_config.h (__USE_MALLOC): Change underlying allocator.
	Check __USE_MALLOC before defining specializations containing
	__default_alloc_template.
	* src/stl-inst.cc: Here too.
	* bits/basic_string.h: Change.
	* testsuite/make_check_libfree++: More tweaks.
	* testsuite/21/capacity.cc: New file.
	* src/string.cc: Rename to be consistent with other inst files.
	Rename to string-inst.cc.
	* src/string*.cc: Change include.
	* src/wstring.cc: Rename to wstring-inst.cc.
	* src/wstring*.cc: Ditto.
	* src/Makefile.in: Also here.
	* src/Makefile.am: Ditto.
	* src/traits.cc: Remove.
	* src/wtraits.cc: Same.
	Try a new way of organizing documentation, one with synchronicity
	between testsuites and docs subdirectories, and see who yelps.
	* docs/html: Remove, use chapter and subject specific directories
	instead of forcing things immediately into format of
	documentation.
	* docs/text: Same.
	* docs/image: Same.
	* docs/faq/text, docs/faq/html: Remove, put in the docs/faq
	directory and sort by filename and extension.
	* docs/17_intro, 18_support, 19_diagnostics, 20_util, 21_strings,
	22_locale, 23_containers, 24_iterators, 25_algorithms,
	26_numerics, 27_io: Add.
	* docs/17_intro/*: Populate with all the text files. . .
	* docs/index.html: Construct.
	* testsuite/*: Update with same names as the docs subdir.
	* testsuite/results: Where to stash conformance results for the
	different snapshots, so that progress/size/speed issues can be
	tracked over time.
@
text
@#!/usr/unsupported/bin/bash

# 990417 bkoz 
# Script to avoid doing this on every test file:

# g++ -g -static -I../std -I.. -I../stl -I../libio -L/mnt/hd/bliss/bld-x86-libstdc++/src/.libs 27/boolfmt.cc 

# In addition, 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.

#
# 1: variables
#
# include path to new headers for use on gcc command-line
INC_PATH="-I../std -I.. -I../stl -I../libio"
#INC_PATH="-I/mnt/hd/bliss/H-x86-libstdc++/include/g++-v3"
# include path to new library for use on gcc command-line
LIB_PATH="-L/mnt/hd/bliss/bld-x86-libstdc++/src/.libs"
#LIB_PATH="-L/mnt/hd/bliss/H-x86-libstdc++/lib"
# gcc compiler flags
CXX_FLAG="-g -O2 -DDEBUG_ASSERT"
# a specific flag to force the use of shared libraries, if any
SH_FLAG=
# a specific flag to force the use of static libraries, if any
ST_FLAG="-static"
# the name of the file that will collect and hold all this useful data:
RESULTS_FILE="$(date +%y%m%d)-results.txt"
# the name of the log file that will append compiler diagnostics:
LOG_FILE="$(date +%y%m%d)-log.txt"

#
# 2: clean, append general test info
#
if [ -f $RESULTS_FILE ]; then
    rm $RESULTS_FILE
fi
if [ -f $LOG_FILE ]; then
    rm $LOG_FILE
fi
# Remove old executables.
rm -rf */*exe
# Remove old data files produced by these executables.
rm -rf 27/filebuf-2.txt
rm -rf 27/filebuf-3.txt
rm -rf core */core
echo "host: $(uname -mrsv)" >> $RESULTS_FILE
echo "compiler: $(g++ --version)" >> $RESULTS_FILE
echo "compiler flags: $CXX_FLAG" >> $RESULTS_FILE
echo "" >> $RESULTS_FILE

echo "time" "exec" | 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

for NAME in */*.cc
do
    ST_NAME="`echo $NAME | sed 's/cc$/st-exe/'`"
    SH_NAME="`echo $NAME | sed 's/cc$/sh-exe/'`"
    echo "testing $NAME"

    #
    # 3: static compile, link, execute, time
    #
    ST_TIME_START="$(date +%s)"
    g++ $CXX_FLAG $ST_FLAG $INC_PATH $LIB_PATH $NAME -o $ST_NAME >& $LOG_FILE
#    g++ $CXX_FLAG $ST_FLAG $INC_PATH $LIB_PATH $NAME -o $ST_NAME 
    ST_TIME_END="$(date +%s)"
    if [ $ST_TIME_START -lt $ST_TIME_END ]; then
	ST_TIME=$[ $ST_TIME_END - $ST_TIME_START ]
    else
	ST_TIME="0"
    fi

    if [ -f $ST_NAME ]; then
	ST_TEXT="$(size -A $ST_NAME | grep text | awk '{print $2}')"
	ST_DATA="$(size -A $ST_NAME | grep data | awk '{print $2}')"
	ST_SIZE="$(size -A $ST_NAME | grep otal | awk '{print $2}')"
	$ST_NAME
	if [ -f core ]; then
	    ST_EXEC="fail"
	    echo "st_fail" | awk '{printf("\t%s\t", $1)}'
	    rm core
	else
	    # XXX this should probably be a function? 

	    # 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
	    # 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 $NAME | sed 's/cc$/diff/'`"
	    # construct wildcard names,ie for $NAME=filebuf.cc, makes
	    # "filebuf*.tst"
	    ST_DATA_FILES="`echo $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'`"
	    if [ -f $ST_E ]; then
		# list of actual files that match the wildcard above, ie
		# "filebuf-1.tst"
		ST_MATCH_LIST="`ls $ST_DATA_FILES`"
		for i in $ST_MATCH_LIST
		    do
			ST_OUT_FILE=`echo $i | sed 's/\.tst/\*\.txt/g'`
			diff $ST_OUT_FILE $i > $DIFF_FILE
			if [ -s $DIFF_FILE ]; then
			    ST_EXEC="fail"
			    echo "st_fail" | awk '{printf("\t%s\t", $1)}'
			else
			    ST_EXEC="pass"
			    echo "st_pass" | awk '{printf("\t%s\t", $1)}'
			fi
#			rm $DIFF_FILE
		    done
		else
		    # the file does no output, and didn't core, so
		    # assume passed.
		    ST_EXEC="pass"
		    echo "st_pass" | awk '{printf("\t%s\t", $1)}'
		fi
	    fi
	rm $ST_NAME
    else
	ST_EXEC="fail"
	echo "st_fail" | awk '{printf("\t%s\t", $1)}'
	ST_TEXT="0"
	ST_DATA="0"
	ST_SIZE="0"
    fi
    echo $ST_TIME $ST_EXEC | awk '{printf ("%s\t%s\t", $1, $2)}'>>$RESULTS_FILE
    echo $ST_TEXT $ST_DATA | awk '{printf ("%s\t%s\t", $1, $2)}'>>$RESULTS_FILE
    echo $ST_SIZE $ST_NAME | awk '{printf ("%s\t%s\n", $1, $2)}'>>$RESULTS_FILE


    #
    # 4: shared compile, link, execute, time
    #
    SH_TIME_START="$(date +%s)"
#    g++ $CXX_FLAG $SH_FLAG $INC_PATH $LIB_PATH $NAME -o $SH_NAME >& $LOG_FILE
    g++ $CXX_FLAG $SH_FLAG $INC_PATH $LIB_PATH $NAME -o $SH_NAME 
    SH_TIME_END="$(date +%s)"
    if [ $SH_TIME_START -lt $SH_TIME_END ]; then
	SH_TIME=$[ $SH_TIME_END - $SH_TIME_START ]
    else
	SH_TIME="0"
    fi

    if [ -f $SH_NAME ]; then
	SH_TEXT="$(size -A $SH_NAME | grep text | awk '{print $2}')"
	SH_DATA="$(size -A $SH_NAME | grep data | awk '{print $2}')"
	SH_SIZE="$(size -A $SH_NAME | grep otal | awk '{print $2}')"
	$SH_NAME
	if [ -f core ]; then
	    SH_EXEC="fail"
	    echo "sh_fail" | awk '{printf("%s\n", $1)}'
	    rm core
	else
	    SH_EXEC="pass"
	    echo "sh_pass" | awk '{printf("%s\n", $1)}'
	fi
	rm $SH_NAME
    else
	SH_EXEC="fail" | awk '{printf("%s\n", $1)}'
	echo "sh_fail" 
	SH_TEXT="0"
	SH_DATA="0"
	SH_SIZE="0"
    fi
    echo $SH_TIME $SH_EXEC | awk '{printf ("%s\t%s\t", $1, $2)}'>>$RESULTS_FILE
    echo $SH_TEXT $SH_DATA | awk '{printf ("%s\t%s\t", $1, $2)}'>>$RESULTS_FILE
    echo $SH_SIZE $SH_NAME | awk '{printf ("%s\t%s\n", $1, $2)}'>>$RESULTS_FILE

    echo "" >> $RESULTS_FILE
done












@


1.1
log
@*** empty log message ***
@
text
@@

