driver 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/sh
  2. set -ue
  3. script_home="$(cd "$(dirname "$0")" && pwd)"
  4. usage()
  5. {
  6. cat <<-EOF
  7. Usage: driver [OPTION ...] -- TEST [ARG ...]
  8. This is a test
  9. Options:
  10. --log-file PATH
  11. --trs-file PATH
  12. --color-tests (yes|no) currently ignored
  13. --expect-failure (yes|no) currently ignored
  14. --enable-hard-errors (yes|no) currently ignored
  15. --test-name NAME currently ignored
  16. This command provides an Automake parallel test harness
  17. compatible driver for running TEST with Guile. This is
  18. essentially an adapter for check-guile and it currently
  19. assumes that check-guile is in the parent directory.
  20. EOF
  21. }
  22. misuse() { usage 1>&2; exit 2; }
  23. test_name=''
  24. log_file=''
  25. trs_file=''
  26. while test $# -gt 0; do
  27. case "$1" in
  28. --test-name) test $# -gt 1 || misuse; test_name="$2"; shift 2 ;;
  29. --log-file) test $# -gt 1 || misuse; log_file="$2"; shift 2 ;;
  30. --trs-file) test $# -gt 1 || misuse; trs_file="$2"; shift 2 ;;
  31. --color-tests|--expect-failure|--enable-hard-errors) shift 2 ;;
  32. --) shift; break ;;
  33. *) break ;;
  34. esac
  35. done
  36. test "$test_name" || misuse
  37. test "$log_file" || misuse
  38. test "$trs_file" || misuse
  39. test $# -gt 0 || misuse
  40. program="$1"
  41. shift
  42. cd ..
  43. exec ./check-guile \
  44. --log-file "test-suite/$log_file" \
  45. --trs-file "test-suite/$trs_file" \
  46. "$(basename "$program")"