summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAaron Merey <[email protected]>2024-07-11 19:30:41 -0400
committerAaron Merey <[email protected]>2024-07-11 19:30:41 -0400
commit39e962f063b5e8b9c602017c8bc79f03f31873bb (patch)
tree380d31a8cccf743053ca69f21fc62fd56a7cff22 /tests
parent38635004386c7814bd81e00f756f6f2a3f7a5612 (diff)
tests/run-sysroot.sh: Avoid testing output that depends on LZMA support
run-sysroot.sh checks whether a backtrace generated by eu-stack contains symbol names found in binaries under a test sysroot. Two frames in the backtrace contain symbol names that must be read from .gnu_debugdata. However this section can only be read if elfutils was built with LZMA support. If not, then the symbol names will be absent from the backtrace. Test the eu-stack output with these 2 frames removed in order to prevent a test failure when LZMA support is missing. Signed-off-by: Aaron Merey <[email protected]>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/run-sysroot.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/run-sysroot.sh b/tests/run-sysroot.sh
index 7f7d3f06..cfdc51e9 100755
--- a/tests/run-sysroot.sh
+++ b/tests/run-sysroot.sh
@@ -17,8 +17,6 @@
. $srcdir/test-subr.sh
-set -ex;
-
tmpdir="$(mktemp -d)"
trap "rm -rf -- ${tmpdir}" EXIT
@@ -28,13 +26,16 @@ tar xjf "${abs_srcdir}/testfile-sysroot.tar.bz2" -C "${tmpdir}"
testrun "${abs_top_builddir}"/src/stack --core "${tmpdir}/core.bash" \
--sysroot "${tmpdir}/sysroot" >"${tmpdir}/stack.out"
+# Remove 2 stack frames with symbol names contained in .gnu_debugdata.
+# Whether or not these names appear in the output depends on if elfutils
+# was built with LZMA support.
+sed -i '4,5d' "${tmpdir}/stack.out"
+
# check that we are able to get fully symbolized backtrace
-testrun diff "${tmpdir}/stack.out" - <<\EOF
+testrun_compare cat "${tmpdir}/stack.out" <<\EOF
PID 431185 - core
TID 431185:
#0 0x0000ffff8ebe5a8c kill
-#1 0x0000aaaae5663f20 kill_shell
-#2 0x0000aaaae5667a98 termsig_handler.part.0
#3 0x0000aaaae562b2fc execute_command
#4 0x0000aaaae561cbb4 reader_loop
#5 0x0000aaaae5611bf0 main