perf/run: add run_subsection()
Let's actually use the subsections we find in the config file to run the perf tests separately for each subsection. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
9ba95ed23c
commit
afda85c25d
29
t/perf/run
29
t/perf/run
@ -125,6 +125,7 @@ get_var_from_env_or_config () {
|
||||
test -n "${4+x}" && eval "$env_var=\"$4\""
|
||||
}
|
||||
|
||||
run_subsection () {
|
||||
get_var_from_env_or_config "GIT_PERF_REPEAT_COUNT" "perf" "repeatCount" 3
|
||||
export GIT_PERF_REPEAT_COUNT
|
||||
|
||||
@ -137,11 +138,33 @@ get_var_from_env_or_config "GIT_PERF_MAKE_OPTS" "perf" "makeOpts"
|
||||
GIT_PERF_AGGREGATING_LATER=t
|
||||
export GIT_PERF_AGGREGATING_LATER
|
||||
|
||||
cd "$(dirname $0)"
|
||||
. ../../GIT-BUILD-OPTIONS
|
||||
|
||||
if test $# = 0 -o "$1" = -- -o -f "$1"; then
|
||||
set -- . "$@"
|
||||
fi
|
||||
|
||||
run_dirs "$@"
|
||||
./aggregate.perl "$@"
|
||||
}
|
||||
|
||||
cd "$(dirname $0)"
|
||||
. ../../GIT-BUILD-OPTIONS
|
||||
|
||||
mkdir -p test-results
|
||||
get_subsections "perf" >test-results/run_subsections.names
|
||||
|
||||
if test $(wc -l <test-results/run_subsections.names) -eq 0
|
||||
then
|
||||
(
|
||||
run_subsection "$@"
|
||||
)
|
||||
else
|
||||
while read -r subsec
|
||||
do
|
||||
(
|
||||
GIT_PERF_SUBSECTION="$subsec"
|
||||
export GIT_PERF_SUBSECTION
|
||||
echo "======== Run for subsection '$GIT_PERF_SUBSECTION' ========"
|
||||
run_subsection "$@"
|
||||
)
|
||||
done <test-results/run_subsections.names
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user