#!/usr/bin/env bash# Script to do performance testing.# Invocation# check_performance SRC_DIR BUILD_DIR# 1: variables#SRC_DIR=$1BUILD_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 in1*)echo 'You need bash 2.x to run check_performance. Exiting.';exit 1 ;;*) ;;esacflags_script=$BUILD_DIR/scripts/testsuite_flagsINCLUDES=`$flags_script --build-includes`PCH_FLAGS=`$flags_script --cxxpchflags`FLAGS=`$flags_script --cxxflags`TEST_FLAGS="-S"COMPILER=`$flags_script --build-cxx`CXX="$COMPILER $INCLUDES $PCH_FLAGS $FLAGS $TEST_FLAGS"TESTS_FILE="testsuite_files"#mkdir binariesUNIQUE_ID=0for NAME in `cat $TESTS_FILE`doif $RUN; thenecho $NAMEOUTPUT_NAME=$UNIQUE_ID$CXX $SRC_DIR/testsuite/$NAME -o $OUTPUT_NAMEif [ -f $OUTPUT_NAME ]; then# mv $OUTPUT_NAME binariesrm $OUTPUT_NAMEfiecho ""let UNIQUE_ID+=1fidoneexit 0