Improve travis backtrace script

This commit is contained in:
Florian Bruhin 2017-03-05 18:30:14 +01:00
parent 8fb640f1ff
commit 23a26bf08b

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
# #
# Find all possible core files under current directory. Attempt # Find all possible core files under current directory. Attempt
# to determine exe using file(1) and dump stack trace with gdb. # to determine exe using file(1) and dump stack trace with gdb.
@ -6,13 +6,18 @@
say () { printf "\033[91m%s\033[39m\n" "$@" >&2; } say () { printf "\033[91m%s\033[39m\n" "$@" >&2; }
die () { say "$@"; exit 1; } die () { say "$@"; exit 1; }
find . -name *.core -o -name core | while read -r line; do
d=$(dirname $line) case $TESTENV in
f=$(basename $line) py34-cov)
exe=$(file $line | sed "s/.*from '\([^ \t]*\).*'.*/\1/") exe=/usr/bin/python3.4
( cd $d && ;;
test -x $exe || die "Failed to find executable at $exe" && py3*-pyqt*)
say "Found corefile for $exe" && exe=$(readlink -f .tox/$TESTENV/bin/python)
gdb --batch --quiet -ex "thread apply all bt full" $exe $f ;;
) *)
done echo "Skipping coredump analysis in testenv $TESTENV!"
exit 0
;;
esac
find . -name *.core -o -name core -exec gdb --batch --quiet -ex "thread apply all bt full" "$exe" {} \;