From 05a1be9753fd0b029de06f2d6ad93be1c29eccc9 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Mon, 4 Jan 2016 18:26:18 +0100 Subject: [PATCH] Another silly test to make sure this code is hit and should show breakage. --- Makefile.am | 6 ++++-- test/run_dmenu_normal_window_test.sh | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100755 test/run_dmenu_normal_window_test.sh diff --git a/Makefile.am b/Makefile.am index d7248214..09d68a5b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -191,7 +191,7 @@ test-x: ${bin_PROGRAMS} echo "Test daemon" $(top_srcdir)/test/run_test.sh 211 $(top_srcdir)/test/run_daemon_test.sh $(top_builddir) echo "Test xr dump" - $(top_srcdir)/test/run_test.sh 212 $(top_srcdir)/test/xr_dump_test.sh $(top_builddir) $(top_srcdir) + $(top_srcdir)/test/run_test.sh 212 $(top_srcdir)/test/xr_dump_test.sh $(top_builddir) $(top_srcdir) echo "Test drun" $(top_srcdir)/test/run_test.sh 213 $(top_srcdir)/test/run_drun_test.sh $(top_builddir) echo "Test combi" @@ -203,7 +203,9 @@ test-x: ${bin_PROGRAMS} echo "Test dmenu fuzzy" $(top_srcdir)/test/run_test.sh 217 $(top_srcdir)/test/run_fuzzy_test.sh $(top_builddir) echo "Test config dump" - $(top_srcdir)/test/run_test.sh 218 $(top_srcdir)/test/xr_config_test.sh $(top_builddir) $(top_srcdir) + $(top_srcdir)/test/run_test.sh 218 $(top_srcdir)/test/xr_config_test.sh $(top_builddir) $(top_srcdir) + echo "Test dmenu-normal-window" + $(top_srcdir)/test/run_test.sh 219 $(top_srcdir)/test/run_dmenu_normal_window_test.sh $(top_builddir) echo "End tests" diff --git a/test/run_dmenu_normal_window_test.sh b/test/run_dmenu_normal_window_test.sh new file mode 100755 index 00000000..242af831 --- /dev/null +++ b/test/run_dmenu_normal_window_test.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +# wait till it is up, run rofi with error message +sleep 1; +echo -e -n "aap\nnoot\nmies" | rofi -dmenu -normal-window > output.txt & +RPID=$! + +# send enter. +sleep 5; +xdotool key 'Down' +sleep 0.4 +xdotool key Shift+Return +xdotool key Return + +# Get result, kill xvfb +wait ${RPID} +RETV=$? +OUTPUT=$(cat output.txt | tr '\n' ' ') +if [ "${OUTPUT}" != 'noot mies ' ] +then + echo "Got: '${OUTPUT}' expected 'noot mies '" + exit 1 +fi +echo ${RETV} +exit ${RETV}