diff options
author | Dave Davenport <qball@gmpclient.org> | 2014-08-31 10:37:12 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2014-08-31 10:37:12 +0200 |
commit | 5d5b4aac9f0a3fb02bfb094a194313bf2c5b800f (patch) | |
tree | 2f15f4a6a7b1d30926f27a803a8b3052eade6cce | |
parent | ad1cede6f5369467dc03856a9465bc2fd1cbfad9 (diff) |
Add small script test.
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | test/Makefile.am | 1 | ||||
-rwxr-xr-x | test/run_script_test.sh | 25 | ||||
-rwxr-xr-x | test/test_script.sh | 10 |
4 files changed, 40 insertions, 1 deletions
@@ -10,4 +10,7 @@ aclocal.m4 autom4te.cache/ compile depcomp - +*.o +*.gcov +*.gcda +*.gcno diff --git a/test/Makefile.am b/test/Makefile.am index 3627af70..ca005fe3 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -42,3 +42,4 @@ test: ${bin_PROGRAMS} $(top_srcdir)/test/run_test.sh 202 $(top_srcdir)/test/run_dmenu_test.sh $(top_builddir) $(top_srcdir)/test/run_test.sh 203 $(top_srcdir)/test/run_dmenu_custom_test.sh $(top_builddir) $(top_srcdir)/test/run_test.sh 204 $(top_srcdir)/test/run_run_test.sh $(top_builddir) + $(top_srcdir)/test/run_test.sh 205 $(top_srcdir)/test/run_script_test.sh $(top_builddir) diff --git a/test/run_script_test.sh b/test/run_script_test.sh new file mode 100755 index 00000000..fef075f8 --- /dev/null +++ b/test/run_script_test.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +SP=$(readlink -f "$0") +DIR=$(dirname "$SP") +echo $DIR +# wait till it is up, run rofi with error message +sleep 1; +rofi -switchers "custom:$DIR/test_script.sh" -show custom & +RPID=$! + +# send enter. +sleep 5; +xdotool key 'Down' +sleep 0.4 +xdotool key Return + +# Get result, kill xvfb +wait ${RPID} +RETV=$? +OUTPUT=$(cat output.txt | tr '\n' ' ') +if [ "${OUTPUT}" != 'noot ' ] +then + exit 1 +fi +exit ${RETV} diff --git a/test/test_script.sh b/test/test_script.sh new file mode 100755 index 00000000..c4021380 --- /dev/null +++ b/test/test_script.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +if [ -z "$1" ] +then + echo "aap" + echo "noot" + echo "mies" +else + echo $1 > output.txt +fi |