summaryrefslogtreecommitdiffstats
path: root/tests/ts/libsmartcols/fromfile
diff options
context:
space:
mode:
authorKarel Zak2016-09-13 13:08:02 +0200
committerKarel Zak2016-09-13 13:08:02 +0200
commitfa4691833a2758ee3defc31645a502c117624369 (patch)
treef6c2e2300aa8cdc7468b00c4e129bcd3c0bc3387 /tests/ts/libsmartcols/fromfile
parentlibsmartcols: fix WRAPNL on strings without \n (diff)
downloadkernel-qcow2-util-linux-fa4691833a2758ee3defc31645a502c117624369.tar.gz
kernel-qcow2-util-linux-fa4691833a2758ee3defc31645a502c117624369.tar.xz
kernel-qcow2-util-linux-fa4691833a2758ee3defc31645a502c117624369.zip
libsmartcols: add application to test library features
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests/ts/libsmartcols/fromfile')
-rwxr-xr-xtests/ts/libsmartcols/fromfile50
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/ts/libsmartcols/fromfile b/tests/ts/libsmartcols/fromfile
new file mode 100755
index 000000000..456ca4367
--- /dev/null
+++ b/tests/ts/libsmartcols/fromfile
@@ -0,0 +1,50 @@
+#!/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="${0%/*}/../.."
+TS_DESC="fromfile"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+TESTPROG="$TS_HELPER_LIBSMARTCOLS_FROMFILE"
+ts_check_test_command "$TESTPROG"
+
+
+ts_init_subtest "right"
+$TESTPROG --nlines 10 \
+ --column $TS_SELF/files/col-name \
+ --column $TS_SELF/files/col-number \
+ --column $TS_SELF/files/col-string \
+ $TS_SELF/files/data-string \
+ $TS_SELF/files/data-number \
+ $TS_SELF/files/data-string-long \
+ >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "wrapnl"
+$TESTPROG --nlines 10 \
+ --column $TS_SELF/files/col-name \
+ --column $TS_SELF/files/col-number \
+ --column $TS_SELF/files/col-wrapnl \
+ $TS_SELF/files/data-string \
+ $TS_SELF/files/data-number \
+ $TS_SELF/files/data-string-nl \
+ >> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_log "...done."
+ts_finalize