From: Sami Kerola Date: Sat, 19 Jan 2013 00:08:59 +0000 (+0000) Subject: tests: add more(1) check X-Git-Tag: v2.23-rc1~321 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e4b5aa9279c538a811063a11b75996f834c1f05;p=thirdparty%2Futil-linux.git tests: add more(1) check [kzak@redhat.com: use test_more program rather than directly more(1)] Signed-off-by: Sami Kerola Signed-off-by: Karel Zak --- diff --git a/tests/commands.sh b/tests/commands.sh index c5f714094f..30f0b9b0e9 100644 --- a/tests/commands.sh +++ b/tests/commands.sh @@ -23,6 +23,8 @@ TS_HELPER_LIBMOUNT_TABDIFF="$top_builddir/test_mount_tab_diff" TS_HELPER_ISLOCAL="$top_builddir/test_islocal" TS_HELPER_LOGINDEFS="$top_builddir/test_logindefs" +TS_HELPER_MORE=${TS_HELPER_MORE-"$top_builddir/test_more"} + # TODO: use partx TS_HELPER_PARTITIONS="$top_builddir/sample-partitions" diff --git a/tests/expected/more/regexp b/tests/expected/more/regexp new file mode 100644 index 0000000000..e88c99be2b --- /dev/null +++ b/tests/expected/more/regexp @@ -0,0 +1,4 @@ + +...skipping +foo +xyzzy diff --git a/tests/expected/more/squeeze b/tests/expected/more/squeeze new file mode 100644 index 0000000000..a1a53b5339 --- /dev/null +++ b/tests/expected/more/squeeze @@ -0,0 +1,3 @@ +a + +b diff --git a/tests/ts/more/regexp b/tests/ts/more/regexp new file mode 100755 index 0000000000..06a00a290c --- /dev/null +++ b/tests/ts/more/regexp @@ -0,0 +1,24 @@ +#!/bin/bash + +# This file is part of util-linux. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +TS_TOPDIR="$(dirname $0)/../.." +TS_DESC="regexp" + +. $TS_TOPDIR/functions.sh +ts_init "$*" + +printf "abba\nbar\nfoo\nxyzzy\n" | + $TS_HELPER_MORE +/foo > $TS_OUTPUT 2>&1 + +ts_finalize diff --git a/tests/ts/more/squeeze b/tests/ts/more/squeeze new file mode 100755 index 0000000000..d448fc15fb --- /dev/null +++ b/tests/ts/more/squeeze @@ -0,0 +1,24 @@ +#!/bin/bash + +# This file is part of util-linux. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +TS_TOPDIR="$(dirname $0)/../.." +TS_DESC="squeeze" + +. $TS_TOPDIR/functions.sh +ts_init "$*" + +printf "a\n\n\nb\n" | + $TS_HELPER_MORE -s > $TS_OUTPUT 2>&1 + +ts_finalize