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>
+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.
# 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
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()
{