diff options
author | QC <qball@gmpclient.org> | 2014-08-29 17:31:46 +0200 |
---|---|---|
committer | QC <qball@gmpclient.org> | 2014-08-29 17:31:46 +0200 |
commit | 23dea5500a63fb5291127d131e6fb11e81319303 (patch) | |
tree | b125d01d5e826ad23ad059eaa5ac28c9afa1a36a /test/run_dmenu_custom_test.sh | |
parent | 23136e12a765a1431038573d92a4c33c2cc5e5df (diff) |
Add another test.
Diffstat (limited to 'test/run_dmenu_custom_test.sh')
-rwxr-xr-x | test/run_dmenu_custom_test.sh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/run_dmenu_custom_test.sh b/test/run_dmenu_custom_test.sh new file mode 100755 index 00000000..6b110863 --- /dev/null +++ b/test/run_dmenu_custom_test.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +# Create fake X +Xvfb :202 & +XPID=$! + +# wait till it is up, run rofi with error message +sleep 1; +echo -e -n "aap\nnoot\nmies" | ./rofi -dmenu -display :202 > output.txt & +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} |