diff options
author | Dave Davenport <qball@gmpclient.org> | 2016-01-04 20:46:34 +0100 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2016-01-04 20:46:34 +0100 |
commit | f715a33bf7ec153bb6bb2b3fa1e9e38415b67352 (patch) | |
tree | 5891f94e749c4422c5ab47e9de77c460cbba5b2e | |
parent | c85f1cb0bff11f52e821e54974e06a04f932106f (diff) |
Add window manager as test if possible
-rw-r--r-- | .travis.yml | 1 | ||||
-rw-r--r-- | Makefile.am | 2 | ||||
-rwxr-xr-x | test/run_test.sh | 6 | ||||
-rwxr-xr-x | test/run_window_test.sh | 22 |
4 files changed, 31 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml index f6c3501f..56a04033 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,7 @@ addons: - xvfb - discount - xdotool + - fluxbox compiler: - gcc diff --git a/Makefile.am b/Makefile.am index 71a9c850..f796278c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -202,6 +202,8 @@ test-x: ${bin_PROGRAMS} $(top_srcdir)/test/run_test.sh 216 $(top_srcdir)/test/run_glob_test.sh $(top_builddir) echo "Test config dump" $(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" diff --git a/test/run_test.sh b/test/run_test.sh index dc1f13e1..9f6bfff8 100755 --- a/test/run_test.sh +++ b/test/run_test.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash XPID= +FPID= function create_fake_x ( ) { export DISPLAY=":$1" @@ -8,6 +9,9 @@ function create_fake_x ( ) Xvfb ${DISPLAY} & XPID=$! sleep 1 + fluxbox & + FPID=$! + sleep 1 } function destroy_fake_x ( ) @@ -15,6 +19,8 @@ function destroy_fake_x ( ) if [ -n "${XPID}" ] then echo "Stopping fake X: ${XPID}" + kill ${FPID} + wait ${FPID} kill ${XPID} wait ${XPID} fi diff --git a/test/run_window_test.sh b/test/run_window_test.sh new file mode 100755 index 00000000..8e10b5fe --- /dev/null +++ b/test/run_window_test.sh @@ -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} |