summaryrefslogtreecommitdiff
path: root/ezbench.sh
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-07-26 13:04:12 +0100
committerMartin Peres <martin.peres@linux.intel.com>2015-07-27 15:49:52 +0300
commit9957356e5fdf22362f6d1b1361b98312d91abe8e (patch)
tree2a89b930ea8170b8773881a6c464130150cbcd97 /ezbench.sh
parentdf60a6071e9b016fc62b14df60e5159109d410c1 (diff)
Allow arbitrary git commit ids and ranges to be specified on the commandline
Diffstat (limited to 'ezbench.sh')
-rwxr-xr-xezbench.sh23
1 files changed, 18 insertions, 5 deletions
diff --git a/ezbench.sh b/ezbench.sh
index dbcf7dd..0658995 100755
--- a/ezbench.sh
+++ b/ezbench.sh
@@ -93,6 +93,17 @@ while getopts "h?p:n:H:r:b:m:l" opt; do
;;
esac
done
+shift $((OPTIND-1))
+
+commitList=
+for id in "$@"; do
+ if [[ $id =~ \.\. ]]; then
+ commitList+=$(git rev-list --abbrev-commit --reverse $id)
+ else
+ commitList+=$(git rev-list --abbrev-commit -n 1 `git rev-parse $id`)
+ fi
+ commitList+=" "
+done
# Check that the list of wanted benchmarks is OK
testsListOK=1
@@ -138,7 +149,6 @@ then
exit 1
fi
[ -n "$stash" ] && echo "Preserving work-in-progress"
-[ "${uptoCommit}" == "HEAD" ] && do_stash=${stash}
# function to call on exit
function finish {
@@ -184,11 +194,14 @@ done
echo
# Estimate the execution time
-num_commits=$(git rev-list --abbrev-commit --reverse -n ${lastNCommits} ${uptoCommit} | wc -l)
-[ -n "${do_stash}" ] && num_commits=$(($num_commits + 1))
+if [ -z "$commitList" ]; then
+ commitList=$(git rev-list --abbrev-commit --reverse -n ${lastNCommits} ${uptoCommit})
+ [ "${uptoCommit}" == "HEAD" ] && commitList="${commitList} ${stash}"
+fi
+num_commits=$(wc -w <<< $commitList)
secs=$(( ($total_round_time * $rounds + $avgBuildTime) * $num_commits))
finishDate=$(date +"%y-%m-%d - %T" --date="$secs seconds")
-printf "Estimated finish date: $finishDate (%02dh:%02dm:%02ds)\n\n" $(($secs/3600)) $(($secs%3600/60)) $(($secs%60))
+printf "Testing %d commits, estimated finish date: $finishDate (%02dh:%02dm:%02ds)\n\n" ${num_commits} $(($secs/3600)) $(($secs%3600/60)) $(($secs%60))
startTime=`date +%s`
# Execute the user-defined pre hook
@@ -239,7 +252,7 @@ function compile {
commitListLog="$logsFolder/commit_list"
# Iterate through the commits
-for commit in $(git rev-list --abbrev-commit --reverse -n ${lastNCommits} ${uptoCommit}) ${do_stash}
+for commit in $commitList
do
# save the commit in the commit_list