tests: skip -k tests on unsupported architectures

* tests/strace-k.test: When actual strace -k output doesn't match the
expected output because of limited architecture support, skip the test
on architectures that are not currently supported by libdw.
This commit is contained in:
Дмитрий Левин 2018-04-11 15:41:40 +00:00
parent ddb5a4ba73
commit fd4a485828

View File

@ -51,5 +51,25 @@ LC_ALL=C grep -E -x -f "$expected" < "$OUT" > /dev/null || {
Failed pattern of expected output: $(cat "$expected")
Actual output: $(cat "$OUT")
__EOF__
pattern=
case "$STRACE_ARCH" in
aarch64|i386|ppc*|s390*|sparc*|x32|x86*)
# These architectures are supported by elfutils libdw,
# see grep '\<HOOK\>.*\<abi_cfi\>' elfutils/backends
;;
arm) pattern='No DWARF information found'
# This is also supported by elfutils libdw
# but the latter needs debuginfo for unwinding.
;;
*) pattern='Unwinding not supported for this architecture'
;;
esac
if [ -n "$pattern" ] &&
LC_ALL=C grep -x " > $pattern" < "$LOG" > /dev/null; then
cat < "$LOG" >&2
skip_ "stack tracing is not fully supported on $STRACE_ARCH yet"
fi
dump_log_and_fail_with "$STRACE $args output mismatch"
}