summaryrefslogtreecommitdiffstats
path: root/test/run_dmenu_custom_test.sh
blob: 56c5042b7191d603e9301c9f504f8577d595b76b (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
#!/usr/bin/env bash

echo -e -n "aap\nnoot\nmies" | rofi -width -30 -dmenu > output.txt & 
RPID=$!

# send enter.
sleep 5;
xdotool key 'c'
sleep 0.2
xdotool key 'o'
sleep 0.2
xdotool key 'f'
sleep 0.2
xdotool key 'f'
sleep 0.2
xdotool key 'e'
sleep 0.2
xdotool key 'e'
sleep 0.2
xdotool key Shift+Return
xdotool key Return


#  Get result, kill xvfb
wait ${RPID}
RETV=$?
OUTPUT=$(cat output.txt | tr '\n' ' ')
if [ "${OUTPUT}" != 'coffee coffee ' ]
then
    exit 1
fi

OUTPUT=$(rofi -dump-xresources)
if [ -z "${OUTPUT}" ]
then
    exit 1
fi

exit ${RETV}