gcc/libstdc++-v3/scripts/check_performance
Loren J. Rittle f64f44069c check_performance: Only compile with $THREAD_FLAG when test is marked to require it.
* scripts/check_performance: Only compile with $THREAD_FLAG
	when test is marked to require it.  Allow multiple
	compilations/executions of marked tests.
	* testsuite/testsuite_performance.h (report_performance):
	Report dynamic thread support status.
	(report_header): Likewise.
	* testsuite/performance/allocator.cc: Stabilize iteration
	count.  Support more allocators.  Mark each allocator test to
	run and report independently.
	* testsuite/performance/allocator_map_thread.cc: Likewise.
	* testsuite/performance/allocator_thread.cc: Likewise.

From-SVN: r76932
2004-01-30 08:24:27 +00:00

73 lines
1.8 KiB
Bash
Executable file

#!/usr/bin/env bash
# Script to do performance testing.
# Invocation
# check_performance SRC_DIR BUILD_DIR
# 1: variables
#
SRC_DIR=$1
BUILD_DIR=$2
# 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_performance. Exiting.';
exit 1 ;;
*) ;;
esac
flags_script=$BUILD_DIR/scripts/testsuite_flags
INCLUDES=`$flags_script --build-includes`
FLAGS=`$flags_script --cxxflags`
THREAD_FLAG='-pthread'
COMPILER=`$flags_script --build-cxx`
SH_FLAG="-Wl,--rpath -Wl,$BUILD_DIR/../../gcc \
-Wl,--rpath -Wl,$BUILD_DIR/src/.libs"
ST_FLAG="-static"
LINK=$SH_FLAG
CXX="$COMPILER $INCLUDES $FLAGS $LINK"
CXX_THREAD="$COMPILER $INCLUDES $FLAGS $THREAD_FLAG $LINK"
TESTS_FILE="testsuite_files_performance"
for NAME in `cat $TESTS_FILE`
do
RUN=true
for CYCLE in `sed -n 's,.*\(TEST_[SB][0-9]*\)$,\1,p' $SRC_DIR/testsuite/$NAME`
do
RUN=false
echo $NAME $CYCLE
FILE_NAME="`basename $NAME`"
EXE_NAME="`echo $FILE_NAME-$CYCLE | sed 's/cc$/exe/'`"
$CXX -D$CYCLE $SRC_DIR/testsuite/$NAME -o $EXE_NAME
./$EXE_NAME
echo ""
done
for CYCLE in `sed -n 's,.*\(TEST_[TB][0-9]*\)$,\1,p' $SRC_DIR/testsuite/$NAME`
do
RUN=false
echo $NAME $CYCLE THREAD
FILE_NAME="`basename $NAME`"
EXE_NAME="`echo $FILE_NAME-$CYCLE | sed 's/cc$/exe/'`"
$CXX_THREAD -D$CYCLE $SRC_DIR/testsuite/$NAME -o $EXE_NAME
./$EXE_NAME
echo ""
done
if $RUN; then
echo $NAME
FILE_NAME="`basename $NAME`"
EXE_NAME="`echo $FILE_NAME | sed 's/cc$/exe/'`"
$CXX $SRC_DIR/testsuite/$NAME -o $EXE_NAME
./$EXE_NAME
echo ""
fi
done
exit 0