mirror of
https://github.com/lbonn/rofi
synced 2024-11-13 23:57:10 +00:00
Add small script test.
This commit is contained in:
parent
ad1cede6f5
commit
5d5b4aac9f
4 changed files with 40 additions and 1 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -10,4 +10,7 @@ aclocal.m4
|
|||
autom4te.cache/
|
||||
compile
|
||||
depcomp
|
||||
|
||||
*.o
|
||||
*.gcov
|
||||
*.gcda
|
||||
*.gcno
|
||||
|
|
|
@ -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)
|
||||
|
|
25
test/run_script_test.sh
Executable file
25
test/run_script_test.sh
Executable file
|
@ -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}
|
10
test/test_script.sh
Executable file
10
test/test_script.sh
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "aap"
|
||||
echo "noot"
|
||||
echo "mies"
|
||||
else
|
||||
echo $1 > output.txt
|
||||
fi
|
Loading…
Reference in a new issue