Add another test.

This commit is contained in:
QC 2014-08-29 16:24:39 +02:00
parent 94d17b0001
commit bcbf512dc4
3 changed files with 32 additions and 1 deletions

View file

@ -9,6 +9,6 @@ before_install:
- sudo pip install cpp-coveralls - sudo pip install cpp-coveralls
script: script:
- autoreconf -i && ./configure --enable-gcov && make && make -C test/ test && ./test/run_errormsg_test.sh - autoreconf -i && ./configure --enable-gcov && make && make test
after_success: after_success:
- coveralls -x c --gcov-options '\-lp' - coveralls -x c --gcov-options '\-lp'

View file

@ -84,3 +84,9 @@ indent: ${rofi_SOURCES}
update-manpage: ${top_srcdir}/doc/rofi-manpage.markdown update-manpage: ${top_srcdir}/doc/rofi-manpage.markdown
md2man-roff $^ > ${top_srcdir}/doc/rofi.1 md2man-roff $^ > ${top_srcdir}/doc/rofi.1
.PHONY: test
test: rofi
make -C test/ test
./test/run_errormsg_test.sh
./test/run_switchdialog_test.sh

25
test/run_switchdialog_test.sh Executable file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Create fake X
Xvfb :200 &
XPID=$!
# wait till it is up, run rofi with error message
sleep 1 && ./rofi -rnow -display :200 &
RPID=$!
# send enter.
sleep 5;
DISPLAY=:200 xdotool key 'shift+slash'
sleep 0.4
DISPLAY=:200 xdotool key 'shift+slash'
sleep 0.4
DISPLAY=:200 xdotool key 'shift+slash'
sleep 0.4
DISPLAY=:200 xdotool key Escape
# Get result, kill xvfb
wait ${RPID}
RETV=$?
kill ${XPID}
exit ${RETV}