[PATCH 10/11] perf: implement a test-selection feature
- From
Thomas Rast <trast@student.ethz.ch>
- Date
- Mar 12, 2012, 16:27 UTC
- Message-ID
- <b21f1ec0d40a38be53040d182933ed2935bbcfc9.1331561353.git.trast@student.ethz.ch>
- In-Reply-To
- <cover.1331561353.git.trast@student.ethz.ch>
When bisecting for a performance regression, there is usually no point in running all tests in the pNNNN-foo.sh file, since you are interested only in the result of a single test.
Make GIT_PERF_TEST_ONLY=pNNNN.I select only the test NNNN.I for running. All other test_perf blocks are skipped. test_expect_success blocks are deliberately not affected; presumably they consist of setup code.
Signed-off-by: Thomas Rast <trast@student.ethz.ch> --- t/perf/perf-lib.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh index bfc2926..ddb3272 100644 --- a/t/perf/perf-lib.sh +++ b/t/perf/perf-lib.sh @@ -153,7 +153,11 @@ test_perf () { test "$#" = 2 || error "bug in the test script: not 2 or 3 parameters to test-expect-success" export test_prereq - if ! test_skip "$@" + skipping= + test_skip "$@" && skipping=t + test -z "$GIT_PERF_TEST_ONLY" || + test "$GIT_PERF_TEST_ONLY" = $this_test.$test_count || skipping=t + if test -z "$skipping" then base=$(basename "$0" .sh) echo "$test_count" >>"$perf_results_dir"/$base.subtests
-- 1.7.10.rc0.230.g16d90