1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
From a7e722f974e2529d3e564d8d94c86cc8bdbc40e7 Mon Sep 17 00:00:00 2001
From: Radu Patriu <radu.patriu@enea.com>
Date: Mon, 24 Mar 2014 16:33:19 +0200
Subject: [PATCH] autotest: new testsuite option to enable automake test
result format
* lib/autotest/general.m4: added "--am-fmt | -A" command line
parameter for testsuite script to enable "RESULT: testname" output;
will be used by yocto ptest packages.
Upstream-Status: Pending
Signed-off-by: Radu Patriu <radu.patriu@enea.com>
---
lib/autotest/general.m4 | 39 +++++++++++++++++++++++++++++----------
1 file changed, 29 insertions(+), 10 deletions(-)
diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4
index 60c0352..c1f5a9b 100644
--- a/lib/autotest/general.m4
+++ b/lib/autotest/general.m4
@@ -412,6 +412,9 @@ at_recheck=
# Whether a write failure occurred
at_write_fail=0
+# Automake result format "result: testname"
+at_am_fmt=false
+
# The directory we run the suite in. Default to . if no -C option.
at_dir=`pwd`
# An absolute reference to this testsuite script.
@@ -530,6 +533,10 @@ do
at_check_filter_trace=at_fn_filter_trace
;;
+ --am-fmt | -A )
+ at_am_fmt=:
+ ;;
+
[[0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]])
at_fn_validate_ranges at_option
AS_VAR_APPEND([at_groups], ["$at_option$as_nl"])
@@ -718,10 +725,10 @@ m4_divert_push([HELP_MODES])dnl
cat <<_ATEOF || at_write_fail=1
Operation modes:
- -h, --help print the help message, then exit
- -V, --version print version number, then exit
- -c, --clean remove all the files this test suite might create and exit
- -l, --list describes all the tests, or the selected TESTS
+ -h, --help print the help message, then exit
+ -V, --version print version number, then exit
+ -c, --clean remove all the files this test suite might create and exit
+ -l, --list describes all the tests, or the selected TESTS
_ATEOF
m4_divert_pop([HELP_MODES])dnl
m4_wrap([m4_divert_push([HELP_TUNING_BEGIN])dnl
@@ -747,6 +754,7 @@ Execution tuning:
-d, --debug inhibit clean up and top-level logging
[ default for debugging scripts]
-x, --trace enable tests shell tracing
+ -A, --am-fmt automake result format "result: testname"
_ATEOF
m4_divert_pop([HELP_TUNING_BEGIN])])dnl
m4_divert_push([HELP_END])dnl
@@ -1162,7 +1170,9 @@ at_fn_group_banner ()
[*]) at_desc_line="$[1]: " ;;
esac
AS_VAR_APPEND([at_desc_line], ["$[3]$[4]"])
- $at_quiet AS_ECHO_N(["$at_desc_line"])
+ if ! $at_am_fmt; then
+ $at_quiet AS_ECHO_N(["$at_desc_line"])
+ fi
echo "# -*- compilation -*-" >> "$at_group_log"
}
@@ -1188,42 +1198,51 @@ _ATEOF
case $at_xfail:$at_status in
yes:0)
at_msg="UNEXPECTED PASS"
+ at_am_msg="XPASS"
at_res=xpass
at_errexit=$at_errexit_p
at_color=$at_red
;;
no:0)
at_msg="ok"
+ at_am_msg="PASS"
at_res=pass
at_errexit=false
at_color=$at_grn
;;
*:77)
at_msg='skipped ('`cat "$at_check_line_file"`')'
+ at_am_msg="SKIP"
at_res=skip
at_errexit=false
at_color=$at_blu
;;
no:* | *:99)
at_msg='FAILED ('`cat "$at_check_line_file"`')'
+ at_am_msg="FAIL"
at_res=fail
at_errexit=$at_errexit_p
at_color=$at_red
;;
yes:*)
at_msg='expected failure ('`cat "$at_check_line_file"`')'
+ at_am_msg="XFAIL"
at_res=xfail
at_errexit=false
at_color=$at_lgn
;;
esac
echo "$at_res" > "$at_job_dir/$at_res"
- # In parallel mode, output the summary line only afterwards.
- if test $at_jobs -ne 1 && test -n "$at_verbose"; then
- AS_ECHO(["$at_desc_line $at_color$at_msg$at_std"])
+ if $at_am_fmt; then
+ AS_ECHO(["$at_am_msg: $at_desc"])
else
- # Make sure there is a separator even with long titles.
- AS_ECHO([" $at_color$at_msg$at_std"])
+ # In parallel mode, output the summary line only afterwards.
+ if test $at_jobs -ne 1 && test -n "$at_verbose"; then
+ AS_ECHO(["$at_desc_line $at_color$at_msg$at_std"])
+ else
+ # Make sure there is a separator even with long titles.
+ AS_ECHO([" $at_color$at_msg$at_std"])
+ fi
fi
at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
case $at_status in
--
1.7.9.5
|