From: Bart Van Assche Date: Sat, 25 Apr 2009 11:40:09 +0000 (+0000) Subject: Added more error checking. X-Git-Tag: svn/VALGRIND_3_5_0~776 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4d6781d8445fa7ba9c3c8a0ef2f7e7c6e9137503;p=thirdparty%2Fvalgrind.git Added more error checking. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9629 --- diff --git a/drd/scripts/run-splash2 b/drd/scripts/run-splash2 index 73cc54065b..b2c23e4e2d 100755 --- a/drd/scripts/run-splash2 +++ b/drd/scripts/run-splash2 @@ -10,51 +10,67 @@ function run_test { local tmp avg1 stddev1 avg2 stddev2 avg4 stddev4 p tmp="/tmp/test-timing.$$" - rm -f "${tmp}" + rm -f "${tmp}" p=1 test_output="${1}-p${p}.out" measure_runtime "$@" -p${psep}${p} "${test_args}" | avgstddev > "$tmp" - read avg1 stddev1 vsz1 vszdev1 < "$tmp" + read avg1 stddev1 vsz1 vszdev1 rest < "$tmp" echo "Average time: ${avg1} +/- ${stddev1} seconds." \ " VSZ: ${vsz1} +/- ${vszdev1} KB" + if [ "${rest}" != "" ]; then + echo "Internal error ($rest)" + exit 1 + fi + + rm -f "${tmp}" p=2 test_output="${1}-p${p}.out" measure_runtime "$@" -p${psep}${p} "${test_args}" | avgstddev > "$tmp" - read avg2 stddev2 vsz2 vszdev2 < "$tmp" + read avg2 stddev2 vsz2 vszdev2 rest < "$tmp" echo "Average time: ${avg2} +/- ${stddev2} seconds." \ " VSZ: ${vsz2} +/- ${vszdev2} KB" + if [ "${rest}" != "" ]; then + echo "Internal error ($rest)" + exit 1 + fi + + rm -f "${tmp}" p=4 test_output="${1}-p${p}.out" measure_runtime "$@" -p${psep}${p} "${test_args}" | avgstddev > "$tmp" - read avg4 stddev4 vsz4 vszdev4 < "$tmp" + read avg4 stddev4 vsz4 vszdev4 rest < "$tmp" echo "Average time: ${avg4} +/- ${stddev4} seconds." \ " VSZ: ${vsz4} +/- ${vszdev4} KB" + rm -f "$tmp" + + if [ "${rest}" != "" ]; then + echo "Internal error ($rest)" + exit 1 + fi p=1 test_output="/dev/null" \ - print_runtime_ratio ${avg1} ${stddev1} ${vsz1} ${vszdev1} $VG --tool=none "$@" -p${psep}${p} "${test_args}" + print_runtime_ratio "${avg1}" "${stddev1}" "${vsz1}" "${vszdev1}" "$VG" --tool=none "$@" -p${psep}${p} "${test_args}" p=4 test_output="/dev/null" \ - print_runtime_ratio ${avg4} ${stddev4} ${vsz4} ${vszdev4} $VG --tool=none "$@" -p${psep}${p} "${test_args}" + print_runtime_ratio "${avg4}" "${stddev4}" "${vsz4}" "${vszdev4}" "$VG" --tool=none "$@" -p${psep}${p} "${test_args}" p=4 test_output="${1}-drd-with-stack-var-4.out" \ - print_runtime_ratio ${avg4} ${stddev4} ${vsz4} ${vszdev4} \ - $VG --tool=drd --check-stack-var=yes "$@" -p${psep}${p} "${test_args}" + print_runtime_ratio "${avg4}" "${stddev4}" "${vsz4}" "${vszdev4}" \ + "$VG" --tool=drd --check-stack-var=yes "$@" -p${psep}${p} "${test_args}" p=4 test_output="${1}-drd-without-stack-var-4.out" \ - print_runtime_ratio ${avg4} ${stddev4} ${vsz4} ${vszdev4} \ - $VG --tool=drd --check-stack-var=no "$@" -p${psep}${p} "${test_args}" + print_runtime_ratio "${avg4}" "${stddev4}" "${vsz4}" "${vszdev4}" \ + "$VG" --tool=drd --check-stack-var=no "$@" -p${psep}${p} "${test_args}" p=4 test_output="${1}-helgrind-4.out" \ - print_runtime_ratio ${avg4} ${stddev4} ${vsz4} ${vszdev4} $VG --tool=helgrind "$@" -p${psep}${p} "${test_args}" + print_runtime_ratio "${avg4}" "${stddev4}" "${vsz4}" "${vszdev4}" "$VG" --tool=helgrind "$@" -p${psep}${p} "${test_args}" echo '' - - rm -f "$tmp" }