~cr3/xorg-server/xsmoke-packaging

« back to all changes in this revision

Viewing changes to tests/xst-xrandr.sh

  • Committer: Bryce Harrington
  • Date: 2008-11-15 21:35:31 UTC
  • Revision ID: bryce@chideok-20081115213531-mw9sv9pko0zmdyzb
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
if [ -e ../lib/xsmoke.lib ] ; then
 
4
    . ../lib/xsmoke.lib
 
5
elif [ -e lib/xsmoke.lib ] ; then
 
6
    . lib/xsmoke.lib
 
7
fi
 
8
 
 
9
 
 
10
# TODO:  Detect or take as an input
 
11
OUTPUT=VGA-0
 
12
 
 
13
# xrandr version testing
 
14
test_count=$(( $test_count + 1 ))
 
15
xrandr_expected_version=`get_installed_version "xrandr" | sed -e "s/^[0-9]://" | cut -d- -f1`
 
16
xrandr_version=`xrandr -d $DISPLAY --version`
 
17
if [ $? = 0 ]; then
 
18
    version=`echo $xrandr_version | sed -e "s/^.*version \([0-9\.]\+\)$/\1/"`
 
19
    if [ $? = 0 ]; then
 
20
        output=`echo $xrandr_expected_version | egrep "^$version" > /dev/null`
 
21
        if [ $? = 0 ]; then
 
22
            pass "xrandr --version meets $xrandr_version_expected"
 
23
        else
 
24
            fail "Expected xrandr version $xrandr_expected_version, but xrandr reports $version"
 
25
        fi
 
26
    else
 
27
        fail "Could not determine version from xrandr --version: $xrandr_version"
 
28
    fi
 
29
else
 
30
    fail "xrandr --version returned an error: $xrandr_version"
 
31
fi
 
32
 
 
33
# xrandr output testing
 
34
#test_count=$(( $test_count + 1 ))
 
35
#xrandr_verbose=`xrandr -d :0 --verbose`
 
36
#if [ $? = 0 ]; then
 
37
#    pass "xrandr generated verbose output"
 
38
#else
 
39
#    fail "xrandr failed to provide verbose  output"
 
40
#fi
 
41
 
 
42
 
 
43
MODES=$(../xrandr-res | grep -e "^VGA-0" | cut -d ":" -f2 | cut -d "=" -f1)
 
44
for mode in $MODES; do
 
45
    echo $mode 
 
46
    xrandr --output $OUTPUT --mode $mode
 
47
    sleep 3
 
48
done
 
49
 
 
50
xrandr --output $OUTPUT --auto
 
51
sleep 3
 
52
 
 
53
xrandr --output $OUTPUT --reflect xy
 
54
sleep 3
 
55
 
 
56
xrandr --output $OUTPUT --reflect normal
 
57
sleep 3
 
58
 
 
59
xrandr --output $OUTPUT --off
 
60
sleep 3
 
61
 
 
62
xrandr --output $OUTPUT --auto
 
63
sleep 3
 
64
 
 
65
xrandr --output $OUTPUT --rotate inverted
 
66
sleep 3
 
67
 
 
68
xrandr --output $OUTPUT --rotate left
 
69
sleep 3
 
70
 
 
71
xrandr --output $OUTPUT --rotate right
 
72
sleep 3
 
73
 
 
74
xrandr --output $OUTPUT --rotate normal
 
75
sleep 3
 
76
 
 
77
# Verify Xorg restarts correctly as currently configured
 
78
test_xorg_restart
 
79
 
 
80
echo "Completed all tests"
 
81
print_test_summary