summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/autoconf/autoconf/autotest-automake-result-format.patch
blob: 38725574bac8a6b0ccf934af3751482d07a307ac (plain)
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
From b28bd61e4716e744617bd681a5b0d5472f62bd67 Mon Sep 17 00:00:00 2001
From: Ross Burton <ross.burton@intel.com>
Date: Thu, 12 Mar 2020 17:25:45 +0000
Subject: [PATCH] autotest-automake-result-format.patch

Upstream-Status: Inappropriate [oe specific]

---
 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 bf18866..8097523 100644
--- a/lib/autotest/general.m4
+++ b/lib/autotest/general.m4
@@ -427,6 +427,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.
@@ -540,6 +543,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"])
@@ -728,10 +735,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
@@ -757,6 +764,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
@@ -1139,7 +1147,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"
 }
 
@@ -1165,42 +1175,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