+2012-07-19 Mark Wielaard <mjw@redhat.com>
+
+ * run-readelf-unknown-self.sh: New test.
+ * Makefile.am (TESTS): Add run-readelf-unknown-self.sh.
+ (EXTRA_DIST): Likewise.
+
2012-07-27 Mark Wielaard <mjw@redhat.com>
* allregs.c (dwarf_encoding_string): Removed.
run-nm-self.sh run-readelf-self.sh \
run-readelf-test1.sh run-readelf-test2.sh run-readelf-test3.sh \
run-readelf-test4.sh run-readelf-twofiles.sh \
- run-readelf-macro.sh run-readelf-dwz-multi.sh \
+ run-readelf-unknown-self.sh run-readelf-macro.sh \
+ run-readelf-dwz-multi.sh \
run-native-test.sh run-bug1-test.sh \
dwfl-bug-addr-overflow run-addrname-test.sh \
dwfl-bug-fd-leak dwfl-bug-report \
coverage.sh test-subr.sh test-wrapper.sh \
run-readelf-test1.sh run-readelf-test2.sh run-readelf-test3.sh \
run-readelf-test4.sh run-readelf-twofiles.sh \
+ run-readelf-unknown-self.sh \
run-bug1-test.sh testfile28.bz2 testfile28.rdwr.bz2 \
testfile29.bz2 testfile29.rdwr.bz2 \
testfile30.bz2 testfile31.bz2 testfile32.bz2 testfile33.bz2 \
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2012 Red Hat, Inc.
+# This file is part of elfutils.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# elfutils is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+. $srcdir/test-subr.sh
+
+# Make sure there are no unknown DWARF codes.
+testrun_on_self_nomatch "\?\?\?\ \([x0-9]+\)|lo_user\+0x[0-9a-f]+" ../src/readelf -N -w
# Only exit if something failed
if test $exit_status != 0; then exit $exit_status; fi
}
+
+# Make sure the testrun doesn't contain some regular expression output.
+# First argument is an egrep regular expression, the rest is the command
+# to run on all self test files.
+testrun_on_self_nomatch()
+{
+ pattern="$1"
+ shift
+
+ exit_status=0
+ tempfiles self_matches.in self_matches.out
+
+ for file in $self_test_files; do
+ testrun "$@" $file > self_matches.in
+ # egrep should fail to match anything, but we also want to show
+ # what it matched if it doesn't fail, so save output.
+ grep_ok=0
+ egrep -o "$pattern" < self_matches.in > self_matches.out || grep_ok=1
+ if test $grep_ok == 0; then
+ echo "*** failure in $* $file"
+ sort -u self_matches.out
+ exit_status=1;
+ fi
+ done
+
+ # Only exit if something failed
+ test $exit_status == 0 || exit $exit_status
+}