runtests 1.0KB

123456789101112131415161718192021222324252627282930313233343536
  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 || die "this must be run from project root"
  13. usage() {
  14. echo "usage: $(basename $0) [-c|-C] [-t tests_re] [-s subtest_re] [-p binpath] [-v] [-d]" >&2
  15. exit 2
  16. }
  17. while true; do case "$1" in
  18. -c|--collect) TF_COLLECT=always; shift ;;
  19. -C|--no-collect) TF_COLLECT=never; shift ;;
  20. -t|--filter-test) export TF_FILTER_TEST="$2"; shift 2 ;;
  21. -s|--filter-subtest) export TF_FILTER_SUBTEST="$2"; shift 2 ;;
  22. -p|--prefix) export PATH="$(readlink -f "$2")/bin:$PATH"; shift 2 ;;
  23. -d|--debug) export TF_DEBUG=true; shift ;;
  24. -v|--verbose) export TF_VERBOSE=true; shift ;;
  25. "") break ;;
  26. *) usage ;;
  27. esac done
  28. time tf_run_tests