This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH 3/5] tests: Add run-readelf-unknown-self.sh test to check for unknown DWARF codes.
- From: Roland McGrath <roland at hack dot frob dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Tue, 14 Aug 2012 14:18:40 -0700
- Subject: Re: [PATCH 3/5] tests: Add run-readelf-unknown-self.sh test to check for unknown DWARF codes.
> Lets see if we can make the tool output nicer first in the other patch.
> I don't think printing unknown is ugly.
On purely aesthetic matters, it's objective fact that I am right. ;-)
> Will fix indentation. Now I am confused about the "$@" vs $* though.
"$@" alone (with quotes) is special. It matters when you're using it where
it expands to multiple words, like for arguments. When it's: echo "foo $*
bar" then it makes no difference to use $@ or $* but $* is canonical.
Compare:
foo() { printf '|%s|%s|\n' "$@"; }
foo 'a b' 'c d'
bar() { printf '|%s|%s|\n' $*; }
bar 'a b' 'c d'
baz() { printf '|%s|%s|\n' "$*"; }
baz 'a b' 'c d'
> I think this was just cargo cult from testrun_out () above.
> But I don't know precisely what you mean by running testrun,
> we also do need to capture the output. But I'll look into rephrasing the
> function.
I meant 'testrun ... > $tempfile' rather than 'testrun ... | ...'.
With a pipeline you can't distinguish which part of the pipeline failed.
testrun_out also redirects stderr, and ignores errors with '|| :'.
It's for cases where we're matching the whole output including stderr,
so we can match expected error/warning messages or verify that there
were none.
Thanks,
Roland