|
@@ -2,19 +2,12 @@
|
2
|
2
|
# ffoo test framework
|
3
|
3
|
# See LICENSE file for copyright and license details.
|
4
|
4
|
|
5
|
|
-export TF_VERSION="0.0.4"
|
|
5
|
+TF_VERSION="0.0.5"
|
6
|
6
|
|
7
|
7
|
die() {
|
8
|
8
|
echo "$@" && exit 9
|
9
|
9
|
}
|
10
|
10
|
|
11
|
|
-export LC_ALL=C
|
12
|
|
-export TF_DIR=${TF_DIR:-$(dirname "$0")}
|
13
|
|
-export TF_SUITE="${TF_SUITE:-tests}"
|
14
|
|
-export TF_ARTIFACTS="${TF_ARTIFACTS:-tfkit-artifacts}"
|
15
|
|
-export TF_COLLECT="${TF_COLLECT:-auto}"
|
16
|
|
-
|
17
|
|
-
|
18
|
11
|
usage() {
|
19
|
12
|
echo "usage: $(basename "$0") [-c|-C] [-t tests_re] [-s subtest_re] [-p binpath] [-v] [-d]" >&2
|
20
|
13
|
exit 2
|
|
@@ -25,20 +18,33 @@ version() {
|
25
|
18
|
exit 0
|
26
|
19
|
}
|
27
|
20
|
|
|
21
|
+LC_ALL=C
|
|
22
|
+TF_DIR=${TF_DIR:-$(dirname "$0")}
|
|
23
|
+TF_SUITE="${TF_SUITE:-tests}"
|
|
24
|
+TF_ARTIFACTS="${TF_ARTIFACTS:-tfkit-artifacts}"
|
|
25
|
+TF_COLLECT="${TF_COLLECT:-auto}"
|
|
26
|
+
|
28
|
27
|
while true; do case "$1" in
|
29
|
|
- -c|--collect) TF_COLLECT=always; shift ;;
|
30
|
|
- -C|--no-collect) TF_COLLECT=never; shift ;;
|
31
|
|
- -t|--filter-test) export TF_FILTER_TEST="$2"; shift 2 ;;
|
32
|
|
- -s|--filter-subtest) export TF_FILTER_SUBTEST="$2"; shift 2 ;;
|
33
|
|
- -p|--prefix) export PATH="$(readlink -f "$2")/bin:$PATH"; shift 2 ;;
|
34
|
|
- -d|--debug) export TF_DEBUG=true; shift ;;
|
35
|
|
- -v|--verbose) export TF_VERBOSE=true; shift ;;
|
36
|
|
- --version) version ;;
|
|
28
|
+ -c|--collect) TF_COLLECT=always; shift ;;
|
|
29
|
+ -C|--no-collect) TF_COLLECT=never; shift ;;
|
|
30
|
+ -d|--debug) TF_DEBUG=true; shift ;;
|
|
31
|
+ -p|--prefix) export PATH="$(readlink -f "$2")/bin:$PATH"
|
|
32
|
+ shift 2 || usage ;;
|
|
33
|
+ -s|--filter-subtest) TF_FILTER_SUBTEST="$2"; shift 2 || usage ;;
|
|
34
|
+ -t|--filter-test) TF_FILTER_TEST="$2"; shift 2 || usage ;;
|
|
35
|
+ -v|--verbose) TF_VERBOSE=true; shift ;;
|
37
|
36
|
--version-semver) echo "$TF_VERSION"; exit 0 ;;
|
|
37
|
+ --version) version ;;
|
38
|
38
|
"") break ;;
|
39
|
39
|
*) usage ;;
|
40
|
40
|
esac done
|
41
|
41
|
|
|
42
|
+export LC_ALL
|
|
43
|
+export TF_DIR TF_SUITE TF_ARTIFACTS
|
|
44
|
+export TF_COLLECT TF_FILTER_SUBTEST TF_FILTER_TEST
|
|
45
|
+export TF_DEBUG TF_VERBOSE
|
|
46
|
+export TF_VERSION
|
|
47
|
+
|
42
|
48
|
. "$TF_DIR/include/harness.sh" \
|
43
|
49
|
|| die "cannot import harness; is TF_DIR set properly?: $TF_DIR"
|
44
|
50
|
|