From 4a62215c842e61efef31b1f2b3e02af88e12a942 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 9 Jun 2016 12:10:33 +0200 Subject: [PATCH] tests: fix for non-ncurses version Signed-off-by: Karel Zak --- tests/functions.sh | 9 +++++++++ tests/ts/cal/color | 5 +++++ tests/ts/cal/colorw | 5 +++++ tests/ts/cal/weekarg | 5 +++++ 4 files changed, 24 insertions(+) diff --git a/tests/functions.sh b/tests/functions.sh index 19e8a46b8b..db5f536c65 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -729,3 +729,12 @@ function ts_has_mtab_support { fi } +function ts_has_ncurses_support { + grep -q '#define HAVE_LIBNCURSES' ${top_builddir}/config.h + if [ $? == 0 ]; then + echo "yes" + else + echo "no" + fi +} + diff --git a/tests/ts/cal/color b/tests/ts/cal/color index 00e9c188a9..8a6dfb69c3 100755 --- a/tests/ts/cal/color +++ b/tests/ts/cal/color @@ -22,6 +22,11 @@ ts_init "$*" ts_check_test_command "$TS_CMD_CAL" +has_ncurses=$( ts_has_ncurses_support ) +if [ "$has_ncurses" != "yes" ]; then + ts_skip "without-ncurses" +fi + # --color output depends on terminal type export TERM=linux diff --git a/tests/ts/cal/colorw b/tests/ts/cal/colorw index 8e8ba0139e..493dd2c518 100755 --- a/tests/ts/cal/colorw +++ b/tests/ts/cal/colorw @@ -22,6 +22,11 @@ ts_init "$*" ts_check_test_command "$TS_CMD_CAL" +has_ncurses=$( ts_has_ncurses_support ) +if [ "$has_ncurses" != "yes" ]; then + ts_skip "without-ncurses" +fi + # --color output depends on terminal type export TERM=linux diff --git a/tests/ts/cal/weekarg b/tests/ts/cal/weekarg index 19f58c1001..236baedd52 100755 --- a/tests/ts/cal/weekarg +++ b/tests/ts/cal/weekarg @@ -23,6 +23,11 @@ ts_init "$*" ts_check_test_command "$TS_CMD_CAL" +has_ncurses=$( ts_has_ncurses_support ) +if [ "$has_ncurses" != "yes" ]; then + ts_skip "without-ncurses" +fi + export TERM=linux USETERM=$( ts_has_option "useterm" "$*" ) -- 2.47.3