#! /bin/sh
#-----------------------------------------------------------------------------
#---------   FUNCTIONS USED TO BUILD THE REPORT OF A SET OF TESTS   ----------
#-----------------------------------------------------------------------------

FAILED_TESTS_COUNT=0
PASSED_TESTS_COUNT=0

printReport() {
    TOTAL_TESTS_COUNT=`expr $PASSED_TESTS_COUNT + $FAILED_TESTS_COUNT`
    echo ""
    echo "============================================================================="
    echo "$TOTAL_TESTS_COUNT tests run:"
    if [ $PASSED_TESTS_COUNT -gt 0 ] ; then
        printf "  \033[32m=> $PASSED_TESTS_COUNT tests passed!\033[39m\n"
    fi
    if [ $FAILED_TESTS_COUNT -gt 0 ] ; then
        printf "  \033[31m=> $FAILED_TESTS_COUNT tests failed!\033[39m\n"
    fi
    echo "============================================================================="
    echo ""
}
