#!/bin/sh # !!! DO NOT MODIFY THIS FILE !!! RED="\033[31m" GREEN="\033[32m" YELLOW="\033[33m" RESET_COLOR="\033[0m" tests="$@" if [ $# -eq 0 ] then tests="1 2" fi echo "Compiling..." make || exit 1 echo for test in $tests do case $test in 1|2) case $test in 1) echo "compareByName tests" ;; 2) echo "TreeSearchBetween tests" ;; esac ./test $test > tests/$test.out if diff tests/$test.exp tests/$test.out > /dev/null then printf "${GREEN}Tests passed\n$RESET_COLOR" else printf "${RED}Tests failed\n$RESET_COLOR" printf "${YELLOW}Open tests/$test.exp (expected output) and tests/$test.out (your output) to see differences\n$RESET_COLOR" fi echo ;; *) echo "Invalid test number '$test'" ;; esac done