Newer
Older
BROWN='\033[0;33m'
NC='\033[0m'
# Note that this assumes to be called from the Makefile, you may want to adapt it.
FILESIZE=""
if [ ! -d ./tests_logs/ ]; then
rm -rf ./tests_logs/*
if [ -d ./unwanted_logs/ ]; then
rm -rdf ./unwanted_logs
fi
simple_test_files=(
'tests_files/greeting.txt'
'tests_files/long_message.txt'
'tests_files/smile.png'
'tests_files/thumbs-up-nod.gif'
)
advanced_test_files=(
'tests_files/greeting.txt'
'tests_files/long_message.txt'
'tests_files/noice.gif'
)
# echo -e "\nStarting simple tests ...\n"
# i=1
# for FILENAME in "${simple_test_files[@]}"; do
# FILESIZE=$(stat -c%s "$FILENAME")
# echo -e "${BROWN}($i/${#simple_test_files[@]}) Sending \"$FILENAME\" \t[$FILESIZE bytes] with Valgrind${NC}"
# ./tests/simple_test.sh $FILENAME
# if [ $? -ne 0 ]; then
# echo "Tests terminated cause of a failed test"
# exit 0
# fi
# let i++
echo -e "Finished Simple tests."
# Now we ran the advanced tests
i=1
for FILENAME in "${advanced_test_files[@]}"; do
echo -e "\n${BROWN}($i/${#advanced_test_files[@]}) Sending the file \"$FILENAME\" \t[$FILESIZE bytes] with linksimulator and Valgrind${NC}"
if [ $? -ne 0 ]; then
echo "Tests terminated cause of a failed test"
exit 0
else
echo "Can't ran tests cause there's no dir linksimulator/ containing the linksim"
fi