2023-11-02 22:46:14 -03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2023-11-04 23:34:31 -03:00
|
|
|
counter=1
|
|
|
|
|
2023-11-02 22:46:14 -03:00
|
|
|
# Do this forever
|
|
|
|
while true; do
|
|
|
|
# Capture output of the command
|
|
|
|
output=$(../build/Assignment5 < ../documentation/a5_sample_input_2.txt)
|
2023-11-02 23:35:12 -03:00
|
|
|
# compare against output3.txt, Else print passed
|
2023-11-02 22:46:14 -03:00
|
|
|
if [ "$output" != "$(cat output2.txt)" ]; then
|
|
|
|
echo "Test 2 failed"
|
|
|
|
# show output
|
|
|
|
echo "$output"
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-11-04 23:34:31 -03:00
|
|
|
echo "Test 2 passed $counter times"
|
|
|
|
counter=$((counter+1))
|
2023-11-02 22:46:14 -03:00
|
|
|
done
|