From e84046dbe6dd26bfcea7edf6fb419bea274635ab Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Wed, 14 Jan 2015 17:38:12 +0100 Subject: 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 --- tests/touch/no-dereference.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/touch') diff --git a/tests/touch/no-dereference.sh b/tests/touch/no-dereference.sh index 776c255f2..fc0c72378 100755 --- a/tests/touch/no-dereference.sh +++ b/tests/touch/no-dereference.sh @@ -27,7 +27,7 @@ ln -s file link || framework_failure_ # These first tests should work on every platform. # -h does not create files, but it warns. Use -c to silence warning. returns_ 1 touch -h no-file 2> err || fail=1 -test -s err || fail=1 +compare /dev/null err && fail=1 touch -h -c no-file 2> err || fail=1 compare /dev/null err || fail=1 -- cgit v1.2.3-70-g09d2