2019-11-21 13:43:28 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
TESTS=$(make -f - 2>/dev/null <<EOF
|
|
|
|
include Makefile
|
|
|
|
all:
|
|
|
|
@echo \$(TESTS)
|
|
|
|
EOF
|
|
|
|
)
|
|
|
|
|
|
|
|
echo "-----------------------------------------------------------------";
|
|
|
|
echo "Starting tests";
|
|
|
|
echo "Tests found: ${TESTS}";
|
|
|
|
echo "-----------------------------------------------------------------";
|
|
|
|
for i in $TESTS
|
|
|
|
do
|
|
|
|
echo "Testing $i" ;
|
|
|
|
logfilename="log_run-tests_$i.html";
|
|
|
|
./$i | tee >(ansi2html > $logfilename) ;
|
|
|
|
exitstatus=${PIPESTATUS[0]} ;
|
|
|
|
if [ "0" -eq $exitstatus ] ; then
|
|
|
|
rm $logfilename ;
|
|
|
|
else
|
|
|
|
echo "*** ./$i exit status is $exitstatus" ;
|
2019-12-27 10:25:38 -05:00
|
|
|
if ls /cores/core.*.!drone!src!tests!unit!.libs!$i.* 1> /dev/null 2>&1; then
|
|
|
|
echo "Coredump found";
|
|
|
|
COREDUMP=$(ls /cores/core.*.!drone!src!tests!unit!.libs!$i.*) ;
|
|
|
|
echo $COREDUMP;
|
|
|
|
gdb -ex "set logging file backtrace_$i.txt" -ex "set logging on" -ex "set pagination off" -ex "bt" -ex "bt full" -ex "info threads" -ex "thread apply all bt" -ex "thread apply all bt full" -ex "quit" /drone/src/tests/unit/.libs/$i $COREDUMP ;
|
|
|
|
fi ;
|
2019-11-21 13:43:28 -05:00
|
|
|
echo "*** $logfilename was saved" ;
|
|
|
|
fi ;
|
|
|
|
echo "----------------" ;
|
|
|
|
done
|