mmodify readme, check arguments

This commit is contained in:
woojin
2023-08-27 09:39:31 +09:00
parent 6858e18da2
commit 15b8c714dc
2 changed files with 22 additions and 1 deletions

View File

@@ -16,6 +16,14 @@ run_linters || exit 1
# Executes test for each runner.
echo "Running with $RUNNER..."
if [ $# != 1 ]
then
echo "==============================="
echo "Invalid number. $# arguments given."
echo "Usage: ./grade.sh <test_number>"
echo "Example: ./grade.sh 1"
exit 1
fi
TEST_NAME=$(printf "TEST%02d" $1)
case $TEST_NAME in
TEST01)
@@ -102,4 +110,5 @@ esac
# Runs tests.
SCORE=$(run_tests)
echo Your score: $SCORE
NUM_TESTS=${#TESTS[@]}
echo Your score: ${SCORE}/${NUM_TESTS}