File tree 1 file changed +26
-0
lines changed
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ command -v php > /dev/null 2>&1 || { echo " I require ` php` but it's not available. Aborting." >&2 ; exit 255; }
4
+ command -v grep > /dev/null 2>&1 || { echo " I require ` grep` but it's not available. Aborting." >&2 ; exit 255; }
5
+ command -v awk > /dev/null 2>&1 || { echo " I require ` awk` but it's not available. Aborting." >&2 ; exit 255; }
6
+
7
+ if [ " " == " $1 " ] || [ " " == " $2 " ];
8
+ then
9
+ echo " Usage: bash benchmark.sh BRANCH1 BRANCH2 ...BRANCHN"
10
+ exit 1;
11
+ fi
12
+
13
+ for BRANCH in $@
14
+ do
15
+ git checkout $BRANCH & > /dev/null &&
16
+ git reset --hard & > /dev/null &&
17
+ echo -n $BRANCH
18
+ (for i in {1..10}; do php php-cs-fixer fix . ; done) | grep -i fixed | awk '
19
+ {
20
+ total += $5;
21
+ ++count;
22
+ }
23
+ END {
24
+ print " mean:" (total/count) " total:" total " rounds:" count
25
+ }'
26
+ done
You can’t perform that action at this time.
0 commit comments