codec: hxxx_helper: make debug messages optional
[vlc.git] / test / make_check_wrapper.sh
blob8ac3acf996fb18a9bc410201828a3db25c75bccc
1 #!/bin/sh
3 # Helper used to print more information (log + core dump) about a failing test
5 ulimit -c unlimited
7 make check $*
8 ret=$?
10 if [ $ret -eq 0 ] || ! (which gdb >/dev/null);then
11 exit $ret
14 # test failed
16 for i in $(find -name test-suite.log);do
17 # Search for a failing test
18 error_cnt=$(sed -n 's/^# FAIL: *\([^ ]\+\)/\1/p' "$i")
19 if [ $error_cnt -gt 0 ];then
20 cat "$i"
22 test_path=$(dirname "$i")
23 core_path="$test_path/core"
24 failing_test=$(sed -n 's/^FAIL \([^ ]\+\) (exit status:.*/\1/p' ${test_path}/test-suite.log)
25 if [ -f "$core_path" -a ! -z "$failing_test" ];then
26 echo "Printing core dump:"
27 echo ""
28 gdb "$test_path/$failing_test" -c "$core_path" \
29 -ex "set pagination off" \
30 -ex "thread apply all bt" \
31 -ex "quit"
34 done
36 exit $ret