summaryrefslogtreecommitdiff
path: root/glean-test.sh
blob: 91415ae85efceb39ce94910abc1d86ef55e4882a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh

# move previous glean results from current to previous
if [ -e current ] ; then
   rm -rf previous
   mv current previous
fi

# start xserver and run glean against it, capturing output to /tmp/glean.log
echo >/tmp/glean.log
xinit `pwd`/glean-wrapper -- :99 -multiwindow -noclipboard +iglx >/tmp/xinit.log 2>&1
cat /tmp/glean.log

# crudely summarize pass/fail statistics
PASS=`grep -c "PASS " /tmp/glean.log`
FAIL=`grep -c "FAIL " /tmp/glean.log`

# compare with previous statistics
PREV_PASS=`cat .glean.pass 2>/dev/null || echo 0`
PREV_FAIL=`cat .glean.fail 2>/dev/null || echo 9999`
EXITCODE=0

if [ $PASS -lt $PREV_PASS ] || [ $FAIL -gt $PREV_FAIL ] ; then
   # report an error
   echo ==================
   echo "Warning: current PASS: $PASS FAIL: $FAIL worse than previous PASS: $PREV_PASS FAIL: $PREV_FAIL"
   echo ==================
   #EXITCODE=1
else
   # record pass/fail counts for checking next time
   echo $PASS >.glean.pass
   echo $FAIL >.glean.fail
fi

echo ==================
echo Comparison with previous test results
echo ==================

# use glean compare mode to report differences
$JHBUILD_CHECKOUTROOT/glean/bin/glean -c previous current 2>/dev/null

exit $EXITCODE