]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
tests: run-backtrace-demangle.sh check exitcode and max number of frames.
authorMark Wielaard <mjw@redhat.com>
Thu, 16 Jan 2014 08:45:51 +0000 (09:45 +0100)
committerMark Wielaard <mjw@redhat.com>
Mon, 20 Jan 2014 10:11:05 +0000 (11:11 +0100)
There can be more than 3 frames, but depending on the system/installed
glibc we might not be able to unwind fully till the end.
cxxfunc -> f -> main
Expect to see the top two and a warning that there are more frames
(exit code 1)

Signed-off-by: Mark Wielaard <mjw@redhat.com>
tests/ChangeLog
tests/run-backtrace-demangle.sh

index df5c509ae85881fa5d02049a23243c16d060dcd4..c9f94ff73975416ccd29a4f138120b24f7851558 100644 (file)
@@ -1,3 +1,7 @@
+2014-01-16  Mark Wielaard  <mjw@redhat.com>
+
+       * run-backtrace-demangle.sh: Check exitcode and max number of frames.
+
 2014-01-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        Fix false FAILs on testsuite with ulimit -c unlimited.
index b5bddeb3618af4f8d852dbcb6d308aba591fa362..6e18e77f9655a1c5955ac87d12c89be794094b3a 100755 (executable)
@@ -20,13 +20,22 @@ if test -n "$ELFUTILS_DISABLE_DEMANGLE"; then
 fi
 
 . $srcdir/backtrace-subr.sh
-set -x
 
 child=testfile-backtrace-demangle
 testfiles $child{,.core}
 tempfiles $child.{bt,err}
-testrun ${abs_top_builddir}/src/stack -e $child --core $child.core >$child.bt 2>$child.err
+
+# There can be more than 3 frames, but depending on the system/installed
+# glibc we might not be able to unwind fully till the end.
+# cxxfunc -> f -> main
+# Expect to see the top two and a warning that there are more frames
+# (exit code 1)
+testrun ${abs_top_builddir}/src/stack -n 2 -e $child --core $child.core >$child.bt 2>$child.err || exitcode=$?
 cat $child.{bt,err}
+if test $exitcode != 1 || ! grep "shown max number of frames" $child.err; then
+  echo >&2 $2: expected more than 2 frames
+  false
+fi
 if ! grep -w f $child.bt; then
   echo >&2 $2: no f
   false