summaryrefslogtreecommitdiff
path: root/tests/test-subr.sh
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2012-08-01 15:31:12 +0200
committerMark Wielaard <mjw@redhat.com>2012-08-03 23:19:54 +0200
commit94e387f693dae334d0b8c713c27a23bd88bc1fc1 (patch)
tree3a9449ad4673706b02b0bf217a70076fa0dfe923 /tests/test-subr.sh
parentfe198bc5f02e540c26be212b9cb5e6f516f700b8 (diff)
downloadelfutils-94e387f693dae334d0b8c713c27a23bd88bc1fc1.tar.gz
tests: Introduce testrun_on_self, use it in run-elflint-self.sh
Signed-off-by: Mark Wielaard <mjw@redhat.com>
Diffstat (limited to 'tests/test-subr.sh')
-rw-r--r--tests/test-subr.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test-subr.sh b/tests/test-subr.sh
index 09efa534..5621cf1b 100644
--- a/tests/test-subr.sh
+++ b/tests/test-subr.sh
@@ -103,3 +103,22 @@ program_transform()
{
echo "$*" | sed "${program_transform_name}"
}
+
+self_test_files=`echo ../src/addr2line ../src/elfcmp ../src/elflint \
+../src/findtextrel ../src/ld ../src/nm ../src/objdump ../src/readelf \
+../src/size ../src/strip ../libelf/libelf.so ../libdw/libdw.so \
+../libasm/libasm.so ../backends/libebl_*.so`
+
+# Provide a command to run on all self-test files with testrun.
+testrun_on_self()
+{
+ exit_status=0
+
+ for file in $self_test_files; do
+ testrun "$@" $file \
+ || { echo "*** failure in $@ $file"; exit_status=1; }
+ done
+
+ # Only exit if something failed
+ if test $exit_status != 0; then exit $exit_status; fi
+}