runtests 1.0KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/bash
  2. # ffoo test framework
  3. # See LICENSE file for copyright and license details.
  4. die() {
  5. echo "$@" && exit 9
  6. }
  7. export LC_ALL=C
  8. export TF_DIR=${TF_DIR:-tfkit}
  9. export TF_SUITE="${TF_SUITE:-tests}"
  10. export TF_ARTIFACTS="${TF_ARTIFACTS:-tfkit-artifacts}"
  11. export TF_COLLECT="${TF_COLLECT:-auto}"
  12. . $TF_DIR/include/harness.sh \
  13. || die "cannot import harness; is TF_DIR set properly?: $TF_DIR"
  14. usage() {
  15. echo "usage: $(basename $0) [-c|-C] [-t tests_re] [-s subtest_re] [-p binpath] [-v] [-d]" >&2
  16. exit 2
  17. }
  18. while true; do case "$1" in
  19. -c|--collect) TF_COLLECT=always; shift ;;
  20. -C|--no-collect) TF_COLLECT=never; shift ;;
  21. -t|--filter-test) export TF_FILTER_TEST="$2"; shift 2 ;;
  22. -s|--filter-subtest) export TF_FILTER_SUBTEST="$2"; shift 2 ;;
  23. -p|--prefix) export PATH="$(readlink -f "$2")/bin:$PATH"; shift 2 ;;
  24. -d|--debug) export TF_DEBUG=true; shift ;;
  25. -v|--verbose) export TF_VERBOSE=true; shift ;;
  26. "") break ;;
  27. *) usage ;;
  28. esac done
  29. time tf_run_tests