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.

assignment.bash 935B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. # Use example .kll files to check basic kll processing
  3. # Does a diff comparison with a pre-generated file for validation
  4. # Jacob Alexander 2016
  5. SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  6. # Common functions
  7. source ${SCRIPT_DIR}/common.bash
  8. # Start in kll top-level directory
  9. cd ${SCRIPT_DIR}/..
  10. # Cleanup previously generated files
  11. rm -rf ${SCRIPT_DIR}/generated
  12. # Args used for each of the tests
  13. ARGS="--emitter kll --target-dir ${SCRIPT_DIR}/generated"
  14. FAIL_ARGS="--emitter kll --target-dir ${SCRIPT_DIR}/generated --token-debug --parser-token-debug --operation-organization-display --data-organization-display --data-finalization-display"
  15. # Files to check syntax on
  16. FILES=(
  17. examples/assignment.kll
  18. )
  19. ## Tests
  20. cmds "./kll" "${ARGS}" "${FAIL_ARGS}" ${FILES[@]}
  21. cmd diff --color=always ${SCRIPT_DIR}/cmp_assignment/final.kll ${SCRIPT_DIR}/generated/final.kll
  22. ## Tests complete
  23. result
  24. exit $?