summaryrefslogtreecommitdiff
path: root/tests/misc/nice.sh
diff options
context:
space:
mode:
authorBernhard Voelker <mail@bernhard-voelker.de>2015-01-14 17:38:12 +0100
committerBernhard Voelker <mail@bernhard-voelker.de>2015-01-14 17:38:12 +0100
commite84046dbe6dd26bfcea7edf6fb419bea274635ab (patch)
tree50160bef015be6a261b0986762e23a449657fe0b /tests/misc/nice.sh
parent58cff8a009ed9b8280c5f35074cef97231286023 (diff)
downloadcoreutils-e84046dbe6dd26bfcea7edf6fb419bea274635ab.tar.xz
tests: use compare-vs-/dev/null instead of 'test -s'
When some program produces unexpected output, that use of compare-vs-/dev/null will ensure that the surprising output is printed in the test's output. With "test -s err" only, one would have to instrument and rerun in order to see the offending output. * cfg.mk (sc_prohibit_and_fail_1): Exempt 'compare' from this check. * tests/dd/misc.sh: Change "tests -s ... || fail=1" to "compare /dev/null ... && fail=1". * tests/misc/nice.sh: Likewise. * tests/rm/read-only.sh: Likewise. * tests/tail-2/inotify-race.sh: Likewise. * tests/touch/no-dereference.sh: Likewise. Suggested by Jim Meyering in http://lists.gnu.org/archive/html/coreutils/2015-01/msg00042.html
Diffstat (limited to 'tests/misc/nice.sh')
-rwxr-xr-xtests/misc/nice.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/misc/nice.sh b/tests/misc/nice.sh
index 973bc5acc..59316ec5a 100755
--- a/tests/misc/nice.sh
+++ b/tests/misc/nice.sh
@@ -73,7 +73,7 @@ done
if test x$(nice -n -1 nice 2> /dev/null) = x0 ; then
# unprivileged user - warn about failure to change
nice -n -1 true 2> err || fail=1
- test -s err || fail=1
+ compare /dev/null err && fail=1
mv err exp || framework_failure_
nice --1 true 2> err || fail=1
compare exp err || fail=1