1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2025-01-27 15:25:24 -05:00

Add window manager as test if possible

This commit is contained in:
Dave Davenport 2016-01-04 20:46:34 +01:00
parent c85f1cb0bf
commit f715a33bf7
4 changed files with 31 additions and 0 deletions

View file

@ -16,6 +16,7 @@ addons:
- xvfb - xvfb
- discount - discount
- xdotool - xdotool
- fluxbox
compiler: compiler:
- gcc - gcc

View file

@ -202,6 +202,8 @@ test-x: ${bin_PROGRAMS}
$(top_srcdir)/test/run_test.sh 216 $(top_srcdir)/test/run_glob_test.sh $(top_builddir) $(top_srcdir)/test/run_test.sh 216 $(top_srcdir)/test/run_glob_test.sh $(top_builddir)
echo "Test config dump" echo "Test config dump"
$(top_srcdir)/test/run_test.sh 217 $(top_srcdir)/test/xr_config_test.sh $(top_builddir) $(top_srcdir) $(top_srcdir)/test/run_test.sh 217 $(top_srcdir)/test/xr_config_test.sh $(top_builddir) $(top_srcdir)
echo "Test window"
$(top_srcdir)/test/run_test.sh 217 $(top_srcdir)/test/run_window_test.sh $(top_builddir) $(top_srcdir)
echo "End tests" echo "End tests"

View file

@ -1,6 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
XPID= XPID=
FPID=
function create_fake_x ( ) function create_fake_x ( )
{ {
export DISPLAY=":$1" export DISPLAY=":$1"
@ -8,6 +9,9 @@ function create_fake_x ( )
Xvfb ${DISPLAY} & Xvfb ${DISPLAY} &
XPID=$! XPID=$!
sleep 1 sleep 1
fluxbox &
FPID=$!
sleep 1
} }
function destroy_fake_x ( ) function destroy_fake_x ( )
@ -15,6 +19,8 @@ function destroy_fake_x ( )
if [ -n "${XPID}" ] if [ -n "${XPID}" ]
then then
echo "Stopping fake X: ${XPID}" echo "Stopping fake X: ${XPID}"
kill ${FPID}
wait ${FPID}
kill ${XPID} kill ${XPID}
wait ${XPID} wait ${XPID}
fi fi

22
test/run_window_test.sh Executable file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env bash
# wait till it is up, run rofi with error message
sleep 1;
xterm &
XPID=$!
sleep 1;
echo -e -n "aap\nnoot\nmies" | rofi -modi window -show window > output.txt &
RPID=$!
# send enter.
sleep 5;
xdotool type 'xterm'
sleep 0.4
xdotool key Return
sleep 1;
xdotool key Ctrl+d
wait ${XPID}
# Get result, kill xvfb
wait ${RPID}
RETV=$?
exit ${RETV}