[vlc-commits] test: add make_check_wrapper.sh
Thomas Guillem
git at videolan.org
Wed Nov 28 11:09:41 CET 2018
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Nov 27 14:56:15 2018 +0100| [dabb85a3e3db50cb42545f889b82964d90157ac7] | committer: Thomas Guillem
test: add make_check_wrapper.sh
This helper will print on the standard input the failing test-suite.log and
core dump in case of a failing make check.
This script should be used by build bots in order to find the root cause of
failing tests.
See https://jenkins.videolan.org/job/vlc-continuous/job/vlc-cont-debian-x86_64/5852/console
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dabb85a3e3db50cb42545f889b82964d90157ac7
---
test/make_check_wrapper.sh | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/test/make_check_wrapper.sh b/test/make_check_wrapper.sh
new file mode 100755
index 0000000000..8ac3acf996
--- /dev/null
+++ b/test/make_check_wrapper.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+# Helper used to print more information (log + core dump) about a failing test
+
+ulimit -c unlimited
+
+make check $*
+ret=$?
+
+if [ $ret -eq 0 ] || ! (which gdb >/dev/null);then
+ exit $ret
+fi
+
+# test failed
+
+for i in $(find -name test-suite.log);do
+ # Search for a failing test
+ error_cnt=$(sed -n 's/^# FAIL: *\([^ ]\+\)/\1/p' "$i")
+ if [ $error_cnt -gt 0 ];then
+ cat "$i"
+
+ test_path=$(dirname "$i")
+ core_path="$test_path/core"
+ failing_test=$(sed -n 's/^FAIL \([^ ]\+\) (exit status:.*/\1/p' ${test_path}/test-suite.log)
+ if [ -f "$core_path" -a ! -z "$failing_test" ];then
+ echo "Printing core dump:"
+ echo ""
+ gdb "$test_path/$failing_test" -c "$core_path" \
+ -ex "set pagination off" \
+ -ex "thread apply all bt" \
+ -ex "quit"
+ fi
+ fi
+done
+
+exit $ret
More information about the vlc-commits
mailing list