]> git.notmuchmail.org Git - notmuch/commitdiff
perf-test: optionally print description for each group of tests
authorDavid Bremner <bremner@debian.org>
Thu, 6 Dec 2012 01:41:44 +0000 (21:41 -0400)
committerDavid Bremner <bremner@debian.org>
Sat, 15 Dec 2012 12:17:57 +0000 (08:17 -0400)
Output from tests is indented slightly in the same style as the
correctness tests.

performance-test/perf-test-lib.sh

index e399d3f551ce6755653be4f1eb9f287bb53ac9ec..bdf92449f2b2a198b81058d7278f920c3661a70f 100644 (file)
@@ -67,12 +67,12 @@ add_email_corpus ()
 }
 
 print_header () {
 }
 
 print_header () {
-    printf "[v%4s %6s]        Wall(s)\tUsr(s)\tSys(s)\tRes(K)\tIn/Out(512B)\n" \
+    printf "[v%4s %6s]          Wall(s)\tUsr(s)\tSys(s)\tRes(K)\tIn/Out(512B)\n" \
           ${PERFTEST_VERSION} ${corpus_size}
 }
 
 time_run () {
           ${PERFTEST_VERSION} ${corpus_size}
 }
 
 time_run () {
-    printf "%-22s" "$1"
+    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/%O' $2" ; then
        test_failure=$(($test_failure + 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/%O' $2" ; then
        test_failure=$(($test_failure + 1))
@@ -92,3 +92,6 @@ time_done () {
 
 cd -P "$test" || error "Cannot setup test environment"
 test_failure=0
 
 cd -P "$test" || error "Cannot setup test environment"
 test_failure=0
+
+echo
+echo $(basename "$0"): "Testing ${test_description:-notmuch performance}"