2018-05-05 23:19:22 +01:00

26 lines
396 B
Bash
Executable File

#!/bin/bash
correct=true
./program This is a test
program_out=$(cat output.txt)
./solution This is a test
solution_out=$(cat output.txt)
if [ "$program_out" == "$solution_out" ]
then
echo "PASS " $program_out " equals " $solution_out
else
echo "FAIL " $program_out " DOES NOT EQUAL " $solution_out
correct=false
fi
if [ "$correct" = true ]
then
echo "PASS";
else
echo "FAIL";
fi