mirror of
https://github.com/Hizenberg469/Algorithms-snippets.git
synced 2026-04-19 22:52:23 +03:00
Testing script
This commit is contained in:
27
Testing/mediator2.sh
Normal file
27
Testing/mediator2.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#set -e
|
||||
#g++ code.cpp -o code
|
||||
#g++ gen.cpp -o gen
|
||||
#g++ brute.cpp -o brute
|
||||
#g++ checker.cpp -o checker
|
||||
for((i = 1; ; ++i)); do
|
||||
./generator $i > input_file.txt
|
||||
./solution < input_file.txt > myAnswer.txt
|
||||
./brute_force < input_file.txt > correctAnswer.txt
|
||||
./checker > checker_log.txt
|
||||
ret=$?
|
||||
cat checker_log.txt
|
||||
|
||||
if [ $ret -eq 2 ];
|
||||
then
|
||||
break
|
||||
fi
|
||||
echo "Passed test: " $i
|
||||
done
|
||||
echo "WA on following test case:"
|
||||
cat input_file.txt
|
||||
echo "Your answer is:"
|
||||
cat myAnswer.txt
|
||||
echo "Correct answer is:"
|
||||
cat correctAnswer.txt
|
||||
echo "Error Message:"
|
||||
cat checker_log.txt
|
||||
Reference in New Issue
Block a user