]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
tests: Run run-varlocs-self.sh for object files with --exprlocs.
authorMark Wielaard <mark@klomp.org>
Fri, 17 Apr 2020 10:31:15 +0000 (12:31 +0200)
committerMark Wielaard <mark@klomp.org>
Tue, 21 Apr 2020 22:46:27 +0000 (00:46 +0200)
The varlocs test relies on finding addresses for the CUs, even in
object files. This might not be true (for example when building with
gcc -flto, which only emits partial, type only, debuginfo). Split
running the self tests in running on executables and shared libraries
as normal, but run object files with --exprlocs to test that output
too (and not require addresses).

Signed-off-by: Mark Wielaard <mark@klomp.org>
tests/ChangeLog
tests/run-varlocs-self.sh
tests/test-subr.sh

index 886a3efba4f78f9f15ced96b4c6873d5184a3016..301b0fb6e698db0e1af723c57632e78edace717d 100644 (file)
@@ -1,3 +1,10 @@
+2020-04-17  Mark Wielaard  <mark@klomp.org>
+
+       * test-subr.sh (testrun_on_self_obj): New function.
+       * run-varlocs-self.sh: Run testrun_on_self_exe and
+       testrun_on_self_lib with -e, run testrun_on_self_obj with
+       --exprlocs -e.
+
 2020-04-17  Mark Wielaard  <mark@klomp.org>
 
        * Makefile.am (test-nlist$): New goal with minimal CFLAGS.
index 54b6a8d787166bacf4992cc001fa4dd10e879c03..5454fc7014afb407bed4ad582d1695b79ebe6da1 100755 (executable)
@@ -19,4 +19,6 @@
 
 # Make sure varlocs doesn't crash, doesn't trigger self-check/asserts
 # or leaks running under valgrind.
-testrun_on_self_quiet ${abs_top_builddir}/tests/varlocs -e
+testrun_on_self_exe ${abs_top_builddir}/tests/varlocs -e
+testrun_on_self_lib ${abs_top_builddir}/tests/varlocs -e
+testrun_on_self_obj ${abs_top_builddir}/tests/varlocs --exprlocs -e
index e768c1e5d18a917d48b235d244c43929d439bd83..411e5f288acd30b5e4241b93694d3488870b99da 100644 (file)
@@ -168,6 +168,19 @@ testrun_on_self_lib()
   if test $exit_status != 0; then exit $exit_status; fi
 }
 
+testrun_on_self_obj()
+{
+  exit_status=0
+
+  for file in $self_test_files_obj; 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
+}
+
 # Compress the files first. Compress both debug sections and symtab.
 testrun_on_self_compressed()
 {