X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=performance-test%2Fperf-test-lib.sh;h=e399d3f551ce6755653be4f1eb9f287bb53ac9ec;hp=1399d0598060b82a3beb5be3679c4f4dba2ec1bf;hb=a3137c61e144935fde9896855ffc8625f7505c37;hpb=a4eabfd1b7b6c72af09153df082bac3dca7c4420 diff --git a/performance-test/perf-test-lib.sh b/performance-test/perf-test-lib.sh index 1399d059..e399d3f5 100644 --- a/performance-test/perf-test-lib.sh +++ b/performance-test/perf-test-lib.sh @@ -1,5 +1,30 @@ . ./version.sh +corpus_size=large + +while test "$#" -ne 0 +do + case "$1" in + -d|--debug) + debug=t; + shift + ;; + -s|--small) + corpus_size=small; + shift + ;; + -m|--medium) + corpus_size=medium; + shift + ;; + -l|--large) + corpus_size=large; + shift + ;; + *) + echo "error: unknown performance test option '$1'" >&2; exit 1 ;; + esac +done . ../test/test-lib-common.sh set -e @@ -42,16 +67,18 @@ add_email_corpus () } print_header () { - printf "[v%4s] Wall(s)\tUsr(s)\tSys(s)\tRes(K)\tIn(512B)\tOut(512B)\n" \ - ${PERFTEST_VERSION} + printf "[v%4s %6s] Wall(s)\tUsr(s)\tSys(s)\tRes(K)\tIn/Out(512B)\n" \ + ${PERFTEST_VERSION} ${corpus_size} } time_run () { printf "%-22s" "$1" if test "$verbose" != "t"; then exec 4>test.output 3>&4; fi - if ! eval >&3 "/usr/bin/time -f '%e\t%U\t%S\t%M\t%I\t%O' $2" ; then + if ! eval >&3 "/usr/bin/time -f '%e\t%U\t%S\t%M\t%I/%O' $2" ; then test_failure=$(($test_failure + 1)) + return 1 fi + return 0 } time_done () {