diff options
Diffstat (limited to 't/perf/perf-lib.sh')
-rw-r--r-- | t/perf/perf-lib.sh | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh index 1d0bb9d017..5cf74eddec 100644 --- a/t/perf/perf-lib.sh +++ b/t/perf/perf-lib.sh @@ -1,4 +1,6 @@ -#!/bin/sh +# Performance testing framework. Each perf script starts much like +# a normal test script, except it sources this library instead of +# test-lib.sh. See t/perf/README for documentation. # # Copyright (c) 2011 Thomas Rast # @@ -42,7 +44,7 @@ else fi TEST_NO_CREATE_REPO=t -TEST_NO_MALLOC_=t +TEST_NO_MALLOC_CHECK=t . ../test-lib.sh @@ -89,7 +91,7 @@ test_perf_create_repo_from () { */objects|*/hooks|*/config) ;; *) - cp -R "$stuff" . || break + cp -R "$stuff" . || exit 1 ;; esac done && @@ -150,6 +152,7 @@ exit $ret' >&3 2>&4 test_perf () { + test_start_ test "$#" = 3 && { test_prereq=$1; shift; } || test_prereq= test "$#" = 2 || error "bug in the test script: not 2 or 3 parameters to test-expect-success" @@ -160,7 +163,7 @@ test_perf () { echo "$test_count" >>"$perf_results_dir"/$base.subtests echo "$1" >"$perf_results_dir"/$base.$test_count.descr if test -z "$verbose"; then - echo -n "perf $test_count - $1:" + printf "%s" "perf $test_count - $1:" else echo "perf $test_count - $1:" fi @@ -169,7 +172,7 @@ test_perf () { if test_run_perf_ "$2" then if test -z "$verbose"; then - echo -n " $i" + printf " %s" "$i" else echo "* timing run $i/$GIT_PERF_REPEAT_COUNT:" fi @@ -187,7 +190,7 @@ test_perf () { base="$perf_results_dir"/"$perf_results_prefix$(basename "$0" .sh)"."$test_count" "$TEST_DIRECTORY"/perf/min_time.perl test_time.* >"$base".times fi - echo >&3 "" + test_finish_ } # We extend test_done to print timings at the end (./run disables this |