Advertisement
diduk001

Bash Stress Testing

Aug 4th, 2021
730
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.69 KB | None | 0 0
  1. #!/usr/bin/bash
  2.  
  3.  
  4. diff_found=0
  5.  
  6. for i in {0..300}
  7. do
  8.         python3 test_gen.py > input
  9.  
  10.         ./right < input > right_output
  11.         ./possible < input > possible_output
  12.  
  13.         if diff -y right_output possible_output > differs;
  14.         then
  15.                 echo "test $i passed"
  16.         else
  17.                 echo "test $i failed"
  18.                 diff_found=1
  19.                 break
  20.         fi
  21. done
  22.  
  23. if [ $diff_found -eq 1 ]
  24. then
  25.         echo "input:"
  26.         cat input
  27.         echo ""
  28.  
  29.         echo "output testing"
  30.         cat possible_output
  31.         echo ""
  32.  
  33.         echo "output right"
  34.         cat right_output
  35.         echo ""
  36.  
  37. else
  38.         echo "accepted"
  39. fi
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement