run.sh 1.0 KB

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. set -eo pipefail
  3. os="unix"
  4. if [[ "$MACHINE" == "Windows" ]]; then
  5. os="win"
  6. fi
  7. bash ../scripts/compile src/interactor-a-plus-b.cpp
  8. bash ../scripts/test-ref r-interactor-a-plus-b-1-1 "$VALGRIND" ./interactor-a-plus-b files/"$os"/input.01 output.01 < files/"$os"/participant.01
  9. tr -d '\r' < output.01 > output.01.nix
  10. bash ../scripts/test-ref r-interactor-a-plus-b-1-2 cat output.01.nix
  11. rm -f output.01 output.01.nix
  12. bash ../scripts/compile src/interactive-a-plus-b.cpp
  13. python src/interactive_runner.py ./interactor-a-plus-b files/"$os"/input.01 output.02 -- ./interactive-a-plus-b 1>interactive_runner.out 2>interactive_runner.err &
  14. echo `/bin/date "+%Y%m%d %T"`
  15. sleep 5
  16. echo `/bin/date "+%Y%m%d %T"`
  17. pkill python
  18. cat interactive_runner.out
  19. cat interactive_runner.err
  20. tr -d '\r' < output.02 > output.02.nix
  21. bash ../scripts/test-ref r-interactor-a-plus-b-2-1 cat output.02.nix
  22. rm -f output.02 output.02.nix interactive-a-plus-b interactive-a-plus-b.exe interactor-a-plus-b interactor-a-plus-b.exe interactive_runner.out interactive_runner.err