extras: CI: Bump windows images
[vlc.git] / test / make_check_wrapper.sh
blob9121d2aacf318253ef35ace5edbc78bedb989308
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 if [ -x "$test_path/.libs/$failing_test" ];then
27 failing_test_path="$test_path/.libs/$failing_test"
28 else
29 failing_test_path="$test_path/$failing_test"
31 echo "Printing core dump:"
32 echo ""
33 gdb "$failing_test_path" -c "$core_path" \
34 -ex "set pagination off" \
35 -ex "thread apply all bt" \
36 -ex "quit"
39 done
41 exit $ret