Testing suite updated
This commit is contained in:
19
check.sh
19
check.sh
@ -5,6 +5,11 @@
|
||||
# The Translators - Spring 2025 #
|
||||
|
||||
TOK_DIR="out"
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
WHITE='\033[0m'
|
||||
PURPLE='\033[0;35m'
|
||||
ORANGE='\033[0;33m'
|
||||
|
||||
if [[ ! -d "$TOK_DIR" ]]; then
|
||||
echo "Directory $TOK_DIR does not exist."
|
||||
@ -19,9 +24,15 @@ for file in "$TOK_DIR"/*; do
|
||||
exp="./tests/sprint$num/expected/$filename.expected"
|
||||
|
||||
if [[ -f "$exp" ]]; then
|
||||
echo -e "--------------------------------------------"
|
||||
echo -e "Checking $file...\n"
|
||||
diff --color=always "$file" "$exp"
|
||||
echo -e "--------------------------------------------\n"
|
||||
diff -q "$file" "$exp" > /dev/null
|
||||
if [[ $? -eq 0 ]]; then
|
||||
echo -e "${GREEN}[✔] ${PURPLE}$filename ${WHITE}passed."
|
||||
else
|
||||
echo -e "\n${RED}[✘] ${PURPLE}$file ${WHITE}failed with an unexpected value..."
|
||||
diff --color=always "$file" "$exp"
|
||||
echo -e ""
|
||||
fi
|
||||
else
|
||||
echo -e "${ORANGE}[-] ${PURPLE}$filename ${WHITE}does not have an expected value."
|
||||
fi
|
||||
done
|
Reference in New Issue
Block a user