]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
tests: Introduce testrun_on_self, use it in run-elflint-self.sh
authorMark Wielaard <mjw@redhat.com>
Wed, 1 Aug 2012 13:31:12 +0000 (15:31 +0200)
committerMark Wielaard <mjw@redhat.com>
Fri, 3 Aug 2012 21:19:54 +0000 (23:19 +0200)
Signed-off-by: Mark Wielaard <mjw@redhat.com>
tests/ChangeLog
tests/run-elflint-self.sh
tests/test-subr.sh

index 6133048f65014cc77e72a95a5deb9cfee4ae44b1..0f8d10ffecc16a29cd1e1507ebbae4ea953d167c 100644 (file)
@@ -1,3 +1,9 @@
+2012-08-01  Mark Wielaard  <mjw@redhat.com>
+
+       * test-subr.sh (self_test_files): New list of files.
+       (testrun_on_self): New function.
+       * run-elflint-self.sh: Use testrun_on_self.
+
 2012-07-19  Mark Wielaard  <mjw@redhat.com>
 
        * Makefile.am (check_PROGRAMS): Add test-elf_cntl_gelf_getshdr.
index 741ba85ef16e831f8dfaf519c9ef2798a37d290a..4b01008725079dd42fd43016f18785d8c1eba711 100755 (executable)
 
 . $srcdir/test-subr.sh
 
-status=0
-runtest() {
-# Uncomment for debuging
-#  echo $1
-  testrun ../src/elflint --quiet --gnu-ld $1 ||
-    { echo "*** failure in $1"; status=1; }
-}
-
-runtest ../src/addr2line
-runtest ../src/elfcmp
-runtest ../src/elflint
-runtest ../src/findtextrel
-runtest ../src/ld
-runtest ../src/nm
-runtest ../src/objdump
-runtest ../src/readelf
-runtest ../src/size
-runtest ../src/strip
-runtest ../libelf/libelf.so
-runtest ../libdw/libdw.so
-runtest ../libasm/libasm.so
-runtest ../backends/libebl_alpha.so
-runtest ../backends/libebl_arm.so
-runtest ../backends/libebl_i386.so
-runtest ../backends/libebl_ia64.so
-runtest ../backends/libebl_ppc.so
-runtest ../backends/libebl_ppc64.so
-runtest ../backends/libebl_sh.so
-runtest ../backends/libebl_sparc.so
-runtest ../backends/libebl_x86_64.so
-
-exit $status
+testrun_on_self ../src/elflint --quiet --gnu-ld
index 09efa534177b2df9cdaa4f7ec40774c236f9a547..5621cf1bd12b421d33a3f348acec1e7c1c8cefaa 100644 (file)
@@ -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
+}