[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] tests: improve diagnostics when asserting empty files
From: |
Bernhard Voelker |
Subject: |
Re: [PATCH] tests: improve diagnostics when asserting empty files |
Date: |
Tue, 06 May 2014 08:43:42 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 |
On 05/06/2014 03:46 AM, Pádraig Brady wrote:
> * 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/cp-a-selinux.sh: Likewise.
> * tests/cp/cp-mv-enotsup-xattr.sh: Likewise.
> * tests/dd/misc.sh: Likewise.
> * tests/misc/nice.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/wait.sh: Likewise.
> * tests/touch/no-dereference.sh: Likewise.
Great idea!
I'm curious: what was the criteria to choose those tests?
I mean, "cd tests && git grep 'test -s.*&&' | wc -l" still
counts 21 matches, even one where the part after the '&&'
could be simplified like in tail-2/inotify-race.sh:55:
test -s gdb.out && { cat gdb.out; skip_ "can't set breakpoints in tail"; }
vs.
compare /dev/null gdb.out || skip_ "can't set breakpoints in tail"
Thanks & have a nice day,
Berny