#!/bin/bash # ffoo test framework # See LICENSE file for copyright and license details. die() { echo "$@" && exit 9 } export LC_ALL=C export TF_DIR=${TF_DIR:-tfkit} export TF_SUITE="${TF_SUITE:-tests}" export TF_ARTIFACTS="${TF_ARTIFACTS:-tfkit-artifacts}" export TF_COLLECT="${TF_COLLECT:-auto}" . $TF_DIR/include/harness.sh || die "this must be run from project root" usage() { echo "usage: $(basename $0) [-c|-C] [-t tests_re] [-s subtest_re] [-p binpath] [-v] [-d]" >&2 exit 2 } while true; do case "$1" in -c|--collect) TF_COLLECT=always; shift ;; -C|--no-collect) TF_COLLECT=never; shift ;; -t|--filter-test) export TF_FILTER_TEST="$2"; shift 2 ;; -s|--filter-subtest) export TF_FILTER_SUBTEST="$2"; shift 2 ;; -p|--prefix) export PATH="$(readlink -f "$2")/bin:$PATH"; shift 2 ;; -d|--debug) export TF_DEBUG=true; shift ;; -v|--verbose) export TF_VERBOSE=true; shift ;; "") break ;; *) usage ;; esac done time tf_run_tests