summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSami Kerola2013-01-19 01:08:59 +0100
committerKarel Zak2013-01-24 19:30:35 +0100
commit8e4b5aa9279c538a811063a11b75996f834c1f05 (patch)
treeee694dc2098bb9945fbdbdeac6b61c6a9d362830 /tests
parentmore: allow to compile as non-interactive test_more program (diff)
downloadkernel-qcow2-util-linux-8e4b5aa9279c538a811063a11b75996f834c1f05.tar.gz
kernel-qcow2-util-linux-8e4b5aa9279c538a811063a11b75996f834c1f05.tar.xz
kernel-qcow2-util-linux-8e4b5aa9279c538a811063a11b75996f834c1f05.zip
tests: add more(1) check
[kzak@redhat.com: use test_more program rather than directly more(1)] Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/commands.sh2
-rw-r--r--tests/expected/more/regexp4
-rw-r--r--tests/expected/more/squeeze3
-rwxr-xr-xtests/ts/more/regexp24
-rwxr-xr-xtests/ts/more/squeeze24
5 files changed, 57 insertions, 0 deletions
diff --git a/tests/commands.sh b/tests/commands.sh
index c5f714094..30f0b9b0e 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 000000000..e88c99be2
--- /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 000000000..a1a53b533
--- /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 000000000..06a00a290
--- /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 000000000..d448fc15f
--- /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