From 8840a00cd79b8beae72b1a0ec6b9e64912633c13 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Tue, 6 May 2014 02:37:43 +0100 Subject: tests: improve diagnostics when asserting empty files * tests/chmod/c-option.sh: Use `compare /dev/null ... || fail=1` rather than `test -s ... && fail=1`, so that the file contents are output, thus improving diagnostics for failing tests. * tests/cp/acl.sh: Likewise. * tests/cp/cp-a-selinux.sh: Likewise. * tests/cp/cp-mv-enotsup-xattr.sh: Likewise. * tests/cp/reflink-perm.sh: Likewise. * tests/dd/misc.sh: Likewise. * tests/misc/env-null.sh: Likewise. * tests/misc/env.sh: Likewise. * tests/misc/nice.sh: Likewise. * tests/misc/nohup.sh: Likewise. * tests/misc/printenv.sh: Likewise. * tests/misc/xattr.sh: Likewise. * tests/mv/update.sh: Likewise. * tests/rm/deep-2.sh: Likewise. * tests/rm/read-only.sh: Likewise. * tests/split/r-chunk.sh: Likewise. * tests/tail-2/follow-stdin.sh: Likewise. * tests/tail-2/inotify-race.sh: Likewise. * tests/tail-2/wait.sh: Likewise. * tests/touch/no-dereference.sh: Likewise. * cfg.mk (sc_prohibit_test_empty:): New syntax-check. * tests/cp/proc-zero-len.sh: Adjust to avoid false syntax-check failure. * tests/cp/proc-zero-len.sh: Likewise. * tests/mv/part-symlink.sh: Likewise. * tests/tail-2/infloop-1.sh: Likewise. --- tests/chmod/c-option.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/chmod') diff --git a/tests/chmod/c-option.sh b/tests/chmod/c-option.sh index a1782c3d8..03e1db9a6 100755 --- a/tests/chmod/c-option.sh +++ b/tests/chmod/c-option.sh @@ -31,7 +31,7 @@ chmod u=rwx $file || fail=1 chmod -c g=rwx $file > out || fail=1 chmod -c g=rwx $file > empty || fail=1 -test -s empty && fail=1 +compare /dev/null empty || fail=1 case "$(cat out)" in "mode of 'f' changed from 0744 "?rwxr--r--?" to 0774 "?rwxrwxr--?) ;; *) cat out; fail=1 ;; -- cgit v1.2.3-70-g09d2