freechat/server/tests/main.sh
2020-07-27 16:16:37 -07:00

36 lines
814 B
Bash

#!/bin/bash
# This script is basically just a convenient launch pad script for running all
# the tests at once
# Most tests should be runnable by doing ./script.sh name_of_test
# First the 'good' input tests
# This is to say that we get input that:
# 1. is properly formatted
# 2. has all the info we need & none we don't
# 3. has basically nothing malicious about it
show_discrepancy() {
expect=$1
actual=$2
result=$3
if [ $expect != $actual ];then
red='\033[1;91m'
nc='\033[0m'
echo -e ${red}==========${nc}
echo "$result" | sed 's/^/\t/g'
echo -e ${red}==========${nc}
fi
}
source ./common.sh
export -f show_discrepancy
echo TestName ExpectedCode ActualCode
bash ./verify_basic_cases.sh
bash ./verify_err_cases.sh
bash ./verify_mal_cases.sh