rofi/test/run_dmenu_custom_test.sh

41 lines
687 B
Bash
Raw Normal View History

2014-08-29 15:31:46 +00:00
#!/usr/bin/env bash
# Create fake X
Xvfb :202 &
XPID=$!
# wait till it is up, run rofi with error message
sleep 1;
2014-08-29 16:19:03 +00:00
xrdb -display :202 -load doc/example.xresources
2014-08-29 15:44:10 +00:00
echo -e -n "aap\nnoot\nmies" | ./rofi -width -30 -dmenu -display :202 > output.txt &
2014-08-29 15:31:46 +00:00
RPID=$!
# send enter.
sleep 5;
DISPLAY=:202 xdotool key 'c'
sleep 0.2
DISPLAY=:202 xdotool key 'o'
sleep 0.2
DISPLAY=:202 xdotool key 'f'
sleep 0.2
DISPLAY=:202 xdotool key 'f'
sleep 0.2
DISPLAY=:202 xdotool key 'e'
sleep 0.2
DISPLAY=:202 xdotool key 'e'
sleep 0.2
DISPLAY=:202 xdotool key Return
# Get result, kill xvfb
wait ${RPID}
RETV=$?
kill ${XPID}
sleep 1
if [ `cat output.txt` != 'coffee' ]
then
exit 1
fi
exit ${RETV}