From 23a26bf08b5cb78d1ace16ad01a9d492171e776e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 5 Mar 2017 18:30:14 +0100 Subject: [PATCH] Improve travis backtrace script --- scripts/dev/ci/travis_backtrace.sh | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/scripts/dev/ci/travis_backtrace.sh b/scripts/dev/ci/travis_backtrace.sh index 80b79c220..8adbdadfb 100644 --- a/scripts/dev/ci/travis_backtrace.sh +++ b/scripts/dev/ci/travis_backtrace.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Find all possible core files under current directory. Attempt # 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; } die () { say "$@"; exit 1; } -find . -name *.core -o -name core | while read -r line; do - d=$(dirname $line) - f=$(basename $line) - exe=$(file $line | sed "s/.*from '\([^ \t]*\).*'.*/\1/") - ( cd $d && - test -x $exe || die "Failed to find executable at $exe" && - say "Found corefile for $exe" && - gdb --batch --quiet -ex "thread apply all bt full" $exe $f - ) -done + +case $TESTENV in + py34-cov) + exe=/usr/bin/python3.4 + ;; + py3*-pyqt*) + exe=$(readlink -f .tox/$TESTENV/bin/python) + ;; + *) + 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" {} \;