This commit is contained in:
Scarlett
2025-05-04 16:23:35 -04:00
parent a61d0a57e8
commit 6bef4bdc26
3 changed files with 35 additions and 26 deletions

24
test.sh
View File

@ -33,8 +33,26 @@ if [ $# -eq 0 ]; then
fi
help() {
echo -e "${GREEN}[HELP] ${YELLOW}Usage: ./test.sh <file> [-exp] ${WHITE}"
echo -e "${GREEN}[HELP] ${YELLOW}To all tests in a folder: ./test/sh <dir>/ [-exp]${WHITE}"
echo -e "${WHITE}-----{ ${BLUE}Test.sh Help ${WHITE}}-----\n"
echo -e "${YELLOW} Arguments: ${WHITE}"
echo -e "${GREEN} -exp ${WHITE} Generate expected output files"
echo -e "${GREEN} -diff ${WHITE} Compare output files with expected output files"
echo -e "${GREEN} -help ${WHITE} Show this help message\n"
echo -e "${YELLOW} Usage: ${WHITE}"
echo -e "${GREEN} ./test.sh <file.alpha> [flags] ${WHITE} Run the test on a single file"
echo -e "${GREEN} ./test.sh <directory> [flags] ${WHITE} Run the test on all files in a directory\n"
echo -e "${YELLOW} Examples: ${WHITE}"
echo -e "${GREEN} ./test.sh test.alpha ${WHITE} Runs test flags in header on test.alpha"
echo -e "${GREEN} ./test.sh test/ ${WHITE} Runs test flags in header on all .alpha files in test/"
echo -e "${GREEN} ./test.sh test/ -exp ${WHITE} Runs test flags in header on all .alpha files in test/ and generates expected output files"
echo -e "${GREEN} ./test.sh test/ -diff ${WHITE} Runs test flags in header on all .alpha files in test/ and compares output files with expected output files"
echo -e "${GREEN} ./test.sh test/ -exp -diff ${WHITE} Runs test flags in header on all .alpha files in test/ and generates expected output files and compares output files with expected output files\n"
echo -e "${YELLOW} Notes: ${WHITE}"
echo -e "${ORANGE} To create a test file, on the first line of the .alpha file, add:"
echo -e "${LIGHTBLUE} (* TEST: [ <test_flags> ] *)"
echo -e "${ORANGE} where <test_flags> are the alpha flags to be used. Ex:"
echo -e "${LIGHTBLUE} (* TEST: [ -debug -asc -tc ] *)\n"
echo -e "${WHITE}-----------------------------------------\n"
exit 1
}
@ -136,4 +154,6 @@ if [ -f "$1" ]; then
echo -e "${RED}[ERROR] ${YELLOW}File $1 is not a .alpha file!${WHITE}"
help
fi
else
help
fi