diff options
author | Eric Blake <ebb9@byu.net> | 2009-10-23 08:54:53 -0600 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2009-10-23 16:31:23 -0600 |
commit | bd933c125073bf5b071d8ea0631de8aac3a8c3e9 (patch) | |
tree | cc2d38714175100fc90fd9ef1f289239003d4669 /tests/misc/stdbuf | |
parent | 1ce9e1e5ca1e7491bccedeeced15470d856c9a22 (diff) | |
download | coreutils-bd933c125073bf5b071d8ea0631de8aac3a8c3e9.tar.xz |
tests: enhance stdbuf and timeout tests
* tests/misc/timeout-parameters: Validate exact exit status.
* tests/misc/stdbuf: Likewise.
* tests/misc/timeout: Likewise. Use require_built_.
* tests/misc/arch: Likewise.
Diffstat (limited to 'tests/misc/stdbuf')
-rwxr-xr-x | tests/misc/stdbuf | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/tests/misc/stdbuf b/tests/misc/stdbuf index 337504028..33bc658ea 100755 --- a/tests/misc/stdbuf +++ b/tests/misc/stdbuf @@ -16,20 +16,15 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +. $srcdir/test-lib.sh +getlimits_ +require_built_ stdbuf + if test "$VERBOSE" = yes; then set -x stdbuf --version fi -. $srcdir/test-lib.sh -getlimits_ - -# skip this test if stdbuf isn't being built. -case " $built_programs " in - *" stdbuf "*) ;; - *) skip_test_ 'stdbuf not built';; -esac - # stdbuf fails when the absolute top build dir name contains e.g., space, TAB, NL lf=' ' @@ -52,10 +47,17 @@ stdbuf -o1 true || fail=1 # verify size syntax stdbuf -oK true || fail=1 # verify size syntax stdbuf -o0 true || fail=1 # verify unbuffered syntax stdbuf -oL true || fail=1 # verify line buffered syntax -stdbuf -ol true && fail=1 # Capital 'L' required -stdbuf -o$SIZE_OFLOW true && fail=1 # size too large -stdbuf -iL true && fail=1 # line buffering stdin disallowed +stdbuf -ol true # Capital 'L' required +test $? = 125 || fail=1 # Internal error is a particular status +stdbuf -o$SIZE_OFLOW true # size too large +test $? = 125 || fail=1 +stdbuf -iL true # line buffering stdin disallowed +test $? = 125 || fail=1 stdbuf -i0 -o0 -e0 true || fail=1 #check all files +stdbuf -o1 . # invalid command +test $? = 126 || fail=1 +stdbuf -o1 ... # no such command +test $? = 127 || fail=1 # Ensure line buffering stdout takes effect printf '1\n' > exp |