[COMMITTED] tests: SKIP backtrace-data and backtrace-dwarf on unsupported arches.

Mark Wielaard mjw at redhat.com
Thu Dec 5 14:32:10 UTC 2013


run-backtrace-data.sh did check stderr whether the arch was unsupported
but the test didn't print that message yet. backtrace-dwarf did print
the message but was missing a check_unsupported test. Also add an explicit
check_main test for backtrace-dwarf.

Signed-off-by: Mark Wielaard <mjw at redhat.com>
---
 tests/ChangeLog              |    5 +++++
 tests/backtrace-data.c       |    4 +++-
 tests/run-backtrace-dwarf.sh |    8 ++++++--
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/tests/ChangeLog b/tests/ChangeLog
index b366689..8992568 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,8 @@
+2013-12-05  Mark Wielaard  <mjw at redhat.com>
+
+	* backtrace-data.c (main): If unsupported also print to stderr.
+	* run-backtrace-dwarf.sh: Add check_unsupported and check_main.
+
 2013-12-04  Mark Wielaard  <mjw at redhat.com>
 
 	* Makefile.am (backtrace-child-biarch): Add $(EXEEXT).
diff --git a/tests/backtrace-data.c b/tests/backtrace-data.c
index f54263b..6d21345 100644
--- a/tests/backtrace-data.c
+++ b/tests/backtrace-data.c
@@ -43,8 +43,10 @@
 #ifndef __x86_64__
 
 int
-main (void)
+main (int argc __attribute__ ((unused)), char **argv)
 {
+  fprintf (stderr, "%s: Unwinding not supported for this architecture\n",
+          argv[0]);
   return 77;
 }
 
diff --git a/tests/run-backtrace-dwarf.sh b/tests/run-backtrace-dwarf.sh
index b24215e..2f4ba0f 100755
--- a/tests/run-backtrace-dwarf.sh
+++ b/tests/run-backtrace-dwarf.sh
@@ -15,6 +15,10 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/test-subr.sh
+. $srcdir/backtrace-subr.sh
 
-testrun ${abs_builddir}/backtrace-dwarf
+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_main dwarf.bt dwarf
-- 
1.7.1



More information about the elfutils-devel mailing list