* [PATCH] tests: Run run-varlocs-self.sh for object files with --exprlocs.
@ 2020-04-17 10:34 Mark Wielaard
2020-04-21 22:53 ` Mark Wielaard
0 siblings, 1 reply; 2+ messages in thread
From: Mark Wielaard @ 2020-04-17 10:34 UTC (permalink / raw)
To: elfutils-devel; +Cc: Mark Wielaard
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 | 7 +++++++
tests/run-varlocs-self.sh | 4 +++-
tests/test-subr.sh | 13 +++++++++++++
3 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 886a3efb..301b0fb6 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -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.
diff --git a/tests/run-varlocs-self.sh b/tests/run-varlocs-self.sh
index 54b6a8d7..5454fc70 100755
--- a/tests/run-varlocs-self.sh
+++ b/tests/run-varlocs-self.sh
@@ -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
diff --git a/tests/test-subr.sh b/tests/test-subr.sh
index e768c1e5..411e5f28 100644
--- a/tests/test-subr.sh
+++ b/tests/test-subr.sh
@@ -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()
{
--
2.18.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] tests: Run run-varlocs-self.sh for object files with --exprlocs.
2020-04-17 10:34 [PATCH] tests: Run run-varlocs-self.sh for object files with --exprlocs Mark Wielaard
@ 2020-04-21 22:53 ` Mark Wielaard
0 siblings, 0 replies; 2+ messages in thread
From: Mark Wielaard @ 2020-04-21 22:53 UTC (permalink / raw)
To: elfutils-devel
On Fri, Apr 17, 2020 at 12:34:17PM +0200, Mark Wielaard wrote:
> 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).
Pushed to master.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-21 22:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-17 10:34 [PATCH] tests: Run run-varlocs-self.sh for object files with --exprlocs Mark Wielaard
2020-04-21 22:53 ` Mark Wielaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).