KLL Compiler
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

sanity.bash 639B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/bash
  2. # Basic sanity check for kll compiler
  3. # Currently runs both versions of the compiler
  4. set +x
  5. SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  6. PASSED=0
  7. FAILED=0
  8. # Results
  9. result() {
  10. echo "--- Results ---"
  11. echo "${PASSED}/$((PASSED+FAILED))"
  12. if (( FAILED == 0 )); then
  13. return 0
  14. else
  15. return 1
  16. fi
  17. }
  18. # Runs a command, increments test passed/failed
  19. # Args: Command
  20. cmd() {
  21. # Run command
  22. echo "CMD: $@"
  23. $@
  24. # Check command
  25. if [[ $? -ne 0 ]]; then
  26. ((FAILED++))
  27. else
  28. ((PASSED++))
  29. fi
  30. }
  31. # Start in kll top-level directory
  32. cd ${SCRIPT_DIR}/..
  33. cmd ./kll.py --version
  34. cmd ./kll --version
  35. result
  36. exit $?