public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mjw@redhat.com>
To: elfutils-devel@lists.fedorahosted.org
Subject: [PATCH] tests: backtrace-subr.sh add check_native_unsupported.
Date: Sat, 14 Jun 2014 01:04:52 +0200	[thread overview]
Message-ID: <1402700692-22091-1-git-send-email-mjw@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2925 bytes --]

The special arm check in check_unsupported should only trigger for native
tests, otherwise on arm various backtrace tests would be skipped that
should work just fine.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
---
 tests/ChangeLog              |    7 +++++++
 tests/backtrace-subr.sh      |   13 ++++++++++---
 tests/run-backtrace-dwarf.sh |    2 +-
 3 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/tests/ChangeLog b/tests/ChangeLog
index cd8a8e7..7c46428 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,10 @@
+2014-06-13  Mark Wielaard  <mjw@redhat.com>
+
+	* backtrace-subr.sh (check_native_unsupported): New function.
+	(check_native): Call it.
+	(check_native_core): Likewise.
+	* run-backtrace-dwarf.sh: Likewise.
+
 2014-06-11  Mark Wielaard  <mjw@redhat.com>
 
 	* backtrace.c (main): Check that Dwfl was attached by calling
diff --git a/tests/backtrace-subr.sh b/tests/backtrace-subr.sh
index 875e0b6..1d3d6d4 100644
--- a/tests/backtrace-subr.sh
+++ b/tests/backtrace-subr.sh
@@ -74,13 +74,20 @@ check_unsupported()
     echo >&2 $testname: arch not supported
     exit 77
   fi
+}
+
+check_native_unsupported()
+{
+  err=$1
+  testname=$2
+  check_unsupported $err $testname
 
   # ARM is special. It is supported, but it doesn't use .eh_frame by default
   # making the native tests fail unless debuginfo (for glibc) is installed
   # and we can fall back on .debug_frame for the CFI.
   case "`uname -m`" in
     arm* )
-      if grep 'dwfl_thread_getframes: No DWARF information found' $1; then
+      if grep 'dwfl_thread_getframes: No DWARF information found' $err; then
 	echo >&2 $testname: arm needs debuginfo installed for all libraries
 	exit 77
       fi
@@ -109,7 +116,7 @@ check_native()
   tempfiles $child.{bt,err}
   (set +ex; testrun ${abs_builddir}/backtrace --backtrace-exec=${abs_builddir}/$child 1>$child.bt 2>$child.err; true)
   cat $child.{bt,err}
-  check_unsupported $child.err $child
+  check_native_unsupported $child.err $child
   check_all $child.{bt,err} $child
 }
 
@@ -140,6 +147,6 @@ check_native_core()
   tempfiles $core{,.{bt,err}}
   (set +ex; testrun ${abs_builddir}/backtrace -e ${abs_builddir}/$child --core=$core 1>$core.bt 2>$core.err; true)
   cat $core.{bt,err}
-  check_unsupported $core.err $child-$core
+  check_native_unsupported $core.err $child-$core
   check_all $core.{bt,err} $child-$core
 }
diff --git a/tests/run-backtrace-dwarf.sh b/tests/run-backtrace-dwarf.sh
index a133b32..8834048 100755
--- a/tests/run-backtrace-dwarf.sh
+++ b/tests/run-backtrace-dwarf.sh
@@ -26,5 +26,5 @@ unset VALGRIND_CMD
 tempfiles dwarf.{bt,err}
 (set +ex; testrun ${abs_builddir}/backtrace-dwarf 1>dwarf.bt 2>dwarf.err; true)
 cat dwarf.{bt,err}
-check_unsupported dwarf.err dwarf
+check_native_unsupported dwarf.err dwarf
 check_main dwarf.bt dwarf
-- 
1.7.1


                 reply	other threads:[~2014-06-13 23:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1402700692-22091-1-git-send-email-mjw@redhat.com \
    --to=mjw@redhat.com \
    --cc=elfutils-devel@lists.fedorahosted.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).