Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/scripts/run-ui-tests
blob: 5a38fb67778c92d95a3991da972751638b141bc2 (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
43
44
45
46
47
#!/bin/sh

scriptsdir=`dirname "$0"`
rootdir=`dirname "$scriptsdir"`
testsdir=$rootdir/tests
scriptsdir=$rootdir/scripts
logsdir=$rootdir/logs
display=`$scriptsdir/find-free-display`
resolution=1024x768x16

xvfb=`which Xvfb`
xserver="$xvfb $display -ac -noreset -shmem -screen 0 $resolution"

if [ -z "$SUGAR_BUILDBOT" ]; then
    xserver=$display
fi

export SUGAR_LOGGER_LEVEL=debug
export GTK_MODULES=gail:atk-bridge
export SUGAR_UI_TESTS=yes

xinit $scriptsdir/xinitrc -- $xserver &
xinitpid=$!

sleep 5

DISPLAY=$display python -u $testsdir/shell.py
result=$?

kill $xinitpid

if [ -z "$SUGAR_BUILDBOT" ]; then
    LOGFILE=$logsdir/test-`date +%Y%m%d-%H%M%S`.log
else
    LOGFILE=$logsdir/test.log
fi

cd ~/.sugar/ui-tests/logs

for logfile in *.log
do
 echo -e "===== $logfile =====\n" >> $LOGFILE
 cat $logfile >> $LOGFILE
 echo >> $LOGFILE
done

exit $result