1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-09 21:30:42 +00:00

Print logs on error in CI

Because we trap the error signal and run a error handler, logs were not
printed. I moved the printing of test-suite.log to the error handler and
also added so that config.log is printed on failure.
This commit is contained in:
William Wennerström 2020-12-21 16:07:58 +01:00
parent 910512a920
commit 2ee883aa1a
No known key found for this signature in database
GPG Key ID: E1382990BEDD319B

View File

@ -1,8 +1,19 @@
#!/usr/bin/env bash
log_content()
{
echo
echo "Content of $1:"
cat "$1"
}
error_handler()
{
ERR_CODE=$?
log_content ./config.log
log_content ./test-suite.log
echo
echo "Error ${ERR_CODE} with command '${BASH_COMMAND}' on line ${BASH_LINENO[0]}. Exiting."
echo
@ -114,10 +125,6 @@ do
$MAKE CC="${CC}"
$MAKE check
if [ $? -eq 1 ]; then
cat ./test-suite.log
fi
./profanity -v
$MAKE clean
done