3 # Script to do performance testing.
6 # check_performance SRC_DIR BUILD_DIR
13 # Now that we've successfully translated the numerical option into
14 # a symbolic one, we can safely ignore it.
17 # This has been true all along. Found out about it the hard way...
20 echo 'You need bash 2.x to run check_performance. Exiting.';
25 flags_script
=$BUILD_DIR/scripts
/testsuite_flags
26 INCLUDES
=`$flags_script --build-includes`
27 PCH_FLAGS
=`$flags_script --cxxpchflags`
28 FLAGS
=`$flags_script --cxxflags`
29 THREAD_FLAG
='-pthread'
30 COMPILER
=`$flags_script --build-cxx`
31 SH_FLAG
="-Wl,--rpath -Wl,$BUILD_DIR/../../gcc \
32 -Wl,--rpath -Wl,$BUILD_DIR/src/.libs"
35 CXX
="$COMPILER $INCLUDES $FLAGS -std=gnu++0x $CXXFLAGS $LINK"
37 TESTS_FILE
="testsuite_files_performance"
41 for NAME
in `cat $TESTS_FILE`
44 TESTNAME
=$SRC_DIR/testsuite
/$NAME
45 FILE_NAME
="`basename $NAME`"
46 FILE_NAME
="`echo $FILE_NAME | sed 's/.cc//g'`"
48 # TEST_S == single thread
49 # TEST_B == do both single and multi-thread
50 # TEST_T == multi-thread
51 for CYCLE
in `sed -n 's,.*\(TEST_[SB][0-9]*\)$,\1,p' $TESTNAME`
55 EXE_NAME
="`echo $FILE_NAME-$CYCLE.exe`"
56 $CXX -DNOTHREAD -D$CYCLE $TESTNAME $LIBS -o $EXE_NAME
57 if [ -f $EXE_NAME ]; then
61 echo "$CXX -DNOTHREAD -D$CYCLE $TESTNAME $LIBS -o $EXE_NAME"
65 for CYCLE
in `sed -n 's,.*\(TEST_[TB][0-9]*\)$,\1,p' $TESTNAME`
68 echo $NAME $CYCLE thread
69 EXE_NAME
="`echo $FILE_NAME-$CYCLE.exe`"
70 $CXX $THREAD_FLAG -D$CYCLE $TESTNAME $LIBS -o $EXE_NAME
71 if [ -f $EXE_NAME ]; then
75 echo "$CXX $THREAD_FLAG -D$CYCLE $TESTNAME $LIBS -o $EXE_NAME"
81 EXE_NAME
="`echo $FILE_NAME.exe`"
82 $CXX $TESTNAME $LIBS -o $EXE_NAME
83 if [ -f $EXE_NAME ]; then
84 .
/$EXE_NAME >& tmp.
$FILE_NAME
87 echo "$CXX $TESTNAME $LIBS -o $EXE_NAME"
89 if [ -s tmp.
$FILE_NAME ]; then
90 mv tmp.
$FILE_NAME $FILE_NAME.xml