This commit is contained in:
gobwas 2019-02-06 23:59:37 +03:00
parent 9bf042f426
commit 1c85fdee98
1 changed files with 3 additions and 4 deletions

View File

@ -1,14 +1,13 @@
#! /bin/bash #! /bin/bash
tmp=$(mktemp -d /tmp/globbench.XXXXXX) rnd=$(head -c4 </dev/urandom|xxd -p -u)
echo "temp dir is $tmp";
bench() { bench() {
local exp=".*" local exp=".*"
if [[ ! -z $2 ]]; then if [[ ! -z $2 ]]; then
$exp = $2 $exp = $2
fi fi
filename="$tmp/$1.bench" filename=$(echo "$rnd-$1.bench" | tr "/" "_")
if test -e "${filename}"; if test -e "${filename}";
then then
echo "Already exists ${filename}" echo "Already exists ${filename}"
@ -30,4 +29,4 @@ current=`git rev-parse --abbrev-ref HEAD`
bench ${to} $2 bench ${to} $2
bench ${current} $2 bench ${current} $2
benchcmp $3 "$tmp/${to}.bench" "$tmp/${current}.bench" benchcmp $3 "$rnd-${to}.bench" "$rnd-${current}.bench"