Advertisement
Guest User

stress.sh

a guest
May 29th, 2021
2,034
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. for ((testNum=0;testNum<$4;testNum++))
  4. do
  5. ./$3 > input
  6. ./$2 < input > outSlow
  7. ./$1 < input > outWrong
  8. H1=`md5sum outWrong`
  9. H2=`md5sum outSlow`
  10. if !(cmp -s "outWrong" "outSlow")
  11. then
  12. echo "Error found!"
  13. echo "Input:"
  14. cat input
  15. echo "Wrong Output:"
  16. cat outWrong
  17. echo "Slow Output:"
  18. cat outSlow
  19. exit
  20. fi
  21. done
  22. echo Passed $4 tests
  23.  
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement