On 12/06/2013 06:45 PM, Pádraig Brady wrote: > On 12/06/2013 05:20 PM, Pádraig Brady wrote: >> That would probably work, though perhaps we should >> make this test a bit more general with something like the following? >> >> Also Marcin, could you try out the latest snapshot (which will >> also need the patch applied). It has another aarch64 specific patch included, >> and it would be great to verify it on this platform. >> Two birds with one stone and all that. Simple test instructions at: >> http://lists.gnu.org/archive/html/coreutils/2013-12/msg00062.html >> >> diff --git a/tests/ls/stat-free-color.sh b/tests/ls/stat-free-color.sh >> index 3aacf96..4dd7ae7 100755 >> --- a/tests/ls/stat-free-color.sh >> +++ b/tests/ls/stat-free-color.sh >> @@ -53,11 +53,11 @@ eval $(dircolors -b color-without-stat) >> # To avoid counting those, first get a baseline count by running >> # ls with only the --help option. Then, compare that with the >> # invocation under test. >> -strace -o log-help -e stat,lstat,stat64,lstat64 ls --help >/dev/null || >> fail=1 >> -n_lines_help=$(wc -l < log-help) >> +strace -o log-help ls --help >/dev/null || fail=1 >> +n_lines_help=$(grep 'stat.*(' log-help | wc -l) >> >> -strace -o log -e stat,lstat,stat64,lstat64 ls --color=always . || fail=1 >> -n_lines=$(wc -l < log) >> +strace -o log ls --color=always . || fail=1 >> +n_lines=$(grep 'stat.*(' log | wc -l) >> >> n_stat=$(expr $n_lines - $n_lines_help)
I think that's okay (and much better than my on-the-spot fix), and Marcin already gave positive feedback. > Even at that the test is still brittle, > as the guard only checks that `strace -e stat` works. > Also it's conceivable that on some edge cases there > may be more than one stat call used in this case. I must confess that I don't understand this, i.e. in which circumstances this test would fail as it has been working long enough, and now just is ported to another architecture. Have a nice day, Berny
