Update with scripts from i44pc15
[ghc-devscripts.git] / compare-testruns.sh
1 #!/bin/bash
2
3 tree1="$1"
4 tree2="$2"
5 benchname="$3"
6 shift; shift; shift
7
8 if [ -z "$tree1" -o -z "$tree2" -o -z "$benchname" ]
9 then 
10   echo "Usage: $0 tree1 tree2 benchname"
11   exit 1
12 fi
13
14 path1="$( find $tree1/nofib -path \*/$benchname -type d )"
15 path2="$( find $tree2/nofib -path \*/$benchname -type d )"
16
17 if [ -z "$path1" ]
18 then
19   echo "Could not find a directory $benchname in $tree1"
20   exit 1
21 fi
22 echo "Found $path1 in $tree1"
23 if [ -z "$path2" ]
24 then
25   echo "Could not find a directory $benchname in $tree2"
26   exit 1
27 fi
28 echo "Found $path2 in $tree2"
29
30 (cd $path1; make clean)
31 (cd $path2; make clean)
32
33 echo Diff follows...
34
35 ${DIFF:-diff -U 10000} \
36  <(cd $path1 && make NoFibRuns=1 2>&1) \
37  <(cd $path2 && make NoFibRuns=1 2>&1)
38
39