|
@@ -7,9 +7,9 @@
|
7
|
7
|
|
8
|
8
|
__tf_collect_if_needed() {
|
9
|
9
|
#
|
10
|
|
- # Collect artifact if exit status suggests it
|
|
10
|
+ # Collect relic if exit status suggests it
|
11
|
11
|
#
|
12
|
|
- # Use test exit status $1 to help decide if artifacts are
|
|
12
|
+ # Use test exit status $1 to help decide if relics are
|
13
|
13
|
# needed, and collect them if so.
|
14
|
14
|
#
|
15
|
15
|
# If TF_COLLECT is set to "always", collect regardless of
|
|
@@ -18,7 +18,7 @@ __tf_collect_if_needed() {
|
18
|
18
|
# or 1 (pass or bailout); in that case do nothing.
|
19
|
19
|
#
|
20
|
20
|
local tes=$1 # test exit status
|
21
|
|
- local will # should we collect artifacts?
|
|
21
|
+ local will # should we collect relics?
|
22
|
22
|
case "$TF_COLLECT:$tes" in
|
23
|
23
|
always:*) will=true ;;
|
24
|
24
|
never:*) will=false ;;
|
|
@@ -28,8 +28,8 @@ __tf_collect_if_needed() {
|
28
|
28
|
*) tf_exit_bailout "bad value of TF_COLLECT: $TF_COLLECT" ;;
|
29
|
29
|
esac
|
30
|
30
|
$will || return 0
|
31
|
|
- mkdir -p "$artifact_dir/$stamp"
|
32
|
|
- cp -r "$tmpdir"/* "$artifact_dir/$stamp"
|
|
31
|
+ mkdir -p "$relic_dir/$stamp"
|
|
32
|
+ cp -r "$tmpdir"/* "$relic_dir/$stamp"
|
33
|
33
|
}
|
34
|
34
|
|
35
|
35
|
__tf_header() {
|
|
@@ -90,23 +90,24 @@ tf_run_tests() {
|
90
|
90
|
local tmpdir="" # test temporary dir
|
91
|
91
|
local tname="" # test name
|
92
|
92
|
local tes=0 # test result
|
93
|
|
- local stamp="" # test stamp to use as artifact name
|
94
|
|
- local tf_dir tf_suite # to keep absolute paths for TF_RUN
|
95
|
|
- local artifact_dir # where to keep artifacts
|
96
|
|
- artifact_dir="$(readlink -f "$TF_ARTIFACTS")"
|
|
93
|
+ local stamp="" # test stamp to use as relic name
|
|
94
|
+ local tf_dir # to keep absolute path for TF_RUN
|
|
95
|
+ local relic_dir # where to keep relics
|
|
96
|
+ relic_dir="$(readlink -f "$TF_RELICS")"
|
97
|
97
|
__tf_header
|
98
|
98
|
tf_debug "TF_VERSION='$TF_VERSION'"
|
99
|
99
|
tf_dir="$(readlink -f "$TF_DIR")"
|
100
|
|
- tf_suite="$(readlink -f "$TF_SUITE")"
|
101
|
100
|
es=0
|
102
|
101
|
for tname in $(tf_enum_tests | grep -e "$TF_FILTER_TEST");
|
103
|
102
|
do
|
104
|
103
|
tf_think "... $tname"
|
105
|
104
|
tmpdir=$(mktemp -d)
|
106
|
|
- stamp=$(date "+artifacts-$tname-%Y%m%d-%H%M%S")
|
|
105
|
+ stamp=$(date "+relics-$tname-%Y%m%d-%H%M%S")
|
107
|
106
|
cp -r "$TF_SUITE/$tname/"* "$tmpdir"
|
108
|
107
|
pushd "$tmpdir" >/dev/null
|
109
|
|
- TF_DIR="$tf_dir" TF_SUITE=$tf_suite TF_TEST="$tname" \
|
|
108
|
+ TF_DEBUG=$TF_DEBUG TF_VERBOSE=$TF_VERBOSE \
|
|
109
|
+ TF_DIR="$tf_dir" TF_TEST="$tname" \
|
|
110
|
+ TF_FILTER_SUBTEST=$TF_FILTER_SUBTEST \
|
110
|
111
|
./TF_RUN
|
111
|
112
|
tes=$?
|
112
|
113
|
__tf_collect_if_needed $tes
|