summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQC <qball@gmpclient.org>2014-08-29 16:57:36 +0200
committerQC <qball@gmpclient.org>2014-08-29 16:57:36 +0200
commit4ab95f5d26c48c63e7d9565e092b2d1eb19ec371 (patch)
treef4c871cfb33c36c8ccc3729fda249126aec38768
parent0b4c582c1a9bcf69ba36e2f948fbda536c745403 (diff)
Add dmenu test.
-rw-r--r--Makefile.am1
-rwxr-xr-xtest/run_dmenu_test.sh31
2 files changed, 32 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index b9e45767..ce715686 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -90,3 +90,4 @@ test: rofi
make -C test/ test
./test/run_errormsg_test.sh
./test/run_switchdialog_test.sh
+ ./test/run_dmenu_test.sh
diff --git a/test/run_dmenu_test.sh b/test/run_dmenu_test.sh
new file mode 100755
index 00000000..5bdb84ea
--- /dev/null
+++ b/test/run_dmenu_test.sh
@@ -0,0 +1,31 @@
+#!/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 'Down'
+sleep 0.4
+DISPLAY=:202 xdotool key 'Down'
+sleep 0.4
+DISPLAY=:202 xdotool key Return
+
+# Get result, kill xvfb
+wait ${RPID}
+RETV=$?
+kill ${XPID}
+
+sleep 1
+
+if [ `cat output.txt` != 'aap' ]
+then
+ exit 1
+fi
+exit ${RETV}