~ubuntu-x-swat/xorg-server/xsmoke

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
#!/bin/sh

if [ -e ../lib/xsmoke.lib ] ; then
    . ../lib/xsmoke.lib
elif [ -e lib/xsmoke.lib ] ; then
    . lib/xsmoke.lib
fi

RUNTIME=6
INT=1
TMPFILE=$(mktemp) || die "Could not create temp file"

glxgears > $TMPFILE 2> /dev/null &

for i in $(seq 1 $INT $RUNTIME) ; do
    test_count=$(( $test_count + 1 ))
    sleep $INT
    x=$(( $i * 80 ))
    y=$x

    wmctrl -r glxgears -e 0,$x,$y,-1,-1
    if [ $? = 0 ]; then
        pass "Moved glxgears window"
    else
        fail "Error encountered while moving glxgears window"
    fi

done

# Close glxgears gracefully
test_count=$(( $test_count + 1 ))
wmctrl -c glxgears
if [ $? = 0 ]; then
    pass "glxgears was closed successfully"
else
    fail "glxgears could not be closed properly"
fi

cat $TMPFILE | cut -d'=' -f2
rm $TMPFILE

echo "Completed all tests"
print_test_summary