diff options
author | Karel Zak | 2016-09-13 13:08:02 +0200 |
---|---|---|
committer | Karel Zak | 2016-09-13 13:08:02 +0200 |
commit | fa4691833a2758ee3defc31645a502c117624369 (patch) | |
tree | f6c2e2300aa8cdc7468b00c4e129bcd3c0bc3387 /tests | |
parent | libsmartcols: fix WRAPNL on strings without \n (diff) | |
download | kernel-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')
-rw-r--r-- | tests/commands.sh | 1 | ||||
-rw-r--r-- | tests/expected/libsmartcols/fromfile | 1 | ||||
-rw-r--r-- | tests/expected/libsmartcols/fromfile-right | 11 | ||||
-rw-r--r-- | tests/expected/libsmartcols/fromfile-wrapnl | 19 | ||||
-rw-r--r-- | tests/ts/libsmartcols/files/col-name | 3 | ||||
-rw-r--r-- | tests/ts/libsmartcols/files/col-number | 3 | ||||
-rw-r--r-- | tests/ts/libsmartcols/files/col-string | 3 | ||||
-rw-r--r-- | tests/ts/libsmartcols/files/col-wrap | 3 | ||||
-rw-r--r-- | tests/ts/libsmartcols/files/col-wrapnl | 3 | ||||
-rw-r--r-- | tests/ts/libsmartcols/files/data-number | 10 | ||||
-rw-r--r-- | tests/ts/libsmartcols/files/data-string | 10 | ||||
-rw-r--r-- | tests/ts/libsmartcols/files/data-string-long | 10 | ||||
-rw-r--r-- | tests/ts/libsmartcols/files/data-string-nl | 10 | ||||
-rwxr-xr-x | tests/ts/libsmartcols/fromfile | 50 |
14 files changed, 137 insertions, 0 deletions
diff --git a/tests/commands.sh b/tests/commands.sh index a69c87e42..102711c51 100644 --- a/tests/commands.sh +++ b/tests/commands.sh @@ -16,6 +16,7 @@ TS_HELPER_LIBMOUNT_TAB="$top_builddir/test_mount_tab" TS_HELPER_LIBMOUNT_UPDATE="$top_builddir/test_mount_tab_update" TS_HELPER_LIBMOUNT_UTILS="$top_builddir/test_mount_utils" TS_HELPER_LIBMOUNT_DEBUG="$top_builddir/test_mount_debug" +TS_HELPER_LIBSMARTCOLS_FROMFILE="$top_builddir/sample-scols-fromfile" TS_HELPER_PYLIBMOUNT_CONTEXT="$top_srcdir/libmount/python/test_mount_context.py" TS_HELPER_PYLIBMOUNT_TAB="$top_srcdir/libmount/python/test_mount_tab.py" TS_HELPER_PYLIBMOUNT_UPDATE="$top_srcdir/libmount/python/test_mount_tab_update.py" diff --git a/tests/expected/libsmartcols/fromfile b/tests/expected/libsmartcols/fromfile new file mode 100644 index 000000000..4155aa36f --- /dev/null +++ b/tests/expected/libsmartcols/fromfile @@ -0,0 +1 @@ +...done. diff --git a/tests/expected/libsmartcols/fromfile-right b/tests/expected/libsmartcols/fromfile-right new file mode 100644 index 000000000..d78285a13 --- /dev/null +++ b/tests/expected/libsmartcols/fromfile-right @@ -0,0 +1,11 @@ +NAME NUM STRINGS +aaaa 0 qqqqqqqqqqqqqqqqqX +bbb 100 dddddddddddddX +ccccc 21 ffffffffffffffffffffffffffffffffffffffffX +dddddd 3 ssssssssssX +ee 411 ddddddddddddddddddddddddddX +ffff 5111 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjX +gggggg 678993321 mmmmmmmmmmmmmmmmmmmX +hhh 7666666 lllllllllllllllllllllllllllllllllllllX +iiiiii 8765 yyyyyyyyyyyyyyyyyyyyyyyyyyyyX +jj 987456 pppppppppX diff --git a/tests/expected/libsmartcols/fromfile-wrapnl b/tests/expected/libsmartcols/fromfile-wrapnl new file mode 100644 index 000000000..c747ebb08 --- /dev/null +++ b/tests/expected/libsmartcols/fromfile-wrapnl @@ -0,0 +1,19 @@ +NAME NUM WRAPNL +aaaa 0 aaa +bbb 100 bbbbb +ccccc 21 cccc + CCCC +dddddd 3 dddddddd + DDDD + DD +ee 411 hello + baby +ffff 5111 aaa + bbb + ccc + ddd +gggggg 678993321 eee +hhh 7666666 fffff +iiiiii 8765 g + hhhhh +jj 987456 ppppppppp diff --git a/tests/ts/libsmartcols/files/col-name b/tests/ts/libsmartcols/files/col-name new file mode 100644 index 000000000..0a98f29cf --- /dev/null +++ b/tests/ts/libsmartcols/files/col-name @@ -0,0 +1,3 @@ +NAME +0 +none diff --git a/tests/ts/libsmartcols/files/col-number b/tests/ts/libsmartcols/files/col-number new file mode 100644 index 000000000..5ef733f97 --- /dev/null +++ b/tests/ts/libsmartcols/files/col-number @@ -0,0 +1,3 @@ +NUM +3 +right diff --git a/tests/ts/libsmartcols/files/col-string b/tests/ts/libsmartcols/files/col-string new file mode 100644 index 000000000..7e2904b9f --- /dev/null +++ b/tests/ts/libsmartcols/files/col-string @@ -0,0 +1,3 @@ +STRINGS +0 +none diff --git a/tests/ts/libsmartcols/files/col-wrap b/tests/ts/libsmartcols/files/col-wrap new file mode 100644 index 000000000..dc4ca340e --- /dev/null +++ b/tests/ts/libsmartcols/files/col-wrap @@ -0,0 +1,3 @@ +WRAP +0 +wrap diff --git a/tests/ts/libsmartcols/files/col-wrapnl b/tests/ts/libsmartcols/files/col-wrapnl new file mode 100644 index 000000000..0a18fd146 --- /dev/null +++ b/tests/ts/libsmartcols/files/col-wrapnl @@ -0,0 +1,3 @@ +WRAPNL +0 +wrapnl diff --git a/tests/ts/libsmartcols/files/data-number b/tests/ts/libsmartcols/files/data-number new file mode 100644 index 000000000..562d75061 --- /dev/null +++ b/tests/ts/libsmartcols/files/data-number @@ -0,0 +1,10 @@ +0 +100 +21 +3 +411 +5111 +678993321 +7666666 +8765 +987456 diff --git a/tests/ts/libsmartcols/files/data-string b/tests/ts/libsmartcols/files/data-string new file mode 100644 index 000000000..dff6e9c80 --- /dev/null +++ b/tests/ts/libsmartcols/files/data-string @@ -0,0 +1,10 @@ +aaaa +bbb +ccccc +dddddd +ee +ffff +gggggg +hhh +iiiiii +jj diff --git a/tests/ts/libsmartcols/files/data-string-long b/tests/ts/libsmartcols/files/data-string-long new file mode 100644 index 000000000..1b5683aa4 --- /dev/null +++ b/tests/ts/libsmartcols/files/data-string-long @@ -0,0 +1,10 @@ +qqqqqqqqqqqqqqqqqX +dddddddddddddX +ffffffffffffffffffffffffffffffffffffffffX +ssssssssssX +ddddddddddddddddddddddddddX +jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjX +mmmmmmmmmmmmmmmmmmmX +lllllllllllllllllllllllllllllllllllllX +yyyyyyyyyyyyyyyyyyyyyyyyyyyyX +pppppppppX diff --git a/tests/ts/libsmartcols/files/data-string-nl b/tests/ts/libsmartcols/files/data-string-nl new file mode 100644 index 000000000..7822e57bc --- /dev/null +++ b/tests/ts/libsmartcols/files/data-string-nl @@ -0,0 +1,10 @@ +aaa +bbbbb +cccc\nCCCC +dddddddd\nDDDD\nDD +hello\nbaby +aaa\nbbb\nccc\nddd +eee +fffff +g\nhhhhh +ppppppppp 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 |