From bcbf512dc48745443479694164e2de4bb813181d Mon Sep 17 00:00:00 2001 From: QC Date: Fri, 29 Aug 2014 16:24:39 +0200 Subject: [PATCH] Add another test. --- .travis.yml | 2 +- Makefile.am | 6 ++++++ test/run_switchdialog_test.sh | 25 +++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100755 test/run_switchdialog_test.sh diff --git a/.travis.yml b/.travis.yml index 6f99b6fd..5226d398 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,6 @@ before_install: - sudo pip install cpp-coveralls 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: - coveralls -x c --gcov-options '\-lp' diff --git a/Makefile.am b/Makefile.am index 78e06a10..b9e45767 100644 --- a/Makefile.am +++ b/Makefile.am @@ -84,3 +84,9 @@ indent: ${rofi_SOURCES} update-manpage: ${top_srcdir}/doc/rofi-manpage.markdown 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 diff --git a/test/run_switchdialog_test.sh b/test/run_switchdialog_test.sh new file mode 100755 index 00000000..fc4f5f54 --- /dev/null +++ b/test/run_switchdialog_test.sh @@ -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}