This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/5] tests: Add run-readelf-unknown-self.sh test to check for unknown DWARF codes.


> +# Make sure there are no unknown DWARF codes.
> +testrun_on_self_nomatch "unknown_0x[0-9a-f]+|lo_user\+0x[0-9a-f]" ../src/readelf -N -w

You'll have to make it smarter without the unknown_ prefix,
but it's better to work harder to write a test than to make
the output of a user tool uglier.

> +  for file in $self_test_files; do
> +      testrun $* $file | egrep -o "$pattern" | sort -u > self_matches.out \

Indent by two spaces, not four.  Use "$@" (with quotes), not $*.

> +	  || :

Why do you want to succeed if the pipeline fails?
Anyway this really should do testrun separately so it can check
the exit status of the tested command before it does grep.

> +      if test -s self_matches.out; then
> +	  echo "*** failure in $* $file"; cat self_matches.out; exit_status=1;

Use separate lines rather than ;.

> +  # Only exit if something failed
> +  if test $exit_status != 0; then exit $exit_status; fi

If you want to do this on one line, use:
    test $exit_status = 0 || exit $exit_status


Thanks,
Roland

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]