Something went wrong on our end
-
Vincent Hatakeyama authored
Colorizing the logs are done with an unique function for all possible usages. Colorization is redone, with more colors used to ease browsing the logs. Tests are added with the some sample logs.
Vincent Hatakeyama authoredColorizing the logs are done with an unique function for all possible usages. Colorization is redone, with more colors used to ease browsing the logs. Tests are added with the some sample logs.
shell_tests.zsh 708 B
#!/bin/zsh
#
# Run basic tests to avoid regressions
#
here=$(dirname $0)
source $here/odoo_scripts_common
# This should not fail
pushd tests/log
for file in *.txt ;
do
ODOO_TYPE=$(echo -e "$file" | sed -rne "s/([^-]*).*/\1/p")
echo "****** Using log $file (with ODOO_TYPE=$ODOO_TYPE) ******"
cat $file | colorize
analyze $file && return_code=0 || return_code=$?
if [[ "$file" == *fail* ]];
then
if [ "$return_code" -eq 0 ];
then
echo $FATAL expected non-zero as return code
exit 1
else
echo $OK exected FATAL message, ignore it
fi
else
if [ "$return_code" -ne 0 ];
then
echo $FATAL expected zero as return code
exit 1
fi
fi
done
popd